CS 1401, Exam #1

Date: Thursday, September 15, 2005
Name (please type legibly, ideally in block letters): ______________________________________________________________________
UTEP ID # (if you do not remember it, it is OK): ______________________________________________________________________

1. Briefly describe Babbage's contribution to computing. For extra credit: describe one more event form the history of computing.

2. Suppose that the grade for the class is determined as follows: if a student has less than 70% on the labs, then the class grade is 0; otherwise, 50% of the grade comes from the labs and 50% from the tests. Describe, step-by-step, an algorithm that, given overall labs grade and overall test grade, returns the overall class grade.

3. For each of the following sequences of symbols, describe which can be valid Java identifiers and which cannot be; if you believe they cannot be, briefly explain why (e.g., "is a reserved word" or "does not start with a letter"):

4. Write a main method that asks a user for the month and date, and then prints the statement:
Today is (month) (date).
For example, for today, the computer should print:
Today is September 15.

Reminder: to read strings, you can define the input object as follows:

BufferedReader countryReader = new BufferedReader(new InputStreamReader(System.in));
the header of the main method is:
public static void main(String[] args) throws IOException{

5. Write down a piece of code that, given amount of money money, doubles this amount. Take into account that the amount of money is not necessarily an integer: one can have $1.50. Trace your code on the example of doubling $1.50.