0% found this document useful (0 votes)
110 views5 pages

Graded Lab Lab - 7 Introduction To Computing: Topics: If - Else Conditions, While Loop

This document outlines 7 tasks for a graded C++ lab assignment on topics including if-else conditions and while loops. It provides instructions that each task must be in a separate cpp file and function. It also lists the grading scheme which is based 60% on logic, 20% on indentation, and 20% on successful compilation. The tasks involve programs to print even/odd numbers using a while loop, find the maximum of user inputs, calculate a sum of user-entered numbers, calculate an average, print next 5 even numbers, calculate restaurant charges based on age, and calculate worker wages based on hours including overtime pay.

Uploaded by

qwerty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views5 pages

Graded Lab Lab - 7 Introduction To Computing: Topics: If - Else Conditions, While Loop

This document outlines 7 tasks for a graded C++ lab assignment on topics including if-else conditions and while loops. It provides instructions that each task must be in a separate cpp file and function. It also lists the grading scheme which is based 60% on logic, 20% on indentation, and 20% on successful compilation. The tasks involve programs to print even/odd numbers using a while loop, find the maximum of user inputs, calculate a sum of user-entered numbers, calculate an average, print next 5 even numbers, calculate restaurant charges based on age, and calculate worker wages based on hours including overtime pay.

Uploaded by

qwerty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

GRADED LAB

Lab - 7

Introduction to Computing
Topics: IF – ELSE CONDITIONS, WHILE LOOP

Instructions:

• Write separate cpp files for each task.


• If you submit any other file than cpp the lab will not be graded
under no circumstances.
• Each task must be written in a function, if a code is written in
main() the task will not be graded.
• No extra time will be given for the lab tasks.

Grading Scheme

Sr No Type Weightage
1 Logic 60 %
2 Indentation 20 %
3 Compilation 20%

Lab Time: 150 mins (~ 2.5 hours)


Task - 1
Write a C++ program that prints numbers from 1 to 10 and prints if a number is even or odd using if
statement within while loop. You can only use one while loop.

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.

END OF LAB TASKS

You might also like