Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Program ReceiptMaker.java that continuously reads user inputs consisting of two parts - a String (one word) containing the item in question, and a

Create a Program ReceiptMaker.java that continuously reads user inputs consisting of two parts - a String (one word) containing the item in question, and a double containing that items price - and inserts them into a file receipt.txt (creating it if it has to) formatted such that both the item and price have 10 characters dedicated to them until the user types in checkout. Once checkout occurs, the total price of all the items should also be written to receipt.txt.

What am I doing wrong?image text in transcribed

ion public static void main(String [ args) throws I0Exception f uto enerat metho tug // TODO Auto-generated method stub File inputFilenew File("input.txt"); if(!inputFile.exists)) inputFile.createNewFile Scanner in new Scanner(inputFile); PrintWriter author - new Printwriter(new Filewriter(inputFile, true)) System.out.print Ln(" Please Enter Items and it's Price. In When done type checkout n" do t Scanner in- new Scanner(System.in) string Item = in1.nextLine(); double Pricein1.nextDouble); author.printf(" %s " + .. %10.2f ", Item , Price ); Multiple markers at this line - Item cannot be resolved to a variable 1 changed line while(Item!"checkout"); double Price- inl.nextDouble); double total-0; total Price; author. printf(" Total " + " %10.2f ",total); in.close); author.close

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

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions

Question

1. What are your creative strengths?

Answered: 1 week ago