TCS NQT Coding Question With Answers for 2021 and 2022

A doctor has a clinic where he serves his patients. The doctor’s consultation fees are
different for different groups of patients depending on their age. If the patient’s age is below.The fee is 200 INR. If the patient’s age is between 17 and 40, fees are 400 INR.
If the patient’s age is above 40, fees are 300 INR. Write a code to calculate earnings in a day for
which one array/List of values representing age of patients visited on that day is passed as
input.


Note:
● Age should not be zero or less than zero or above 120.
● Doctors consult a maximum of 20 patients a day.
● Enter age value (press ENTER without value to stop):


Example 1:
Input
20
30
40
50
2
3
14

Output
Total income 2000 INR

Solution in C++

Leave a Reply

Your email address will not be published. Required fields are marked *