Graded Lab Lab - 7 Introduction To Computing: Topics: If - Else Conditions, While Loop
Graded Lab Lab - 7 Introduction To Computing: Topics: If - Else Conditions, While Loop
Lab - 7
Introduction to Computing
Topics: IF – ELSE CONDITIONS, WHILE LOOP
Instructions:
Grading Scheme
Sr No Type Weightage
1 Logic 60 %
2 Indentation 20 %
3 Compilation 20%
Task – 2
Write a C++ program that takes 5 inputs from a user and prints the maximum value entered using while
loop and if statements.
Task – 3
Write a C++ program that inputs n from user and then takes ‘n’ times number as an input from user and
prints their sum.
Task – 4
Write a C++ program that inputs 5 numbers from user and prints their average value using while loop.
The value displayed must be in floating point.
Task – 5
Write a C++ program that inputs a number from user and prints the next 5 even numbers using while
loop.
Task – 6
You are required to create a software for a restaurant. The restaurant charges $ 7 for people over the age
of 17 and for children under or equal the age of 17 are charged $ 3.5.
Write a C++ program that inputs how many people are eating at the restaurant and asks each person’s
age and calculates the total amount to be charged using while and if else statements.
Task – 7
You have given a contract to workers to build your house. A worker is paid a wage of $.3 for each hour
of their work. If a worker works more than 8 hours then for extra hours the worker will be paid $.4
Write a C++ program that inputs the total number of workers from user and asks how many hours each
worker worked and calculates their wage to be paid.