Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

10.6 Lab: Restaurant and Rating..... C++ PLEASE 10.6 Lab: Restaurant and Rating. (1) Create three files to submit: Restaurant.h - Struct definition and related function

10.6 Lab: Restaurant and Rating..... C++ PLEASE

image text in transcribed

image text in transcribed

image text in transcribed

10.6 Lab: Restaurant and Rating. (1) Create three files to submit: Restaurant.h - Struct definition and related function declarations Restaurant.cpp Related function definitions main.cpp - main() function Build the Restaurant struct with the following specifications (Restaurant.h and Restaurant.cpp): Data members (3 pts) char restaurantName [101] char foodType [101 ] double rating; Related functions SetValues (Restaurant &aRest, char newName[], char newFood[], double newRating); (2 pts) Sets restaurant Name = newName, foodType = newFood, rating = newRating for aRest PrintValues() Prints the Restaurant Name, Food type and Rating. Has a Restaurant parameter Ex. of PrintValues(Restaurant parameter) output: Restaurant Name: Swagath India Food Type: Indian Restaurant Rating: 5.0 (2) In main0 (main.cpp), prompt the user for Restaurant Name, Food Type, and Restaurant Rating, and create one object of the Restaurant (2) In main() (main.cpp), prompt the user for Restaurant Name, Food Type, and Restaurant Rating, and create one object of the Restaurant struct. Example for Input: Enter the Restaurant Name: Enter the Food Type: Enter the Restaurant Rating: 3) Also in main.cpp, call the PrintValues(Restaurant parameter) and this will print the values for you. 4) Before you Run the program, Enter your answers in the input box. For example: Swagath India Indian 5.0 Example of your ouput: Restaurant Name: Swagath India Food Type: Indian Restaurant Rating: 5.0 5) Notes: 1. Make sure to have #include in your Restaurant.cpp file. 2. Make sure to have the statement, cout fixed showpoint setprecision (1); in your printValues() function. 3. Make sure the prompts and the output look the same as the above examples. 4. Use cin.getline (varName, 101); to read restaurant names and food types. 5. Have a newline (endl) at the end of every prompt to match the output. LAB ACTIVITY 10.6.1: Lab: Restaurant and Rating. 0 / 10 Current file: main.cpp Load default template... 1 #include 2 #include 3 4 #include "Restaurant.h" 5 using namespace std; 6 7 int main() { 8 9 /* Type your code here * 10 11 return 0; 12 }

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

1st Edition

1597496251, 978-1597496254

More Books

Students also viewed these Databases questions