Create several arrays that will store data about restaurants

Assignment Help JAVA Programming
Reference no: EM132081314

Lab Exercise 6.2 Instructions: Code a program that prompts the user for the size of the array.

Using the size, the program creates several arrays that will store information about your restaurants.

There will be one array for the restaurants,

another for the average number of daily customers,

and the last one for the average bill per customer.

The values in each array at the same location are for a given restaurant. Once the arrays are populated, print the information from each array.

The size and input will be the only global variables.

Use printf().

Use the looping structure generally associated with array processing.

Name the program YourLastNameFirstInitialLE62.java.

The methods will be called from the main().

Code your program according to the specifications below.

1st Input Prompt: Code this in a method named arraySize().

How many restaurants do you own?

2nd Input Prompt: In a method named setRestaurants declare the restaurants array and populate it. This method will return the restaurants array to the calling statement. The 9 in the prompt below will print 1 for the first restaurant, then 2 for the 2nd one and so forth. Use the loop-control variable as the value for 9.

Enter restaurant 9:

3rd Input Prompt: In a method named setCustomers declare the noCustomers array and populate it. The Xs in the prompt is the restaurant. The setCustomers method will return the noCustomers array to the calling statement as well as receive the restaurants array from the calling statement. This method will be called as an argument in the call to printRestaurants().

Enter the average number of daily customers for Xxxxxxxxxx:

4th Input Prompt: In a method named calcAvgDailyRev declare the avgBill array and populate it. The Xs in the prompt is the restaurant. The calcAvgDailyRev method will return the avgBill array to the calling statement as well as receive the restaurants array from the calling statement. calcAvgDailyRev() will be called as an argument in the call to printRestaurants().

Enter the average bill per customer for Xxxxxxxxxx:

Output Specifications: Where the Xs represent the restaurant and the Zs the average number of daily customers, the average bill and the average daily revenue.

Code the output print statement in a method named printRestaurants() that accepts the restaurants, noCustomer, and avgBill arrays. The average daily revenue for each restaurant is to be calculated. In the printRestaurants method use a for loop to print the information for each restaurant from each array. The print for the header has to be outside of the for loop because it's printed only once.

MY RESTAURANTS

Restaurant: Xxxxxxxxxxxxxxx
Average No of Daily Customers: Z,ZZ9
Average Bill Per Customer: $ZZ,ZZ9.99
Average Daily Revenue: $ZZZ,ZZZ,ZZ9.99

Restaurant: Xxxxxxxxxxxxxxx
Average No of Daily Customers: Z,ZZ9
Average Bill Per Customer: $ZZ,ZZ9.99
Average Daily Revenue: $ZZZ,ZZZ,ZZ9.99

Reference no: EM132081314

Questions Cloud

Benefit of states having similar or almost similar laws : What is the benefit of states having similar or almost similar laws regarding transactions of goods
List other ideas you have about improving the inner loop : If you need to optimize execution speed by maximizing parallel execution of a matrix multiply, list other ideas you have about improving the inner loop.
Help me define corporate social responsibility : Help me conduct research on a Fortune 500 company and how do you determine just how (or if) the company ranks from a CSR perspective.
Case study analysis - analysis any health service : MBA621 - Healthcare Systems - Case Study Analysis - Improving the health of individual patients through the delivery of healthcare services
Create several arrays that will store data about restaurants : Using the size, the program creates several arrays that will store information about your restaurants.
Write a program which asks the user the enter four strings : Write a C++ program which asks the user the enter 4 C-strings: fileName1, fileName2, word1, and word2.
Design a program to read all numbers into an array : Assume that a file containing a series of integers is named numbers.txt. Design a program to read all numbers into an array.
Display the student name with the highest score : Store ten student names and their individual score in a text file such as Notepad. There will be one score per student.
Calculate the cost per equivalent : ACC203 – Management Accounting - Calculate the cost per equivalent for both direct material and conversion during June. Use weighted average process costing

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd