Alvar John H. Part2Finals

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

CEES 3

Computer Fundamentals and Programming

Final Exam
Program Creation

Alvar, John Henry


BSCE- IA

Engr. Rizabel P. Pastoral

May 27, 2022


1. Create an algorithm, flowchart, and C++ program that calculates and evaluates the students'
tuition fees for one semester based on the payment options.
Key Plans Discount/Interest
1 Cash 10% Discount
2 Two-Installment 5% Interest
3 Three- Installment 10% Interest

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

If mode is 1 totalFee = fee*0.9

If mode is 2 totalFee = fee*1.05

If mode is 3 totalFee = fee*1.10

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.)

Range of Percentile and Grade Equivalent


Range Grade
98-100 1.00 Passed
95-97 1.25 Passed
92-94 1.50 Passed
89-91 1.75 Passed
85-88 2.00 Passed
82-84 2.25 Passed
80-81 2.50 Passed
77-79 2.75 Passed
75-76 3.00 Passed
Other grades Out of Range Failed

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

ENTER YOUR GRADE 2.00 –Passed


85-88

GRADE 2.25 –Passed


82-84 END

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>

using namespace std;

int main(){

int grade;

cout<<"Enter your grade: ";

cin>>grade;

if (grade >= 98 && grade <= 100)

cout<<"1.00 - Passed";

else if (grade >= 95 && grade <= 97)

cout<<"1.25 - Passed";

else if (grade >= 92 && grade <= 94)

cout<<"1.50 - Passed";

else if (grade >= 89 && grade <= 91)

cout<<"1.50 - Passed";

else if (grade >= 85 && grade <= 88)

cout<<"2.00 - Passed";

else if (grade >= 82 && grade <= 84)

cout<<"2.25 - Passed";

else if (grade >= 80 && grade <= 81)

cout<<"2.50 - Passed";

else if (grade >= 77 && grade <= 79)

cout<<"2.75 - Passed";

else if (grade >= 75 && grade <= 76)

cout<<"3.00 - Passed";

else

cout<<"Out of Range";

return 0;

}
Source code and Outputs

You might also like