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 Food Name Service Horse_and_River Riosol Prime_Rib Peter's_Place Fandangos Enter a number from the list 2 1 7 6 2 8 6 3 9 5 4 7 5 6 4

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter9: Records (struct)
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question
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
Service
Horse_and_River
Riosol
Prime_Rib
Peter's Place
Fandangos
Enter a number from the list 2
1
7
6
2
8
6
3
4
7
8.
5
6
4
Transcribed Image Text: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 Service Horse_and_River Riosol Prime_Rib Peter's Place Fandangos Enter a number from the list 2 1 7 6 2 8 6 3 4 7 8. 5 6 4
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
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).
1.1
struct Restaurant
|{
char name[30];
int food;
// rate food
int service; // rate service
};
1.2
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.
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.
List of restaurant and ratings
Food
Name
Service
Horse_and_River
Riosol
Prime_Rib
Peter's Place
Fandangos
1
7
2
8
6
3
4
7
8
6
4
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.
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 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). 1.1 struct Restaurant |{ char name[30]; int food; // rate food int service; // rate service }; 1.2 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. 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. List of restaurant and ratings Food Name Service Horse_and_River Riosol Prime_Rib Peter's Place Fandangos 1 7 2 8 6 3 4 7 8 6 4 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.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
InputStream
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++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning