Walled Town Ale has three products: Butcher Pale Ale, Farrier IPA and Gatehouse Brown Ale. The price per barrel is: • Butcher Pale Ale €125.50 • Farrier IPA €105.90 • Gatehouse Brown Ale €132.35 A...

1 answer below »
Walled Town Ale has three products: Butcher Pale Ale, Farrier IPA and Gatehouse Brown Ale. The price per barrel is: • Butcher Pale Ale €125.50 • Farrier IPA €105.90 • Gatehouse Brown Ale €132.35 A discount applies based on the number of barrels of each product purchased. • €10 for each 10 barrels of Butcher Pale Ale. • €8.40 for each 12 barrels of Farrier IPA. • €11.65 for each 9 barrels of Gatehouse Brown Ale. Barrels will be loaded onto racks for delivery. Each rack can take up to 15 barrels and the full order will be made in one delivery. To ensure that each delivery journey is cost effective for the brewery, a surcharge of €2.00 is applied if the delivery truck rack(s) used for that order are not full. The application works as follows: The user enters the name and address (3 lines) of the client company and the number of barrels of each product and an invoice is produced. You are required to design, code, and test a program that will read in the details of each customer and the number of barrels of each product ordered. You should then print out an invoice (to screen) that will mirror the invoice shown on the following page. Notes: 1. The invoice number is a 6-digit number. You can prompt the user to enter the invoice number, or you can use a random number generator to generate it. import java.util.Random; int invoiceNo = new Random ().nextInt (999999); In either case, the invoice number is to be displayed as 6 digits, with leading zeros if necessary. 2. You can prompt the user to enter today’s date manually, or you can use the following code to access the system date: import java.util.Date; import java.text.SimpleDateFormat; SimpleDateFormat dateFormat = new SimpleDateFormat ("dd/MMM/yyyy"); Date today = new Date (); System.out.println(dateFormat.format(today)); 3. The line marked 1 in the invoice is only to be included if a surcharge applies.
Documentation • An algorithm for your program. • Comments within your program. • A data dictionary 2. The testing of your program • You must include at least 4 items of test data. This data should include a suitable mix of data that robustly tests your program code. • For each test, indicate what you are testing. • Include the expected results of your test data. • Include screenshots of your test data and results.
Answered Same DayDec 05, 2021

Answer To: Walled Town Ale has three products: Butcher Pale Ale, Farrier IPA and Gatehouse Brown Ale. The price...

Sudipta answered on Dec 07 2021
135 Votes
David_java.docx
Algorithm for the question:
import java.io.*;
import java.util.*;
import java.text.SimpleDateFormat;
public class Main {
public static vo
id main(String args[]) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        System.out.println(" Walled Town Alle - INVOICE ");
    System.out.println("**************************************************************");
        //Taking company name and address as input
System.out.println("Enter company name");
String name=br.readLine();
System.out.println("Enter company address");
String address[]=new String[3];
        //taking address input in 3 lines
for(int i=0;i<3;i++)
address[i]=br.readLine();
int count[]=new int[3];
        //Input for number of barrels of Butcher Pale Ale
System.out.println("Enter no of barrels of Butcher Pale Ale");
count[0]=Integer.parseInt(br.readLine());
        //Input for number of barrels of Farrier IPA
System.out.println("Enter no of barrels of Farrier IPA");
count[1]=Integer.parseInt(br.readLine());
        //Input for number of barrels of Gatehouse Brown Ale
System.out.println("Enter no of barrels of Gatehouse Brown Ale");
count[2]=Integer.parseInt(br.readLine());
        //Printing or displaying the invoice number with a random value
int invoice_no=new Random().nextInt(999999);
        //Displaying date using current or todays system date and time function
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Date today = new Date();
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here