[Solved]Java Sodasalesdat 7 Program Name Text 1 0 10 11 12 13 Package Csc161 14 Import Javaiofile Q37181095
solve thie error for mycode

java sodasales.dat 7* Program name: Text 1/0 10 11 리 12 13 package csc161; 14 import java.io.File; 15 import java.util.Scanner 16 public class SalesReportf 17 public static void main(Stringll args) throws Exception f 18 19 java.io.File file – new File(“C:Tlmccllsrclicsc16111sodasales.dat”)://main method-ai 20 Scanner sc new Scanner(file); 21 string name = null://declare string variable-aj. 22 int totalSold-e;//declare and intialize its value-ai 23 double totalCost 0.0;//declare and intialie its value-aj 24 double totalRetail 0.0;//declare and intialize its value-aj 25 double totalProfit -8.0;//declare and intialize its value-aj 26 double totalPercent-0.0 27 double totalPrice -0.0;//declare and intialize its value-aj 28 System.out.println(“titltSoda sales”);//it refers to 3 times tab-ai 29 System,out.println);//a new line-aj 30 System.out.println);//a second new line-ai 31 System.out.println(“ItlttBottlestItCostltltRetailltitprofitItitpercent”);// print various options-aj 32 System.out.println(“Sodaltititsold.ltitBottlettBottleltitBrandtitsold of 150);//print required options-aj 33 System.out.printin(” 34 while(sc.hasNext())//while loop starts-aj “);//print dashed line-ai/ while(sc.hasNextDouble()-=false) 6 2 Problems Javadoc,Declaration Console 3Coverage cterminateds SalesReport [Dava Application] CAProgram FilesJava ure1 80 2011binyavaw.exe (Apr 21.2019.9:51:42 PM) ile(sc.hasNextDouble()–false) 38 name – sc.next);// read name’s value-ai double soldNum – sc.nextint) ://read integer soldnum-aj 42 double costPerBottle=sc.nextDouble(); 3 double retailBottle -sc.nextDouble()://read double retail bottle-aj 44 double profit profit (costPerBottle,retailBottle, soldNum ); 45 totalRetail -totalRetail + retailBottle;//calculate total retail-ai 46 double percent – (soldNum);// perecent-aj 47 totalSold (int) (totalsold+ soldNum); 48 totalCost totalCost + costPerBottle; 49 totalPrice totalPrice + retailBottle; 50 totalProfit-totalProfit + profit://calculate total profit-aǐ l 51 System-out . printf(“X-20s t%-10dtt%2ftt% ftt%. 2fn”); 52 System.out.print (name); 53 System.out.print (soldNum); 54 System.out.print (retailBottle); 55 System.out.print (profit); 56 System.out.print(percent); 57 2 2 59 //formatting variables -ai 62 sc.close);//close sc 63 double avgCost avgCost(totalCost); 64 double avgPrice avgPrice(totalPrice); 65 System.out.println();//a new line-aj 66 System.out.printf(“%17s”, “Total”); Console3 Coverage Problems e Javadoc & Declaration inl iavaw exe (Apr 2120199:51:42 PM) Annlieatinal CA Draat4 m rile. laual ire 1 0 0 201 tm ej c re: d ttf tit% dt dm dt (i te” t1 vrm apo!” att ; lee ; btt btt bcc Iff utt unnussuii 0rr aonns mFii e Ippa ennn df di ..S ippi aen aen tvvvc njjj c sbu ma 89012345678901234567 Show transcribed image text java sodasales.dat 7* Program name: Text 1/0 10 11 리 12 13 package csc161; 14 import java.io.File; 15 import java.util.Scanner 16 public class SalesReportf 17 public static void main(Stringll args) throws Exception f 18 19 java.io.File file – new File(“C:Tlmccllsrclicsc16111sodasales.dat”)://main method-ai 20 Scanner sc new Scanner(file); 21 string name = null://declare string variable-aj. 22 int totalSold-e;//declare and intialize its value-ai 23 double totalCost 0.0;//declare and intialie its value-aj 24 double totalRetail 0.0;//declare and intialize its value-aj 25 double totalProfit -8.0;//declare and intialize its value-aj 26 double totalPercent-0.0 27 double totalPrice -0.0;//declare and intialize its value-aj 28 System.out.println(“titltSoda sales”);//it refers to 3 times tab-ai 29 System,out.println);//a new line-aj 30 System.out.println);//a second new line-ai 31 System.out.println(“ItlttBottlestItCostltltRetailltitprofitItitpercent”);// print various options-aj 32 System.out.println(“Sodaltititsold.ltitBottlettBottleltitBrandtitsold of 150);//print required options-aj 33 System.out.printin(” 34 while(sc.hasNext())//while loop starts-aj “);//print dashed line-ai/ while(sc.hasNextDouble()-=false) 6 2 Problems Javadoc,Declaration Console 3Coverage cterminateds SalesReport [Dava Application] CAProgram FilesJava ure1 80 2011binyavaw.exe (Apr 21.2019.9:51:42 PM)
ile(sc.hasNextDouble()–false) 38 name – sc.next);// read name’s value-ai double soldNum – sc.nextint) ://read integer soldnum-aj 42 double costPerBottle=sc.nextDouble(); 3 double retailBottle -sc.nextDouble()://read double retail bottle-aj 44 double profit profit (costPerBottle,retailBottle, soldNum ); 45 totalRetail -totalRetail + retailBottle;//calculate total retail-ai 46 double percent – (soldNum);// perecent-aj 47 totalSold (int) (totalsold+ soldNum); 48 totalCost totalCost + costPerBottle; 49 totalPrice totalPrice + retailBottle; 50 totalProfit-totalProfit + profit://calculate total profit-aǐ l 51 System-out . printf(“X-20s t%-10dtt%2ftt% ftt%. 2fn”); 52 System.out.print (name); 53 System.out.print (soldNum); 54 System.out.print (retailBottle); 55 System.out.print (profit); 56 System.out.print(percent); 57 2 2 59 //formatting variables -ai 62 sc.close);//close sc 63 double avgCost avgCost(totalCost); 64 double avgPrice avgPrice(totalPrice); 65 System.out.println();//a new line-aj 66 System.out.printf(“%17s”, “Total”); Console3 Coverage Problems e Javadoc & Declaration inl iavaw exe (Apr 2120199:51:42 PM) Annlieatinal CA Draat4 m rile. laual ire 1 0 0 201
tm ej c re: d ttf tit% dt dm dt (i te” t1 vrm apo!” att ; lee ; btt btt bcc Iff utt unnussuii 0rr aonns mFii e Ippa ennn df di ..S ippi aen aen tvvvc njjj c sbu ma 89012345678901234567
Expert Answer
Answer to java sodasales.dat 7* Program name: Text 1/0 10 11 리 12 13 package csc161; 14 import java.io.File; 15 import java.util… . . .
OR

