Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help me compile the source code in Java, just the source code will do, thank you very much! MyABC Bookstore is now upgrading their
Please help me compile the source code in Java, just the source code will do, thank you very much!
MyABC Bookstore is now upgrading their everyday's sales transaction from the manual to automated system. This system is provided to the cashiers of the bookstore to record everyday's sales and payments made by customers. Products available in the bookstore are categorised by their types. Each type has its respective product id as listed below: Product id b1 b2 b3 b4 Product type Educational Book Novel Magazine Stationary The following are the tasks that the system should do: i. to read the related inputs (number of items bought, product id, quantity, unit price, and payment) representing each sale, ii. to calculate and display the total price of each sale, iii. to calculate and display the balance of payment made by a customer, iv. to return the product type based on its product id, and v. to display a receipt of each sale. vi. to display a daily sales report. The format of inputs and outputs is as follows: Welcome to MyABC Bookstore Method welcome () AAAAAAAAAAAAAAAAAAAAAAAAAA bought:2 Enter the number of product items Product id Product type bl Educational Book b2 Novel b3 Magazine b4 Stationary Item 1 Method listId() ====== Enter the product id (b1/b2/b3/b4):53 Enter quantity:2 Enter price/unit:RM 11.00 Product id Product type bi Educational Book b2 b3 b4 Novel Magazine Stationary Item 2 ====== Enter the product id (bl/b2/b3/b4):bl Enter quantity:1 Enter price/unit:RM 150.90 Total price: RM 172.90 Enter the payment made by a customer: RM 200.00 MYABC Bookstore: Receipt of Sale and Payment AAAA AAAAAAAAAAAAAAAAA diProduct Type Price Educational Book Magazine 150.90 22.00 Method printReceipt () Total Price 172.90 Amount Tendered Balance RM 200.00 RM 27.10 Do you want to continue? 1 . Yes, 2.No : 1 Welcome to MyABC Bookstore * * * * * * * * Enter the number of product items bought: 3 Product id Product type bl Educational Book b2 Novel b3 Magazine b4 Stationary Item 1 ====== Enter the product id (b1/b2/b3/b4):b1 Enter quantity:1 Enter price/unit: RM 199.00 Product id Product type bi Educational Book b2 Novel b3 Magazine b4 Stationary Item 2 ====== Enter the product id (b1/b2/b3/b4): b2 Enter quantity:1 Enter price/unit:RM 50.50 Product id Product type bi Educational Book b2 Novel b3 Magazine b4 Stationary Item 3 ====== Enter the product id (b1/b2/b3/b4): b4 Enter quantity:5 Enter price/unit:RM 2.10 Total price: RM 260.00 Enter the payment made by a customer:RM 300.00 MyABC Bookstore: Receipt of Sale and Payment AAAA Product Type Price Educational Book Novel Stationary 199.00 50.50 10.50 Total Price 260.00 Amount Tendered Balance RM 300.00 RM 40.00 Do you want to continue? 1. Yes 2.No : 2 MYABC Bookstore: Sales Report Product ID Quantity Sales Amount Method printSalesReport() b1 b2 b3 b4 2 1 2 5 349.90 50.50 22.00 10.50 Grand Total 10 432.90 Thank you! See you again. Figure 1: Sample input and output You have been assigned to write a program to solve the problem based on the description given above. The program must have five methods as listed below (refer Figure 1) and use a few arrays to store data: a) main() b) welcome () c) listId() d) printReceipt () e) printSalesReport()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started