A+ Answers


Describe the following declarations, assignment, input, and output statements, or write Java code to implement the comment statements.  Describe what is contained in memory and show what is displayed on the screen after each output statement is executed.
Describe what the program does or displays when it processes each of the following lines of code:
final double PI =3.1416;      double radius=2.5;   
 System.out.print(“This area of the circle is”
                              + PI * radius * radius.”);
System.out.flush ( );
Write the appropriate Java statement to match the description in each of the following comments:
After each sequence of statements, indicate the purpose of the code in that sequence.
Write the appropriate Java statement to match the description in each of the following comments:
When a value is assigned in memory, the value previously stored in memory is replaced by the new assigned value. This is called destructive replacement.  If you want two memory locations to exchange values, you need to save a value in a third location to prevent losing the original value.  The following code shows how to swap two values in memory.  Explain the purpose of each of the following lines.
Write the appropriate Java statements to match the descriptions in the following comments:
Write the output of the following code.
Write a sequence of Java statements to match the descriptions in the following comments: