CS 103

Outline of Material for Test 1


The following is a brief outline of the material which will be covered on the first test. All of this information can be found in the lecture notes and/or on this web page.
  1. Computer History
    1. Given a list of historical events in the development of modern computer technology, be able to place the events in chronological order. This may include any of the following. They are given in correct order with a date. Dates obviously will not be provided on the test.
      • Groups of pebbles, sticks, notches on sticks, and knotted ropes are used to count objects. (Ancient times)
      • Abacus is used to perform mathematical calculations in the Roman Empire. (Roman Republic and Empire, circa 500 BC to 500 AD)
      • John Napier invents logarithms. (circa 1600)
      • William Oughtred invents the slide rule. (1621)
      • Blaise Pascal invents the Pascaline, a machine to perform addition and subtraction. (1642)
      • Gottfried Wilhelm von Leibniz invents calculus and creates a calculating machine which could add, subtract, multiply, and divide. (1673)
      • Basile Bouchon invents a programmable loom using the ideas from the paper rolls of player organs built by his father. (1725)
      • Jean-Batist Falcon invents a progrmmable loom that used stacks of thin slats of wood with holes punched in them to control the patterns. (1728)
      • Joseph Marie Jacquard invents a programmable loom that uses thin slats of wood connected together to create a long "treadmill" of cards with punched holes in them to control the patterns. (1745)
      • Charles Babbage designs the Difference Engine (1822) and the Analytic Engine (1834), programmable mechanical computers.
      • Ada Lovelace becomes the first programmer after writing a sequence of steps for programming the Analytic Engine. (1843)
      • Herman Hollerith invents a punched card reader for use with tabulating the census. (1880s)
      • John Vincent Atanasoff and Clifford Berry invent the first electronic computer known as the Atanasoff-Berry Computer, or ABC (1939-1942)
      • The Colossus I computer is invented at Bletchly Park England for use in breaking Nazi military codes. (1943)
      • The Mark I computer invented by Howard Aiken in which Grace Hopper finds the first computer "bug".
      • J. Prosper Eckart and John Mauchly invent ENIAC, the first multi-purpose programmable computer. (1946)
      • John Bardeen, Walter Brattain, and William Shockley invent the transister at Bell Labs. (1948)
      • J. Prosper Eckart and John Mauchly invent UNIAC, the first practical, mass produced, electronic computer. (1951)
      • Fortran programming language is created to run on the IBM System/360 computer. (1964)
      • Digital Equipment Corporation begins marketing the PDP-8, the first integrated circuit computer. (1965)
      • Intel Corporation produces the first microprocessor. (1971)
      • Popular Electronics magazine publishes plans for building the Altair 8800, the world's first microcomputer. (1975)
      • Steve Jobs and Steve Wozniac begin marketing the Apple II. (1977)
      • IBM begins marketing the IBM-PC (1981).
      • Apple begins marketing the Macintosh, the first computer with a Graphical User Interface (1984).
      • The Internet comes on-line linking computers all over the world. (1990s)
  2. Programming In General
    1. What is programming?
    2. What is binary code?
    3. What is assembly language?
    4. What is a high level computer language?
    5. What is a source code file?
    6. What does a compiler do?
    7. What is Java byte code?
    8. What is the difference between a .java file and a .class file?
    9. What is the difference between a primitive/atomic variable and a reference variable?
  3. Java Programming
    You should know how to:
    1. Write a simple Java program with correct syntax. An example of this would be the simple HelloWorld program. Make sure you have syntax correct in all statements, that curly braces and parentheses are correct, that semicolons are in the correct locations, that there is a main() method with correct arguments inside the class definition.
    2. Declare variables of any of the primitive/atomic data types (char, short, int, long, float, and double), and you should know how to store values in those variables. You should also know the type and ranges of values for each data type, e.g. int can only hold whole numbers in the range from about minus 2 billion to plus 2 billion, it cannot hold numbers like 1.25. Examples:
      		int x;       // Declare an integer variable called x
      		x = 3;       // Store the value 3 in the variable x
      		double d;    // Declare a double variable called d
      		d = 3.14159; // Store the value 3.14159 in the variable d
      				
    3. Show how to write a for loop. For example, if given "Write a for loop that will print 'Hi there' 10 times." The answer would be:
      		for(int i=0; i<10; i++)
      		{
      			System.out.println("Hi there");
      		}
      				
    4. Show how to write a while loop. For example, if given "Write a while loop that will print 'Hi there' 10 times." The answer would be:
      		int i=0;
      		while(i < 10)
      		{
      			System.out.println("Hi there");
      			i++;
      		}
      				
    5. Show how to write a do..while loop. For example, if given "Write a do..while loop that will print 'Hi there' 10 times." The answer would be:
      		int i=0;
      		do
      		{
      			System.out.println("Hi there");
      			i++;
      		}
      		while(i < 10);
      				
    6. Show how to write an if statement. For example, "How would you write an if statement to print 'Correct' if the int variable ans is equal to 3." The answer would be.
      		if(ans == 3)
      		{
      			System.out.println("Correct");
      		}
      				
    7. Show how to write an if...else statement. For example, "How would you write an if..else statement to print 'Correct' if the int variable ans is equal to 3, but print 'Incorrect' if it is any other value." The answer would be.
      		if(ans == 3)
      		{
      			System.out.println("Correct");
      		}
      		else
      		{
      			System.out.println("Incorrect");
      		}
      				
    8. Show how to write a switch statement. For example, "How would you write a switch statement to print 'Cold' if the int variable val is equal to 1, 'Cool' if val is 2, 'Warm' if val is 3, 'Hot' if val is 4, but 'Invalid answer' if val is any other value. The answer would be.
      		switch(val)
      		{
      			case 1 : 
      				System.our.println("Cold");
      				break;
      			case 2 : 
      				System.our.println("Cool");
      				break;
      			case 3 : 
      				System.our.println("Warm");
      				break;
      			case 4 : 
      				System.our.println("Hot");
      				break;
      			default : 
      				System.our.println("Invalid answer");
      				break;
      		}