Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSEB114: PRINCIPLE OF PROGRAMMING Quiz 1. Rules  No cheating  No reference  No discussion  Only best 5 quizzes will be counted in your final marks,

Similar presentations


Presentation on theme: "CSEB114: PRINCIPLE OF PROGRAMMING Quiz 1. Rules  No cheating  No reference  No discussion  Only best 5 quizzes will be counted in your final marks,"— Presentation transcript:

1 CSEB114: PRINCIPLE OF PROGRAMMING Quiz 1

2 Rules  No cheating  No reference  No discussion  Only best 5 quizzes will be counted in your final marks, however, if you are caught cheating, one of your best 5 quizzes will be 0  Those who submitted the quiz later than the time given, will get 0  Good Luck

3 Questions  Create a pseudocode and a flowchart of a program that first prompts the user to enter values for the length of a car trip in kilometers, and the amount of gasoline (in gallons) in the car’s tank at the beginning and end of the trip, and then computes and prints the average gasoline consumption in kilometer per gallon for the trip. (10 marks) (10 marks)

4 Question  Write a pseudocode and flowchart of a program that reads three numbers from the user and then calculates the average of the numbers. The number can be any number, positive or negative. Display the average of the numbers. (10 marks)  Write a pseudocode and flowchart of a program that display a message indicating the educational level of a student based on the student’s number of years of schooling. Use the table below. Print a message to indicate invalid data as well. Number of YearsEducational Level 0None 1-5Elementary 6-8Middle School 9-12High School More than 12College

5 Question  Write a pseudocode or flowchart for a program that estimates the temperature in a freezer (in ° C) given the elapsed time (hours) since a power failure. Assume this temperature (T) is given by where t is the time since the power failure. Your program should prompt the user to enter how long it has been since the start of the power failure in whole hours and minutes. Note that you need to convert the elapsed time into hours. For example, if the user entered 2 30 (2 hours 30 minutes), you would need to convert this to 2.5 hours.


Download ppt "CSEB114: PRINCIPLE OF PROGRAMMING Quiz 1. Rules  No cheating  No reference  No discussion  Only best 5 quizzes will be counted in your final marks,"

Similar presentations


Ads by Google