[Solved]81 Systemprintln Itltittlttlt Titt Print Dashed 32 Schasnextline Loop Starts Ai 33 34 Name Q37187251
81 System.out.println(“-Itltittlttlt-titt;//print dashed 32 while(sc.hasNextline))//while loop starts-ai 33 ( 34 name sc.next ); 35 line sc.next); 86 string arr[] = line.split(“..); 37 soldNum= Integer.parseInt(arr[0]);//read integer soldnum-ai 38 costPerBottle-Double.parseDouble(arr[1]); 39 totalSold totalsold + soldNum;//calulate totalsold soda-aj l 40 //read double cost bottle-aj 41 totalCost totalCost + costPerBottle://calculate total cost-ai 42 retailBottle Double.parseDouble (arr[2]);//read double retail bottle-aj 13 totalRetail -totalRetailretailBottle;//calculate total retail-aj 4 percent (soldNum/150) 100;//calculate perecent-aj 45 profit percentsoldNum;//calculate profit-aj 46 totalProfit totalProfit+ profit;//calculate total profit-ai 47 totalPercent totalPercent+ percent;//totalpercent calculations-aj 48 System.out . printf (“X-20stX-10dtt%.2ftt%.2ftIt%. 2 ftt%.2fn”, name, soldium.costPerBottle, retailBot 49 //formatting variables -aj 2 Problems et Javadoc Declaration-Console X -Coverage terminated> SalesReport [Java Application) C Program FilesJava jir 1 8.0 2011binjavaw.exe (Apr 21, 2019, 11:44:07 PM) Retail Bottle profit Brand percent Sold of 150 Bottles Sold. Cost Bottle Soda ception in thread “main” java.lang.Array IndexOutOf BoundsException: 2 at csc161.SalesReport.main(SalesReport iava: 38) 39: 62 oe 99+ Show transcribed image text 81 System.out.println(“-Itltittlttlt-titt;//print dashed 32 while(sc.hasNextline))//while loop starts-ai 33 ( 34 name sc.next ); 35 line sc.next); 86 string arr[] = line.split(“..); 37 soldNum= Integer.parseInt(arr[0]);//read integer soldnum-ai 38 costPerBottle-Double.parseDouble(arr[1]); 39 totalSold totalsold + soldNum;//calulate totalsold soda-aj l 40 //read double cost bottle-aj 41 totalCost totalCost + costPerBottle://calculate total cost-ai 42 retailBottle Double.parseDouble (arr[2]);//read double retail bottle-aj 13 totalRetail -totalRetailretailBottle;//calculate total retail-aj 4 percent (soldNum/150) 100;//calculate perecent-aj 45 profit percentsoldNum;//calculate profit-aj 46 totalProfit totalProfit+ profit;//calculate total profit-ai 47 totalPercent totalPercent+ percent;//totalpercent calculations-aj 48 System.out . printf (“X-20stX-10dtt%.2ftt%.2ftIt%. 2 ftt%.2fn”, name, soldium.costPerBottle, retailBot 49 //formatting variables -aj 2 Problems et Javadoc Declaration-Console X -Coverage terminated> SalesReport [Java Application) C Program FilesJava jir 1 8.0 2011binjavaw.exe (Apr 21, 2019, 11:44:07 PM) Retail Bottle profit Brand percent Sold of 150 Bottles Sold. Cost Bottle Soda ception in thread “main” java.lang.Array IndexOutOf BoundsException: 2 at csc161.SalesReport.main(SalesReport iava: 38) 39: 62 oe 99+
Expert Answer
Answer to 81 System.out.println(“-Itltittlttlt-titt;//print dashed 32 while(sc.hasNextline))//while loop starts-ai 33 ( 34 name sc… . . .
OR

