Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects). Then,

Assignment First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects). 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 weightOfLoaf = 16; // ounces per loaf int numberOfLoaves = 4; System.out.print("With a weight of " + weightOfLoaf + " ounces in each loaf, ") System.out.pringIn("and a total of " + numberOfLoaves + " loaves, "); in totalWeight = weightOfLoaf + numberOfLoaves; System.out.printIn("the total weight of all " + numberOfLoaves + " loaves is " + totalWeight + " ounces./n"); ) )

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

More Books

Students also viewed these Databases questions