Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, could you help me write a c++ code? Please follow the instructions below main.cpp #include #include #include Restaurant.h using namespace std; int main() {

Hi, could you help me write a c++ code? Please follow the instructions below

image text in transcribedimage text in transcribedmain.cpp

#include #include

#include "Restaurant.h" using namespace std;

int main() { /* Type your code here */ return 0; }

------------------------------------------------------------------------

Restaurant.cpp

#include #include #include #include "Restaurant.h" using namespace std;

/* Type your code here */

------------------------------------------------------

Restaurant.h

#ifndef RESTAURANT_H #define RESTAURANT_H

/* Type your code here */ //data members

//function prototypes

#endif

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 restaurantName = 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 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

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

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions

Question

Describe the various types of self-directed retirement plans. L01

Answered: 1 week ago