Loop While
Counter-Controlled Repetition Examples
- Write a program that reads grades for 5 students in the class and
finds the average grade.
- Write a program that first reads the number of students in the
class, then reads the grade for each student. The program finds the
average grade in the class.
- Write a program that first reads the number of students in the
class, then reads the grade for each student. The program counts the
number of students who got A (grade 95 and above).
- Write a program that first reads the number of students in the
class, then reads the grade for each student. The program finds the
average passing grade (grade 60 and above).
- Write a program that first reads the number of items the person
bought the store and the tax. The program then reads the price for each
item. The program finds the total amount paid after tax applied.
- Write a program that first reads the number of items the person
bought the store. The program then reads the price for each
item. The program finds the number of items that cost 10 dollars and
above.
- Write a program that reads 10-digit integer, and finds and prints
the average of its EVEN digits. If there are no even digits in the input,
the program prints an appropriate message.