Professional Documents
Culture Documents
Alvar John H. Part2Finals
Alvar John H. Part2Finals
Alvar John H. Part2Finals
Final Exam
Program Creation
Note:
When selecting or choosing a payment option, the user must use the
key. The first input data is the tuition fee and the second input data is
the payment option.
Algorithm:
Step 1: START
Step 2: Input fee and mode of payment
Step 3: Read fee and mode of payment
Step 4: if mode is 1
Print totalFee = fee*0.9
Else
If mode is 2
Print totalFee= fee*1.05
Else
If mode is 3
Print totalFee= fee*1.10
Step 5: END
Flowchart:
START
INPUT
Tuition fee and mode of payment
Read
Fee and mode of payment
Print totalFee
END
SOURCE CODE IN WORD
#include <iostream>
using namespace std;
int main() {
float fee;
float totalFee;
int mode;
//Input
cout << "Enter Tuition Fee: ";
cin >> fee;
cout << "Enter Mode of Payment: ";
cin >> mode;
//Total fee
if (mode == 1) {
totalFee = fee * 0.9;
} else if (mode == 2) {
totalFee = fee * 1.05;
} else if (mode == 3) {
totalFee = fee * 1.10;
}
cout << "Your Total fee is: " << totalFee;
return 0;
}
Source code and Outputs
2. Create an algorithm, flowchart, and C++ program that assists an
instructor to evaluate a student’s grade at the end of the semester. It
accepts input grades in percentile form and outputs its grade equivalent.
The program also indicates whether the grade is passing or failing. (25 pts.)
Algorithm:
1. Start
2. Enter your Grade.
3. If grade(x) is equal to 98-100 PRINT “1.00- Passed”
Else if x = 95-97 PRINT “1.25 –Passed”
Else if x = 92-94 PRINT “1.50 –Passed”
Else if x = 89-91 PRINT “1.75 –Passed”
Else if x = 85-88 PRINT “2.00 –Passed”
Else if x = 82-84 PRINT “2.25 –Passed”
Else if x = 80-81 PRINT “2.50 –Passed”
Else if x = 77-79 PRINT “2.75 –Passed”
Else if x = 75-76 PRINT “3.00 –Passed”
Else PRINT “Out of Range -Failed”
4. End
1.00- Passed
98-100
1.25 –Passed
95-97
1.50 –Passed
92-94
1.75 –Passed
89-91
START
2.50–Passed
80-81
2.27 –Passed
77-79
3.00 –Passed
75-76
Out of Range
OTHER
Failed
GRADES
SOURCE CODE IN WORD
#include <iostream>
int main(){
int grade;
cin>>grade;
cout<<"1.00 - Passed";
cout<<"1.25 - Passed";
cout<<"1.50 - Passed";
cout<<"1.50 - Passed";
cout<<"2.00 - Passed";
cout<<"2.25 - Passed";
cout<<"2.50 - Passed";
cout<<"2.75 - Passed";
cout<<"3.00 - Passed";
else
cout<<"Out of Range";
return 0;
}
Source code and Outputs