C++ full course bt Ztechnology
EXAMPLE 1:
write an algorithm and draw a flowchart to determine finalgrade and indicate whether it is passing or failing. The final grade is calculated by the average of marks.
PSUEDO CODE:
1.INPUT FOUR MARKS.
2.CALCULATE THEIR GRADE BY SUMMING AND DIVIDING BY FOUR.
3.IF AVERAGE IS BELOW FIFTY, THEN PRINT FAIL.
4.ELSE PRINT PASS.
ALGORITHM:
1.INPUT M1, M2, MTHM:3, M4.
2.SOLVE THE FORMULA (M1, M2, M3, M4)/4.
3.IF M<50, THEN PRINT FAIL.
4. ELSE PRINT PASS.
FLOWCHART:
EXAMPLE 2:
WRITE AN ALGORITHM AND DRAW A FLOWCHART TO CONVERT LENGTH IN FEET TO CENTIMETRE.
PSUEDO COODE:
1. INPUT LENGTH IN FEET.
2. CONVERT IT TO CM BY MULTIPLYING BY 30.
3. PRINT LENGTH IN CM.
ALGORITHM:
1. INPUT LENGTH IN FEET.
2. MULTIPLY LFT BY 30. HINT: LFT=LENGTH IN FEET
3. PRINT LENGTH IN CM.
FLOWCHART: