CIS 111 Review


You should know how to....

Answer Key for the Midterm


CIS 111 MidTerm                    Name_____Matt_______ 1 pt
Thursday; March 3, 2006
40 points
 
Please answer the following question's.

1)
    Write the definition of a class called Person.                    5 pts
    Write the main method for the class Person                    5 pts

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

        }

    }


2)  Declare the following variables
    a variable named "age" which can hold whole numbers with a initial value of 10              3 pts
    a variable named "time which can hold decimal numbers with and initial value of 3.0      3 pts    a variable named "name" which can hold a sequence of letters        3 pts   


    int age = 10;
    double time;
    String name;

3)
    Declare an instance of the View class and do the following:
        read an whole number with the prompt "Please Enter the Age"
        and store the value in a variable named "age" which can store whole numbers    10 pts

    View v = new View();
    int age = v.getInt("
Please Enter the Age");


4)
    Use the View to print out the following "Matt is 25 years old"            10 pts
    Use the variables name and age where
                 name = "Matt"
                age = 25

    v.print(name + " is " + age + " years old");