Question: Java Then, create a new Java application called TotalWeight (without the quotation marks) by typing in the code in the screen shot below, but correcting

Java

Then, create a new Java application called "TotalWeight" (without the quotation marks) by typing in the code in the screen shot below, but correcting the syntax error and the semantic error. Also, create a multi-line comment just inside of the main method's opening brace, which describes both the errors you found. Note that the semantic error does not have to do with the number of lines printed in the output. package totalweight;

public class TotalWeight { public static void main(String[] args) {

int weightofLoat=16; // ounces per loaf int numberofLoaves=4; System.out.print("With a weight of"+ weightOfLoaf+"ounce in each loaf,"); System.out.println("and a total of " +numberOfLoaves+" loaves."); int totalWeight = weightOfLoaf +numberOfLoaves; System.out.println("the total weight of all "+numberOfLoaves+" loaves is"+ totalWeight+"ounces. "); } }

Not getting output..help please..

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!