You are on page 1of 1

1. You are hired by ABC Company.

The company, deals with selling and distributing potable water


to their consumers. The price per liter of water bought by consumers is:
The company offers 20 pesos per 1 liter of water. If a consumer buys 20 or more liters of water,
the price per liter of water is discounted to 12 pesos per 1 liter of water.
The program should accept the liters of water a consumer buys then, the program should compute
and show the price to be paid by the consumer.
Sales = pricePerLiterOfWater * theNumberOfLiters
Sample program output:
Welcome to ABC Company!
How many liters of water are you buying?
12
Amount to be paid is: 240

2. You are required to create a program which calculates if the average grade of a student is a
passing average grade or failing average grade. The user should enter a student’s grade in science,
mathematics, English, Social Studies and Physical Education.
To compute for the average grade of the students, the program should add all of the grades of the
student and it should be divided by the number of the student’s subjects. In our case, the
computation should be:
Average grade = (ScienceGrade + MathematicsGrade + EnglishGrade + SocialStudiesGrade +
PhysicalEducationGrade) / 5
An average grade is a passing average grade if the average grade is 75 or above. It is a failing
average grade if it is 74 or below.
Sample program output:
Welcome to NVSU!
Enter your grade in English: 75
Enter your grade in Social Studies: 80
Enter your grade in Physical Education: 71
Enter your grade in Mathematics: 87
Enter your grade in Science: 89
Your average grade is: 80.4
It is a passing average grade!

You might also like