Using Horstmann, answer the following with a partner.	

1.	R1. Becoming familiar with your computer

The operating system takes care of much of the filing work --storing, moving, and remembering where things are--so you can do useful things at a higher level. You interact with the operating system via a Graphical User Interface (GUI), for example a windowing system using a pointing device like a mouse, or a Command Line Interface, using only a keyboard and a single window.

What are some examples of tasks you'd tell the computer to do via the operating system interface?	

2.	Operations such as browsing the Web and editing text in a word-processing program involve the operating system executing a program. The operating system itself is a program that is running all the time. It executes your instructions and, in turn, it can run other programs.

It is useful to think of a program as a sequence of instructions. Both executable instructions and digital data can be represented as files, for example, on your hard drive. Both are sequences of symbols, just like the letters that make up the words in this sentence. Your job as a programmer is to provide the instructions for new programs.

Let's start with a data file. Locate the file Hello.java and look at its contents.

What did you do to find Hello.java?	

3.	How do you open Hello.java?	

4.	The program that you'll be running to write computer programs is your text editor, which sometimes is part of an integrated compiler environment. If you are working in a computer lab, ask your lab guide how to start the editor. If you purchased and installed your own compiler, then follow the vendor's instructions. Go ahead and start the text editor now.
What do you do to start your text editor?	

5.	R2. Compiling and running programs

Frequently in these labs you will be asked to compile a sample program. Below is a copy of a Java program that displays a drawing. 
/**
     Displays an 'art' drawing
 */             
public class Art 
{
      public static void main(String[] argv)
      {
		String s1 = " *   *   *   *   *   * ";
		String s2 = "   *   *   *   *   *   ";
		String s3 = "__________________________________\\n";
		String s4 = "_________________________________________________________\\n";           

		System.out.print(s4 + s1 + s3 + s2 + s3);       
		System.out.print(s1 + s3 + s2 + s3);       
		System.out.print(s1 + s3 + s2 + s3);       
		System.out.print(s1 + s3 + s2 + s3);       
		System.out.print(s4 + s4 + s4 + s4 + s4);
    }
} 

Describe what you need to do to create the file Art.java. What would happen if you ran it?	

6.	Once you have typed in (or pasted in) a program, you need to compile it to create an executable file. Again, these steps depend on your compilation environment. Determine the steps for your computer system.
Describe what you do to compile.	

7.	Finally you will want to, execute the program. Once again, the steps depend on your computer system.
Describe what you do to execute the program.	

8.	Describe what would happen when the program executed.	

9.	Writing Simple Programs

Your initial Java programs will be contained entirely in one file. There are some elements that all the programs will share because of the requirements of the Java language. When you build a program, your compiler looks for code of the form: 

public class Classname
{  
   public static void main(String[] args)
   {  
      /*
         your work goes here
      */
   }
}   

The textbook has a program that prints the message Hello, World! on the screen. 
    
How would you change it to display Hello, Universe!

10.	P2. Detecting Syntax and Logic Errors

There are numerous opportunities for error in any program, often times in places that seem too simple to require close attention. What do you think the following program is designed to do?

public class Cube 
{
    public static void main()
    {
        double height = 3.0;  \ inches
        double cube_volume = height * height * height;       
	   double surface_area = 8 * height       
	   System.out.println("Volume = " cube_volume);
        System.out.println("Surface area = " + surface_area;
}    	

11.	Will it work as shown? If not, what problems can you identify?	

12.	 Fix the syntax errors. Report a copy of your program's output here.	

13.	The program has two logic errors. Fix them and report the corrected program.