Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

sample output Table 1: Maternity Services and Prices Information (2 Days Stay) Maternity Services Prices (RM) Baby Care Greater or equal to 950.00 Meal Greater

image text in transcribed

sample output

image text in transcribed

image text in transcribed

Table 1: Maternity Services and Prices Information (2 Days Stay) Maternity Services Prices (RM) Baby Care Greater or equal to 950.00 Meal Greater or equal to 900.00 Covid Test Screening Greater or equal to 805.00 Average Greater or equal to 885.00 Total Price > 885.00 is eligible for free; Free Room Upgrade (1 Day) Free Covid Test Screening (50% for 1 adult) The program must satisfy the following requirements. a) Read the pregnant mom's information from the keyboard which consists of pregnant mom's identification number, name, and maternity services (Baby Care, Meal and Covid Test Screening). The example output on the screen is shown in Figure 1. b) Store all the input data in ID or 2D array. Calculate the average of the three maternity services in function calAvrg. This function should accept baby, meal, and covid as arguments and returns the average value. c) Determine pregnant mom who are eligible for free one room update and 50% discount Covid Test Screening for her husband or not eligible based on the condition in Table 1. d) Write the output that includes the mom's information and the status (eligible or not eligible) in the output file ("result.txt"). The expected output in the output file is shown in Figure 2. Enter pregnant mom's name :Alyssa Enter mom's ID: 112233 Enter prices paid for maternity services -> baby_care, meal and covid_test: 950.00 900.00 930.ee Do u want to enter any record:-> ( Y/N) Y Enter pregnant mom's name :SuYin Enter mom's ID: 123321 Enter prices paid for maternity services -> baby_care, meal and covid_test: 980.00 980.00 800.00 Do u want to enter any record:-> (Y/N) Y Enter pregnant mom's name :Malinha Enter mom's ID: 111333 Enter prices paid for maternity services -> baby_care, meal and covid_test: 960.00 900.00 750.00 Do u want to enter any record:-> ( Y/N) N THANK YOU ID Mom's name Alyssa SuYin Malinha PREGNANT MOM'S ELIGIBILITY INFORMATION Baby_care Meal Covid_test Average 112233 950.ee 900.ee 930.00 926.67 123321 900.ee 900.ee see.ee 866.67 111333 960.ee 900.ee 750.00 870.00 Moms who are eligible: Alyssa 112233 Figure 2: Sample output in the output file (result.txt)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

10. Are you a. a leader? b. a follower? _______

Answered: 1 week ago