Calculate the earnings of the doctor. Need C, C++, Java, Python, or Perl code for the below question. Important: Do not copy cod

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter10: Pointers
Section10.3: Pointer Arithmetic
Problem 4E
icon
Related questions
Question
16. Calculate the earnings of the doctor. Need C, C++, Java, Python, or Perl code for the below question. Important: Do not copy codes from prepinsta.com.
Question: 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 17, fees is 200 INR. If the patient's age is between
17 and 40, fees is 400 INR. If patient's age is above 40, fees is 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
• Doctor consults a maximum of 20 patients a day
• Enter age value (press Enter without a value to stop):
Example 1:
Input
20
30
40
50
2
M
3
14
Output
Total Income 2000 INR
Note: Input and Output Format should be same as given in the above example.
For any wrong input display INVALID INPUT
Output Format
Total Income 2100 INR
CuCado
Transcribed Image Text:Question: 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 17, fees is 200 INR. If the patient's age is between 17 and 40, fees is 400 INR. If patient's age is above 40, fees is 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 • Doctor consults a maximum of 20 patients a day • Enter age value (press Enter without a value to stop): Example 1: Input 20 30 40 50 2 M 3 14 Output Total Income 2000 INR Note: Input and Output Format should be same as given in the above example. For any wrong input display INVALID INPUT Output Format Total Income 2100 INR CuCado
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage