For lab this week we'll be learning to utilize the CS lab computers, and the power of the Eclipse IDE (Integrated Development Environment). In order to accelerate the learning process, we'll be writing a fairly simple program, which should also serve as a refresher for your Java skills.
Synopsis:
What you will learn today:
Quiz to review information from the first two chapters.
Logging on to the CS Lab Computers.
Starting up Eclipse.
Compiling and running Java programs using Eclipse.
Review of Java programming concepts.
Hopefully you've had an opportunity to do this already, but if you haven't, the machines in the CS Lab are at your service. Your user name is posted on the wall of the lab in 2250, the lab adjacent to where we meet. By default, your password is your UIN. If you can't find your name on the list, or are having other issues logging in, send an email to cs-accounts@uic.edu, so we can sort things out as soon as possible.
Get a partner. All labs must be done with a partner. You don't need to have the same partner each time, and we may ask you to change partners from time-to-time. You will take turns (every ~15 minutes) typing/using the mouse. The two of you will turn in a single lab solution.
Start up Eclipse.
Eclipse can be started in one of a few ways. Entering eclipse into a terminal window will start the program. You can also find it in the Application folder, and open it there.
Write the following program (Number Guess)
This is a game for two players. The first player will be asked to input a number between 1 and 50. Then the screen will be cleared, and it will be the second player's turn. The second player gets a sequence of tries to guess the number. After each guess, the computer will tell the player whether his guess is too high, too low, or correct.
The points for this lab will be assigned as follows:
Stage 1: Print out instructions for the game.
Stage 2: Get user input for initial value.
Stage 3: Add loop that handles the second player's input, with if statements that give feedback as play progresses.
Stage 4 (Extra credit): Add the option of having a computer player for either the first OR second player. See the Random class for generating random numbers, and see if you can make the second player intelligent about their guesses.
4. Compiling and running your program using Eclipse will be demonstrated in class.
DO NOT HESITATE TO ASK THE TA-s FOR HELP.
1. You should work with a partner for a grade. Only one of you need to submit. In other words, only one submission per group.
2. You should turn in to Blackboard within one hour after the beginning of the lab. (9am for 8am lab, 10am for 9am lab, 11am for 10am lab and noon for 11am lab) .
3. Submission should have both partners' names and the lab time in comments at the top.