Reference no: EM132285528
Programming Fundamentals Assignment - Java Console Program
Details - For this assignment, you are required to develop Java Console Programs to demonstrate you can use Java constructs including input/output via a command line and using GUI dialogs, 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 five weeks of the subject and within the assignment literature, you must use a Scanner object for console input and no advanced data structures like arrays will be used.
What to submit for this assignment -
The Java source code: You will be able to complete the assignment in weekly parts in which you will produce five java source files. (More details are in attached file).
Week1.java, Week2.java, Week3.java, Week4.java and Week5.java.
Once you have completed all of the programs and you are ready to submit, compress all source files into a single zip file for submission, do not include your report in the zip file. Only submit a zip not a rar file. It is important the file names are correct.
Also submit a report including, how long it took to create the programs (approximately), any problems encountered and screen shots of the output produced. (Use Alt-PrtScrn to capture just the console window or your dialogs and you can paste them into your Word document) You should test every possibility in the program and annotate your test screen shots.
Assignment specification -
This assignment will require you to write small five programs. They will be small programs which will cover the first five weekly topics. Usually students were required to write one largish program to demonstrate the topics for the first five weeks. Students get themselves into trouble when the first assignment is due as they have not practiced the basics skills necessary to complete the assignment. With the assignment divided into five programs you can complete each question as we cover the weekly topics, do not let yourself fall behind.
Question one (week one topic). Writing output to the screen.
Once you have written your first "Hello World" program you will be able to complete question one.
Implementation
Create a class called Week1 (file: Week1.java) and within it a main method.
Question two (week 2 topics) Input of data types and arithmetic expressions
Rocky Dry Cleaners program
Rocky Dry Cleaners are requesting a program which allows staff to input a customer's name and the number of plain garments to be dry cleaned. For simplicity we are only considering plain garments which include shirts, trousers, dresses and jackets etc. The program will compute the cost of the order at $8.50 per garment, you should store this value as a constant.
This program will prompt for and read in a customer name using a Scanner object.
The customer name will be stored in a String object.
The program will then output the customer name in a prompt to read in the number of garments to be cleaned (as a whole number i.e. an integer).
Finally the program will display the receipt for the customer.
You need to replicate the output exactly as shown below, including the correct line spacing.
Question three (week three topics) Decision statements
The management of Rocky Dry Cleaners would like to encourage customers to get more garments dry cleaned and to possibly get new customers. It has been decided to offer as a special, three garments to be dry cleaned for $20.00 which would be a saving of $5.50 and any subsequent garments in the order would be $6.50 per garment.
In summary:
One to two garments: $8.50 per garment.
Three garments: $20.00.
More than three garments: $20.00 plus $6.50 per garment after that.
Create a class Week3 (file: Week3.java) and a main method and copy your code from question two into the main method of week three main.
After you have read the relevant details of the order i.e. name and number of garments, you will have to create a series of if - else if statements to calculate the final charge.
For over three garments;
charge = three garments charge + (number of garments - 3) * charge over three
When you have calculated the total charge output a receipt as you have done in week two code.
Note: you must use constants for all the numeric literals in the else if statements.
Your output needs to match exactly the output as shown in attached file.
Question four (week four topics) Repetition while and for loops
Create a class Week4 (file:Week4.java) to demonstrate the use of a repetition statement.
Question five (week five topics) Methods and GUI I/O
Create a class Week5 (file:Week5.java) by using your solution to question four. This question is identical to question four as the program will read in N customer names and number of garments and calculate the charges for the orders, however we are going to create a method to calculate the charges and we will be using GUI dialog boxes for our I/O.
Attachment:- Assignment Files.rar