Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Question Write a method called displayOrders that will write the details of a fast food company's orders to the screen. These details are stored

Java Question

image text in transcribed

Write a method called displayOrders that will write the details of a fast food company's orders to the screen. These details are stored in objects of the class Order and each object of class Order is stored in an ArrayList called orders. You may assume that orders has been declared elsewhere in the class containing the method displayOrders and is visible inside displayOrders. An Order has many attributes, but the only details of an order to be written to screen are the following, which are stored as individual fields inside an Order object: orderNumber, of type int, that uniquely denotes the order. * customerName, of type String. * suburb, of type String indicating the suburb the order was sent to. totalPrice, of type double showing the total price of all items in an order. The method displayOrders takes no parameters and returns nothing. The screen will show the details of each order on separate lines in the form: 1001 John Citizen Caulfield 24.00 You may assume class Order has accessor (get) methods that return the value of each attribute

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

More Books

Students also viewed these Databases questions