Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are working as a software Developer in a coffee company. Company decided to give franchises. Companies which buy the franchise should use the same

image text in transcribed

You are working as a software Developer in a coffee company. Company decided to give franchises. Companies which buy the franchise should use the same type of invoices for the customers. Every company has its own software developer. Now, your duty is to prepare an interface named as Grandcoffee and add createFile(), addItem(), printItems (), total(), and close() void methods. So other developers will use these methods. Design also another elass named as BestCoffee that extends the Grandcoffee. It has a private Print Writer newPile data field and private double price ArrayList. It has a public createFile() method that creates a "store.txt files in D: or E: drive. In the creatorile () method, your program should prompt if the path or the file name is not correct (try-catch) and displays "Check the path and file name again!". Add a void addItem() method that adds item name and price to the file. It has also printItems() method that prints the content of the file on the console and (5 POINTS) total() methods that shows the total price of the items with 20% TAX added as shown below. And it has public close() method to save and close the file. User should press "q" to stop entering items. Use the test class below. Sample output: Item and Price: Metro 50 Item and Price: Lays 100 Item and Price: Metro 50 Iten and Price: Notebook 100 Item and Price: store - Notepad File Edit Format View Help Metro 50.0 Lays 100.0 Metro Se. Notebook 180.0 Welcome to Mega Super Market Items you bought: Metro 50.0 Lays 100.0 Metro 50.0 Notebook 100.0 300.0 LEK 60. VAI TOTAL: 360.0 LEK Test class: public class test public static void main(String[] args) throws FileNotFoundException { Store file = new Store(); file.createFile(); file.addItem(); file.close(); file.printItems(); file.total(); 1 Add file You are working as a software Developer in a coffee company. Company decided to give franchises. Companies which buy the franchise should use the same type of invoices for the customers. Every company has its own software developer. Now, your duty is to prepare an interface named as Grandcoffee and add createFile(), addItem(), printItems (), total(), and close() void methods. So other developers will use these methods. Design also another elass named as BestCoffee that extends the Grandcoffee. It has a private Print Writer newPile data field and private double price ArrayList. It has a public createFile() method that creates a "store.txt files in D: or E: drive. In the creatorile () method, your program should prompt if the path or the file name is not correct (try-catch) and displays "Check the path and file name again!". Add a void addItem() method that adds item name and price to the file. It has also printItems() method that prints the content of the file on the console and (5 POINTS) total() methods that shows the total price of the items with 20% TAX added as shown below. And it has public close() method to save and close the file. User should press "q" to stop entering items. Use the test class below. Sample output: Item and Price: Metro 50 Item and Price: Lays 100 Item and Price: Metro 50 Iten and Price: Notebook 100 Item and Price: store - Notepad File Edit Format View Help Metro 50.0 Lays 100.0 Metro Se. Notebook 180.0 Welcome to Mega Super Market Items you bought: Metro 50.0 Lays 100.0 Metro 50.0 Notebook 100.0 300.0 LEK 60. VAI TOTAL: 360.0 LEK Test class: public class test public static void main(String[] args) throws FileNotFoundException { Store file = new Store(); file.createFile(); file.addItem(); file.close(); file.printItems(); file.total(); 1 Add file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions