CS 107 (Spring '09)
[Schedule]
[Programs]
[Notes
& Reference] [Examples][Syllabus]
[Lab & TA] [Tests]
[Grades]
Prof. Reed, CS 107, Spring '09
Due Monday 1/26 at 1:00 p.m.
Write a program in Java to play the game of "TwentyFour." ( Idea taken from the card game called TwentyFour.) Running your program will look something like what is shown below, where user input is shown in bold:
Author: Dale Reed Program: #1, TwentyFour TA: Englebert Humberdink, T 4-5 Jan 13, 2009 Welcome to the game of TwentyFour. Choose one of the sets of 4 numbers below . You then need to use each of those four numbers exactly once, combining them somehow with the basic mathematical operators (+,-,*,/) to yield the value twenty-four. Possible sets of 4 numbers are: 8 5 7 5 9 8 5 1 1 1 8 8 9 4 2 2 6 4 8 6 2 3 5 2 Please enter the first number: 8 Enter the operator to be used (+,-,*, or /): - Enter the next number: 5 That gives: 3 Enter the operator to be used (+,-,*, or /): * Enter the next number: 8 That gives: 24 Enter the operator to be used (+,-,*, or /): / Enter the next number: 1 That gives: 24 Well done, genius! Goodbye, thanks for playing.
turnin -c cs107 -p program1 twentyfour.java
where the file containing your solution is called twentyfour.java . To practice using the turnin command you can use the project named "junk" (rather than program1 in the example above.). Do not name your program anything besides twentyfour.java ls -l ~i107/submit/program1
Note that you can execute turnin as many times as you would like, up until the program deadline when turnin will be disabled for this project. Each time you execute turnin for a project, you overwrite what you had turned in previously for that project. For this first program only, and only if you do not yet have an cs account, you may email your solution to your TA. Note that emailing your solution rather than using turnin may significantly delay the grading of your assignment.
[CS Dept] [UIC] [Prof. Reed]