Create a C# console application with the name ManageRestaurants. Rename Program.cs as Restaurant.cs. Add the below code
Restaurant.cs
using System;
namespace ManageRestaurants
{
class Restaurant
{
//class variables
private static int
storeCounter = 1;
private string[]
Menu;
private int
StoreID;
private Boolean
isOpen;
//no-argument
constructor
public
Restaurant()
{
//set the store id
StoreID = storeCounter;
// increment the storeCounter
storeCounter++;
//set isOpen to true
isOpen = true;
//set the menu size to 3
Menu = new string[3];
}
//constructor with
paramters
public Restaurant(int
iParam, Boolean bParam)
{
//set the store id
StoreID = storeCounter;
// increment the storeCounter
storeCounter++;
//set isOpen
isOpen = bParam;
//set the menu size
Menu = new string[iParam];
}
//method that sets
the Menu
public void
setMenu(String[] menuItems)
{
//set the menu items
Menu = menuItems;
}
/* Use this method if
you want to take menu items from the user
* public void
setMenu()
{
for(int i = 0; i < Menu.Length; i++)
{
Console.Write("Enter Menu Item #" + i + ": ");
Menu[i] = Console.ReadLine();
}
}*/
//method that sets
first three items of the menu
public void
setMenuEasy()
{
Menu[0] = "Hamburger";
Menu[1] = "Hot dog";
Menu[2] = "Pizza";
}
//method that prints
the restaurant details
public void
restaurantDetails()
{
//print the store id
Console.WriteLine("StoreID: " + StoreID);
//print the menu items
Console.WriteLine("Menu: ");
for (int i = 0; i < Menu.Length; i++)
{
Console.WriteLine((i + 1) + ". " + Menu[i]);
}
//print whether the restaurant is open or not
if (isOpen)
Console.WriteLine("The Restaurant is Open.");
else
Console.WriteLine("The Restaurant is Closed.");
Console.WriteLine();
}
static void
Main(string[] args)
{
// create 3 new Restaurants
// one with default constructor
Restaurant r1 = new Restaurant();
// second with open and menu size 4
Restaurant r2 = new Restaurant(4, true);
// third with closed and menu size 3
Restaurant r3 = new Restaurant(3, false);
// call setMenuEasy for 1st and 3rd restaurant
r1.setMenuEasy();
r3.setMenuEasy();
// call setMenu for 2nd restaurant
String[] items = { "Pizza", "Burger", "Pasta" };
r2.setMenu(items);
//print the restaurant details of all the restaurants
r1.restaurantDetails();
r2.restaurantDetails();
r3.restaurantDetails();
Console.ReadLine();
}
}
}
Output:

Program Screenshot:


![Restaurant.cs X Main(stringl] args) ManageRestaurants ManageRestaurants.Restaurant /* Use this method if you want to take men](http://img.homeworklib.com/images/24a9150c-647d-4ce0-b014-c38ec4c24a27.png?x-oss-process=image/resize,w_560)

![vi d nagenestaurarlls.heSLdurdnt 82 0 references static void Main (string[] args) 83 84 85 86 87 // create 3 new Restaurants](http://img.homeworklib.com/images/42164bbd-eed9-4e47-83bb-30626ea54f64.png?x-oss-process=image/resize,w_560)
Let me know if you have any concerns with the above solution.
Design a restaurant class to help manage multiple restaurants and their menus equiremen The class...
program is C#
Create a program to help some local coffee shops manage their menus Requirements The class contains: 1) A method called defaultMenu that returns a String list and has no parameters. When called, the method returns a string list containing the following elements: {"Coffee", "Americano", Cappuccino" A method called custom Menu that returns a String list and has an int parameter. When called, the method will create a new string list, then ask the user for items to...
Create a class called Restaurant that is the base class for all restaurants. It should have attributes for the restaurant's name{protected) and seats (private attribute that represents the number of seats inside the restaurant). Use the UML below to create the methods. Note, the toString prints the name and the number of seats. Derive a class Fastfood from Restaurant This class has one attribute - String slogan (the slogan that the restaurants uses when advertising - e.g., "Best Burgers Ever!")....
Code should be in C# Create a class called SavingsAccount. Use a static variable called annualInterestRate to store the annual interest rate for all account holders. Each object of the class contains a private instance variable savingsBalance, indicating the amount the saver currently has on deposit. Provide method CalculateMonthlyInterest to calculate the monthly interest by multiplying the savingsBalance by annualInterestRate divided by 12 – this interest should be added to savingsBalance. Provide static method setAnnualInterestRate to set the annualInterestRate to a new value....
C++ Create a User class, with a separate interface (User.h) and implementation (User.cpp), comprised of the following attributes: Data members (private): string: username int array: ratings Number of elements should be size int: numRatings Number of books in the database Int: size The capacity of the ratings array (50). Constant Member functions (public): Default constructor Sets username to an empty string, numRatings to 0, size to 50, and all the elements of ratings array to the value 0 Parameterized constructor...
This is the Java Object-oriend project. Please show the detail code and comment for each class. Thank you Create a class Door with the following UML specification: +---------------------+ | Door | +---------------------+ | - isOpen: boolean | +---------------------+ | + Door() | | + isOpen(): boolean | | + open(): void | | + close(): void | | + testDoor(): void | +---------------------+ where isOpen is an instance variable indicating whether the door is currently open or not. The default...
Additional info is this will use a total of four classes Book,
BookApp, TextBook, and TextBookApp.
Also uses Super in the TextBook Class section.
Problem 1 (10 points) Вook The left side diagram is a UML diagram for Book class. - title: String The class has two attributes, title and price, and get/set methods for the two attributes. - price: double Вook) Book(String, double) getTitle(): String setTitle(String): void + getPrice() double setPrice(double): void toString() String + The first constructor doesn't...
Java Program 1. Write a class that reads in a group of test scores (positive integers from 1 to 100) from the keyboard. The main method of the class calls a few other methods to calculate the average of all the scores as well as the highest and lowest score. The number of scores is undetermined but there will be no more than 50. A negative value is used to end the input loop. import java.util.Scanner; public class GradeStat {...
Application should be in C# programming language
Create a class called SavingsAccount. Use a static
variable called annualInterestRate to store the annual interest
rate for all account holders. Each object of the class
contains a private instance variable savingsBalance, indicating the
amount the saver currently has on deposit. Provide method
CalculateMonthlyInterest to calculate the monthly interest by
multiplying the savingsBalance by annualInterestRate divided by 12
– this interest should be added to
savingsBalance. Provide static method
setAnnualInterestRate to set the...
Write a class called Book. Here are the relevant attributes: title author yearPublished bookPriceInCAD Provide a constructor that takes parameters to initialize all the instance variables. The constructor calls the mutator (set) methods to initialize the instance variables. Provide an accessor (get) and mutator (set) for each instance variable. The mutators all validate their parameters appropriately and use them only if valid. If the passed parameter was invalid an IllegalArgumentException will be thrown with a proper error message A...
Using Java programming language, build a class called IntegerSet. Instructions - Create class IntegerSet An IntegerSet object holds integers in the range 0-100 Represented by an array of booleans, such that array element a[i] is set to true if integer i is in the set, and false otherwise Create these constructors and methods for the class IntegerSet() public IntegerSet union(IntegerSet iSet) public IntegerSet intersection(IntegerSet iSet) public IntegerSet insertElement(int data) public IntegerSet deleteElement(int data) public boolean isEqualTo(IntegerSet iSet) public String toString()...