Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(1): Create a class called Restaurant that includes: NumberOfOrders (int) that counts the number of orders. It can be accessed by all classes, and its

(1): Create a class called Restaurant that includes:

NumberOfOrders (int) that counts the number of orders. It can be accessed by all classes, and its value will be shared by all objects.

orderName (String). It can be accessed by this class only.

orderPrice (double). It can be accessed by this class only.

Constructor with arguments to initialize the variables.

Accessors (getters) for all required instance variables.

(2) The Bill class includes two methods: getBill and the main methods

getBill

This method receives an array of Restaurant object and calculates the bill price, then returns the amount as a double value.

main

Create an array of object from Restaurant with the following values:

order1 :

order Name : Rice

order Price : 30

order2:

order Name: Pasta

order Price: 40

(3) print the order information with the bill

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

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions

Question

Evaluate the importance of the employee handbook.

Answered: 1 week ago

Question

Derive expressions for the rates of forward and reverse reactions?

Answered: 1 week ago

Question

Write an expression for half-life and explain it with a diagram.

Answered: 1 week ago

Question

What do you mean by underwriting of shares ?

Answered: 1 week ago

Question

Define "Rights Issue".

Answered: 1 week ago