You are on page 1of 2

Lab Assignment for Week 6

CS1100 (April-June. 2021): Introduction to Programming

Instructors: Shweta Agrawal, Deepak Khemani, C Siva Ram Murthy, V. Krishna


Nandivada, Meghana Nasre.

Lead Teaching Assistants:

● Viswajit Vishnu. Email: CS18S039@smail.iitm.ac.in

● Sriharsha Chigullapally. Email: cs17d012@cse.iitm.ac.in

● Koushik Kiran Kumar. Email: kkk@cse.iitm.ac.in

Instructions:

● Your program MUST have comments written for all the important statements
explaining their functionality/purpose. A program with insufficient set of
comments will be penalized 15% of the grade.

● Each required output must start from a separate line. The output must contain
proper English sen-tences explaining what the output is.
Task #1.

[do-while loop, no arrays]

Write a program that accepts a sequence of non-negative integers, entered


one per line by a user. Compute the maximum and minimum values entered,
along with the average and the count of values entered. The user will end the
sequence by typing -1 that is not part of the sequence. After reading all the
numbers your program must print the following five messages (assuming the
four values are MAX, MIN, AVERAGE, and COUNT). Let YourCity be your
hometown. Choose appropriate variable types.[ Note : Precision of AVERAGE
is 2 digit after decimal point , YourCity is fixed as Chennai ]

Report from the city of YourCity.

COUNT health centres submitted data on cases.

The maximum number reported in any centre is MAX.

The minimum number reported in any centre is MIN.

The average number of patients admitted in a centre is AVERAGE.

You might also like