Create a C++ project to rate Restaurants. Use your surname, the word restaurants and your student...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a C++ project to rate Restaurants. Use your surname, the word restaurants and your student number as the name of the project. E.g. Nkosi_restaurants_30968945 1.1 Create a struct called Restaurant that consists of the name of the restaurant, rating for food (out of 10) and rating for service (out of 10). struct Restaurant |{ 1.2 char name [30]; int food; Declare an array to store the Restaurant structs. 1.3 In the main function: Enter the information of a few restaurants from the keyboard and store the structs in the array. // rate food int service; // rate service NOTE: The name of the restaurants must not contain spaces. See example output below. 1.4 Write displayData() function to receive the array and number of elements and display a numbered list of all the information of all the restaurants. 1.5 In the main function: Call the displayData() function. 1 2 List of restaurant and ratings Name Food Horse_and_River RioSol Prime Rib 3 4 Peter's Place 5 Fandangos 7 8 9 7 Service 6 6 5 8 The user must be able to change the ratings of a restaurant. Ask the user to enter the number of a restaurant on the list. If the number is not within the range of the numbers on the list, show a suitable message and allow the user to enter another number until a valid number is entered. Display the name of the selected restaurant and the current rating for food and service. Ask the user to enter the new rating for food. Validate the rating. If the rating is not within the range of the numbers in the list, show a suitable message indicating that the rating was not changed due to an invalid rating. Ask the user to enter the new rating for service. Validate the rating. If the rating is not within the range of the numbers in the list, show a suitable message indicating that the rating was not changed due to an invalid rating. Call the displayData function to display the updated list. List of restaurant and ratings Name Food 1 2 3 4 Peter's_Place 5 Fandangos Horse_and_River RioSol Prime Rib 7 8 9 7 6 Enter a number from the list 2 Name of restaurant: RioSol Current ratings: Food : 8 Service: 6 1 Horse_and_River 2 RioSol 3 Prime Rib 4 Peter's Place 5 Fandangos List of restaurant and ratings Name Food 7 Enter a new rating for food out of 10: 7 Enter a new rating for service out of 10: 5 79 7 6 Service Process returned 0 (0x0) Press any key to continue. 6658 4 Service 65500 8 4 execution time: 16.911 s 1.6 Write display Best Restaurant() function to receive the array and number of elements and determine which restaurant in the array has the best average rating. Display the name of the restaurant, the rating for food and the rating for service and the average rating. 1.7 Write code to allow the user to remove a number of restaurants from the list. Use a loop. Display the numbered list each time and ask which restaurant must be removed. Enter -1 to quit removing restaurants. NOTE: There must remain at least one element in the array. If the user tries to remove the last element, display a message indicating that no more restaurants can be removed from the list and stop the loop. If the user enters a number from the list to be remove and the number is not on the list, display a suitable message and ask whether another element must be removed. Create a C++ project to rate Restaurants. Use your surname, the word restaurants and your student number as the name of the project. E.g. Nkosi_restaurants_30968945 1.1 Create a struct called Restaurant that consists of the name of the restaurant, rating for food (out of 10) and rating for service (out of 10). struct Restaurant |{ 1.2 char name [30]; int food; Declare an array to store the Restaurant structs. 1.3 In the main function: Enter the information of a few restaurants from the keyboard and store the structs in the array. // rate food int service; // rate service NOTE: The name of the restaurants must not contain spaces. See example output below. 1.4 Write displayData() function to receive the array and number of elements and display a numbered list of all the information of all the restaurants. 1.5 In the main function: Call the displayData() function. 1 2 List of restaurant and ratings Name Food Horse_and_River RioSol Prime Rib 3 4 Peter's Place 5 Fandangos 7 8 9 7 Service 6 6 5 8 The user must be able to change the ratings of a restaurant. Ask the user to enter the number of a restaurant on the list. If the number is not within the range of the numbers on the list, show a suitable message and allow the user to enter another number until a valid number is entered. Display the name of the selected restaurant and the current rating for food and service. Ask the user to enter the new rating for food. Validate the rating. If the rating is not within the range of the numbers in the list, show a suitable message indicating that the rating was not changed due to an invalid rating. Ask the user to enter the new rating for service. Validate the rating. If the rating is not within the range of the numbers in the list, show a suitable message indicating that the rating was not changed due to an invalid rating. Call the displayData function to display the updated list. List of restaurant and ratings Name Food 1 2 3 4 Peter's_Place 5 Fandangos Horse_and_River RioSol Prime Rib 7 8 9 7 6 Enter a number from the list 2 Name of restaurant: RioSol Current ratings: Food : 8 Service: 6 1 Horse_and_River 2 RioSol 3 Prime Rib 4 Peter's Place 5 Fandangos List of restaurant and ratings Name Food 7 Enter a new rating for food out of 10: 7 Enter a new rating for service out of 10: 5 79 7 6 Service Process returned 0 (0x0) Press any key to continue. 6658 4 Service 65500 8 4 execution time: 16.911 s 1.6 Write display Best Restaurant() function to receive the array and number of elements and determine which restaurant in the array has the best average rating. Display the name of the restaurant, the rating for food and the rating for service and the average rating. 1.7 Write code to allow the user to remove a number of restaurants from the list. Use a loop. Display the numbered list each time and ask which restaurant must be removed. Enter -1 to quit removing restaurants. NOTE: There must remain at least one element in the array. If the user tries to remove the last element, display a message indicating that no more restaurants can be removed from the list and stop the loop. If the user enters a number from the list to be remove and the number is not on the list, display a suitable message and ask whether another element must be removed.
Expert Answer:
Answer rating: 100% (QA)
As per your given description i have written the code for all the functions and as well as for removing the restaurant also Please follow inline comments and screenshots for better understanding code ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these general management questions
-
Feather Friends, Incorporated, distributes a high-quality wooden birdhouse that sells for $40 per unit. Variable expenses are $20.00 per unit, and fixed expenses total $160,000 per year. Its...
-
In 2015, a taxpayer purchased a piece of land for 100,000 SR and in 2020; he incurred expenses of 30,000 SR to improve the land. In 2020, he sold the land for 150,000 SR. Required: What is gain or...
-
Two-dimensional array operations: Movie Ratings program ** You have recently collected reviews from four movie reviewers where the reviewers are numbered 1-4. Each reviewer has rated six movies where...
-
Evaluate the expression for the given value(s) of the variable(s). 4x - 7, x = 5/2
-
A solenoidal coil with 25 turns of wire is wound tightly around another coil with 300 turns (see fuample 30.1). The inner solenoid is 25.0 cm long and has a diameter of 2.00 cm. At a certain time,...
-
On January 1 of 2020, Jason and Jill Marsh acquired a home for $500,000 by paying $400,000 down and borrowing $100,000 with a 7 percent loan secured by the home. On January 1, 2021, the Marshes...
-
Suppose we wish to estimate the probability of a rare event (such as a default probability). Let the random variable \(X\) be equal to 1 if the event occurs and to zero otherwise. Then...
-
Compare the optimal solutions obtained in Exercises 2 and 3. Specifically: a. How much higher (lower) is the optimal selling price when the two firms form a cartel to maximize industry profits,...
-
Discuss the current most significant liquidity risk for the banking industry.
-
Tom Zopf owns and manages a computer repair service, which had the following trial balance on December 31, 2014 (the end of its fiscal year). Summarized transactions for January 2015 were as follows....
-
Solve S ( 1 + ) (+) dt
-
Many states allow juvenile offenders to be tried and subsequently punished as adults. Do you believe that this is an appropriate and effective method of addressing juvenile offenses and offenders?...
-
A global company such as HSBC might argue that a move to IFRS would be costly and would not add value to financial statement users. a single set of global accounting standards would reduce the...
-
The UCC balances as at January 1, 2021, are: Class 1: $5,000,000 Class 8: $3,200,000 Class 10: $400,000 Class 12: nil12. Deco has the following capital asset additions and disposals during the year:...
-
You are wondering how best to allocate these costs into cost pools. You settle on forming a total of five pools. Volume related costs, allocated to products using labor hours. Cost related to...
-
The Rolling Rock Restaurant records its payroll weekly for salaried and hourly rate employees separately. Jessica Talbot and Kristen Millar are salaried employees. There annual salaries are...
-
Find the equation of the normal to the curve y=x + 3x at the point where x=1
-
Express mass density in kg/m3 and weight density in lb/ft3. 1. Find the mass density of a chunk of rock of mass 215 g that displaces a volume of 75.0 cm3 of water. 2. A block of wood is 55.9 in. x...
-
John Williams (age 42) is a single taxpayer, and he lives at 1324 Forest Dr., Reno, NV 89501. His Social Security number is 555-94-9358. John's earnings and withholdings as the manager of a local...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Robert Ramos (age 36) is a single taxpayer, living at 8765 Bay Dr., Monterey, CA 93940. His Social Security number is 976-23-5132. Robert's earnings and income tax withholding as the manager of a...
-
A diploid organism has a total of 14 chromosomes and about 20,000 genes per haploid genome. Approximately how many genes are in each linkage group?
-
By conducting testcrosses, researchers have found that the sweet pea plant has seven linkage groups. How many chromosomes would you expect to find in leaf cells of sweet pea plants?
-
Describe the unique features of ascomycetes that facilitate genetic analysis of these fungi.
Study smarter with the SolutionInn App