Rocky catering service program assignment

Assignment Help JAVA Programming
Reference no: EM132428529

COIT20245 - Introduction to Programming - Central Queensland University

Java Console Program

Details

For this assignment, you are required to develop a Java Console Program to demonstrate you can use Java constructs including input/output via a command line, Java primitive and built-in data types, Java defined objects, selection and looping statements, methods, and various other Java commands. Your program must produce the correct results.

You are only allowed to use techniques which have been covered in the first six weeks of the course, you must use the Scanner object for input and no advanced data structures like arrays will be used. Instructions for this appear in the implementation section of this specification.

What to submit for this assignment

The Java source code:
o RockyCatering.java

A report including a flow chart (UML activity diagram) to depict your validation loop for reading the number of guests, how long it took to create, any problems encountered, and screenshots of the output produced. (Use Alt-PrtScrn to capture just the console window and you can paste it into your Word document). You should test every possibility in the program.

Important: For this assignment, you are required to paste your source code as an appendix into your report, do not worry about the formatting loss.

o ReportAss1.docx
You will submit your files by the due date using the "Assignment 1 Submission" link on the Moodle unit website in the Assessment Block or in the relevant week.

Assignment specification

Rocky Catering Service program.

Rocky Catering Service is a company which delivers a buffet menu for customers in the Rockhampton area. For simplicity, the details of the meals are omitted here.

The management of Rocky Catering Service are requesting a program which allows staff to input a customer's name and the number of guests to be catered for, compute the cost of the meal and produce some statistics.

The minimum number of guests to be catered for will be ten guests.

The standard charge per guest will be $29.50 per head, to encourage more guests to be booked there will be a discount for larger groups the pricing scheme is as follows:

Ten to twenty guests will be $29.50 per head.
Twenty-one to forty guests will be the cost of twenty guests (at $29.50 per head) $590.00 plus $24.50 per head after that.
Over forty guests will be the cost of forty guests $1,080.00 plus $19.50 per head after that.

You are to write a Java Console Application (RockyCatering.java) which will allow employees to enter the details of N booking names and the number of guests for each booking. N should be equal to the highest digit in your student ID, use N=3 if your highest digit is less than three. For each booking the program will prompt for and accept the booking name and the number of guests for the booking, it will then display the charge (see sample output below for formatting details).

When all the bookings have been entered you need to report the maximum and minimum number of guests per booking and the relevant booking name, the average number of guests per booking and the total charges which have been collected.

The required Java Console Application should allow the user to:

1. For each of the N bookings: enter the Booking name, and then enter the Number of guests. The program will output the charge for the booking. All dollar values will be formatted to two decimal places (see implementation below with help for doing this).

2. You must ensure the booking name is not blank so you must implement a validation loop so a booking name is entered. The number of guests must be greater than or equal to ten and you will also need to implement a validation loop so a valid number of guests are entered.

The program will number each booking in the input prompt.

3. When N bookings have been entered, you will output a heading for the statistics "Statistical information for Rocky Catering Service", the minimum and maximum number of guests in the booking groups and the booking name with these minimums and maximums, and then what the average number of guests per booking is (formatted to two decimal places) (see sample output below). Note: If more than one booking has an equal maximum or minimum guests you just need to only output one booking name.

4. Display a welcome message at the beginning "Welcome to the Rocky Catering Service Management System" and an end message e.g. "Thank you for using the Rocky Catering Service Management System" and the final line "Program written by <your student ID>" (see sample output below).

The numeric literal values N, number of guests for the different discount levels and meal costs must be represented as constants.

Implementation

A large number of students have never written a program before so this is a fairly simple assignment which can be written in the main method of your class. Follow the steps outlined here and build your program up in a step by step fashion and always compile your program at each stage so you are always working on error-free code.

Start by creating your RockyCatering class which will contain just the main method, COMPILE! (Fix any errors and repeat)
Implement the welcome message, COMPILE and RUN! Declare your Scanner object(s), COMPILE!
Note: In order to combat the problem of the Scanner objects reading both textual and numeric
data a good way to counter this is to declare two Scanner objects, one for reading text and another for reading numbers, or you can clear the buffer after the int read using nextLine()

Create a loop to loop N Times, COMPILE! (use N = 3 for development)

Declare variables to hold the booking name and the number of guests (String and int), COMPILE! Within the loop: prompt and read the booking name, COMPILE and RUN!
Add the prompt and read for the number of guests, COMPILE and RUN!

Calculate the meal charges using the pricing structure above, COMPILE, RUN and TEST until this is correct.

Output the description of the transaction (see sample output below) Output all dollar values and average to two decimal places:
USE: System.out.printf("%.2f", charge);

Add the validation loops for reading the data (you can do this last if you like)

Use if statements to determine if the number of guests is maximum or minimum, (you will have to think about this). Output the minimum and maximums after the loop, COMPILE and RUN until you have this correct. You may want to set your original max and min variables to very small and very large numbers using Integer.MIN_VALUE and Integer.MAX_VALUE.

You will need to add up the number of guests as you go so you can calculate the average.

After the loop, you will output the statistics which you have gathered in the loop. You should have the maximum and minimum number of guests and the corresponding booking names and the total amount of charges collected.

Calculate the average number of guests per booking. Output the statistics as indicated in the screen shot below.

Finally, print the end message.

Your program should be well laid out, commented and uses appropriate and consistent names (camel notation) for all variables and objects.
For this assignment, you will not worry about checking data types.

Refer to a Java reference textbook and the unit and lecture material (available on the course WEB site) for further information about the Java programming topics required to complete this assignment.

Attachment:- Java Console Program.rar

Verified Expert

This project is of java programming to create a program for catering service using for loop, if else and scanner objects.The program calculate the catering service charges for the number of guests inputted.At the end of the program it displays the statistical information of the data inputted by the user.

Reference no: EM132428529

Questions Cloud

What are some effects of family life on health : How might the educational system in the United States affect the health of American children?What are some effects of family life on health?
Why a matrix measuring conflict-handling modes : Describe how and why a matrix measuring conflict-handling modes can be used by mediators to assist in managing conflict created within meetings.
Discuss the ethical and professional conduct of Daryl Kirby : Discuss the ethical and professional conduct of Daryl Kirby in applying for the loan from Free Spirit Bank.
Describe a particular aspect of versailles : Describe a particular aspect of Versailles that you think represents the palace's purpose as a symbol of absolute monarchy.
Rocky catering service program assignment : Implement a validation loop so a valid number of guests are entered - you are required to paste your source code as an appendix into your report
Cognitive dissonance theory : Explain how the individual could have used cognitive dissonance theory to rationalize his or her behavior while engaging in marijuana use could mess up
Characteristic of south pacific islander cultural practices : Identify and describe a characteristic of South Pacific Islander cultural practices that represents the social system in place within these cultures.
Whats the most minimal theory of mind : How might the believer in an immortal soul answer the neuroscientist? Where do you think the debate would go from there?What are the costs of engaging
Importance of making critical evaluations of news stories : Write a 350- to 700-word paper clarifying the importance of making critical evaluations of news stories. Use the following questions to help develop your paper:

Reviews

Write a Review

JAVA Programming Questions & Answers

  Implement the extended euclidean algorithm

Implement the Extended Euclidean Algorithm using C/C++ or Java. The objective is to find the inverse modular for a number.

  Java program to ask user to enter favorite color

Write a Java program to ask the user to enter favorite color, a favorite food, favorite animal, and first name of a friend or relative.

  How to setup a program to respond to events

Discussing how to setup a program to respond to events from any one of these sources - How do you create the necessary listener class? How do you associate the listener object with the event source?

  Write a program to track hourly employee departure

A company hires you to write a program to track hourly employee arrival and departure times from work. In essence, you are tasked to make an online time clock.

  Program that reads a customer account number

Write a program that reads a customer's account number (int type), account type

  What do you consider difficult about recursion

What do you consider difficult about recursion? Do we need mindset change when approaching recursion? Are there problem types that could be better approached in a recursive way instead of an iterative way?

  Discuss factors that affect sorting in sediment

Discuss factors that affect sorting in sediment. How could one tell the latitude at which a sediment was originally deposited? Compare and contrast phosphate and manganese nodules.

  Java program that asks the user for 100 values

Write a Java program that asks the user for 100 values (or generates these randomly) and stores and displays only the distinct values. Hint: use an array to store and display these values.

  Prompt the user for the tax amount

Write detailed pseudo code for a program that is designed to organize a family's tax payments for the past 20 years. The program should accomplish the following tasks: Prompt the user for the tax amount and also the year.

  What way to test if string is containe within another string

So that's when this curious consultant started wondering... what is the fastest way to test and see if a string is contained within another string?

  Write a method that takes two integers as parameters

Write a method that takes two integers as parameters and returns trueif the first integer is evenly divisible by the second integer, false otherwise.

  Create a very simple four function integer calculator

Create a very simple four function integer calculator with buttons for Add, Subtract, Multiply, and Divide, and with two text-type input fields.

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