Based on the above statements, write a complete C main program to do the following tasks: i) Write C statements for the function calcAccomodation() that will calculate the accommodation charge according to the number of days to stay. The functic receives one parameter, days from the main program. The accommodation price is RM120 per night. Return the accommodation charge to the main program. ii) Write C statements for the function calcFee() where it receives three parameter, category, nationality and accomodation_fee. This function will calculate the including accommodation fee (if any). Return the total fee to the main program. iii) Write a C program that shows the main function in your program that will ask for the participant's category (Student/ Non-students (S/N)), nationality (Loca International (L/1)) and accommodation preference (Y/N). If the answer for the question on accommodation is Y, the program will ask for the number of days to main program calls the function calcAccomodation() and calcFee(). Then, display the participant's category, participant nationality, fees, accommodation fees total charge. The output example is as shown below.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Table 3
Category
Local (RM)
International (USD)
Student
890
300
Non-student
600
230
Based on the above statements, write a complete C main program to do the following tasks:
i) Write C statements for the function calcAccomodation() that will calculate the accommodation charge according to the number of days to stay. The function
receives one parameter, days from the main program. The accommodation price is RM120 per night. Return the accommodation charge to the main program.
ii) Write C statements for the function calcFee() where it receives three parameter, category, nationality and accomodation_fee. This function will calculate the total fee
including accommodation fee (if any). Return the total fee to the main program.
iii) Write a C program that shows the main function in your program that will ask for the participant's category (Student/ Non-students (S/N)), nationality (Local or
International (L/)) and accommodation preference (Y/N). If the answer for the question on accommodation is Y, the program will ask for the number of days to stay.The
main program calls the function calcAccomodation() and calcFee(). Then, display the participant's category, participant nationality, fees, accommodation fees and
total charge. The output example is as shown below.
Transcribed Image Text:Table 3 Category Local (RM) International (USD) Student 890 300 Non-student 600 230 Based on the above statements, write a complete C main program to do the following tasks: i) Write C statements for the function calcAccomodation() that will calculate the accommodation charge according to the number of days to stay. The function receives one parameter, days from the main program. The accommodation price is RM120 per night. Return the accommodation charge to the main program. ii) Write C statements for the function calcFee() where it receives three parameter, category, nationality and accomodation_fee. This function will calculate the total fee including accommodation fee (if any). Return the total fee to the main program. iii) Write a C program that shows the main function in your program that will ask for the participant's category (Student/ Non-students (S/N)), nationality (Local or International (L/)) and accommodation preference (Y/N). If the answer for the question on accommodation is Y, the program will ask for the number of days to stay.The main program calls the function calcAccomodation() and calcFee(). Then, display the participant's category, participant nationality, fees, accommodation fees and total charge. The output example is as shown below.
Expert Solution
steps

Step by step

Solved in 7 steps with 6 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY