Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 4 Question 5 Question 6 C++ ASAP Question 4 Two-dimensional arrays can be initialized when they are declared. Given: int table [5] [4]= {3,2,1,2,4,4,2,0,5,3,0,8,10,1,0,4,12,

Question 4 image text in transcribed Question 5 image text in transcribed Question 6 image text in transcribed image text in transcribed C++ ASAP

Question 4 Two-dimensional arrays can be initialized when they are declared. Given: int table [5] [4]= {3,2,1,2,4,4,2,0,5,3,0,8,10,1,0,4,12, 3, 7, 0); Write the for loop to: (a) Find the sum of row 3 of the array. (4 marks) (b) Find the total of column 2 of the array. (4 marks) (c) Find the total of each individual row. (4 marks) (d) Find the total of each individual column. (4 marks) (e) Initialize column 3 to 0. (4 marks) (f) Illustrate the output by drawing the matrix for the table[5] [4] after the process in (e). State all the indexes in the matrix. (5 marks) Question 5 THE ORCHID RESORT is one of the famous hotel in Klang Valley. Their system updating the customers/ visitors check-in and to identify the highest number for the month from January to December (Fix the day into 30 days). Every month, they also conducting a survey to rate the quality of their services in order to improve their services. In the survey, 50 customers (fix the numbers into 50) were asked to rate the quality of the service on a scale of 1 to 5 (1 indicating very bad and 5 indicating excellent). By using the appropriate looping structure, ask the visitors to enter their responses and their room number. Count the frequency for each scale. Display the percentage of the frequency for each scale and the room numbers as well. Use the following functions: TotalVisitors () - to display the month calculate the total of customers for the 30 days. Highest Day() - to determine the number for the highest day and on which day (from day 1 until day 30). Assume the numbers will not been repeated. Survey 0 - to input customer's room number and their response (50 respondence) and to count and display the frequency. It also will output all the room numbers that answering the survey. main() - to input month and number of customers per day (day 1 until day 30) The program also allows the user to repeat this process as often as the user wishes. [25 Mark] Question 6 An admission charge for the HolidayLand varies according to the age of the customer as in Table 1. It will receive the appropriate input and then, it will display the output as in the Figure 4. Use the following functions: void Amount_Before_Tax () //to calculate the amount before Tax void Calculate_Tax () //to calculate the Tax amount void Amount_After_Tax() //to calculate for the sub-total including Tax Your program should allow users to repeat the program as they wish. (Use constant to fix the charges and manipulators for the appropriate output] Table 1: Charges for Visitors Category (Age) Over 50 13-50 7-12 4-6 Below 4 Charge (RM) 20.00 40.00 15.00 10.00 Free PAYMENT Total for Over 50 (2 Person(s)) : RM 40.00 Total for 13 - 50 (2 Person(s)) : RM 80.00 Total for 7-12 (4 Person(s)) : RM 60.00 Total for 4 -6 (0 Person(s)) :RM 0.00 Total for Below 4 (1 person(s)) : FREE TOTAL = RM 180.00 Tax (6%) = RM 10.80 SUB-TOTAL .RM 190.80 THANK YOU..ENJOY YOUR HOLIDAY!! Figure 4: Sample of Output [25 Mark]

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

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions

Question

Discuss the strengths of a businessembedded learning function.

Answered: 1 week ago