With this as a starting point format the output of your code
With this as a starting point, format the output of your code to match the expected output.
Overview In the last lab, we learned the basic structure of a Java class as well as some debugging skills. Now it is time to put that knowledge to use and fix up the code in the ZyBooks editing window. Debugging Practice In the develop section, try to compile the code and use the error messages to fix the discrepancies in the code. It would also be useful to read the comments scattered throughout the code. In Java, comments are denoted either with a //where the comment starts and goes until the end of the line or with /*commentary that goes here between the asterisks and slashes*/. They should be used to add clarification to code when necessary Practice With Formatting Output Now that the code compiles without any errors, try submitting your code. You\'ll notice, you don\'t get points because the format of the output is different than the expected. The Java language is not dependent on whitespace (new lines, spaces, tabs, etc.) but you should still be aware that these things will still matter when dealing with strings Within double-quotes, whitespace does matter. So the String \"my fair lady\" and the String \"my fair lady\" are treated as completely different. Some highlights in terms of formatting output System.out. print() vs System.out.println(): println will start a new line at the end while print does not e Some basic escape characters: o adds a tab in the String o adds a new line in the String o adds a double quote to the string With this as a starting point, format the output of your code to match the expected output.Solution
import java.lang.System.*;
public class movieQuotes
{
public static void main(String[]args) {
//The between the Strings is called a concatenator and works To combine the Strings together
System.out.print(\"Someone I once knew wrote that\"+\" \\\"We walk away from our dreams\");
//Note that /\" allows the \" to be printed as part of the string
System.out.println(\"afraid that we may fail or worse yet, afraid we may succeed.\\\"\");//Here I have added/\" for printing quotes
//The spaces before the quotation mark do not matter, though it does make the code messier
System.out.print( \"/n William Forrester\");
System.out.println (\"we are debugging\"); // We can\'t use it outside of main function
}
}
