Smith College / CSC212 / P0 Starter Code
This opening assignment is worth half of a regular assignment (50 points) in total. Most of it is to practice using our new tools.
You can open the preferences menu by going to the top of your screen (in Eclipse) and finding the appropriate menu:
Eclipse -> Preferences (Mac)
Window -> Preferences (Windows)
Click on General > Appearance
as shown below, and you can choose a theme. You need to then Apply and Close
and restart Eclipse for it to fully apply.
Recent versions of Eclipse autocomplete when you press the space bar, which sometimes means replacing something you've typed with something else! It's very frustrating. You can find this setting Java > Editor > Content Assist
(as shown "broken" in the image below) and check the box for easier to use autocomplete!
There are a lot of steps here! Don't try to memorize them, just practice. Whenever you click next, or open a menu, see if you can read it, guess what you should do next, and confirm with these steps. Doing it this way will help you get through it quicker for future assignments.
- Go to the "File" menu and choose "Import"
- Expand the Git Folder and choose "Projects from Git"
- Click "Next"
- Choose "Clone URI"
- Copy and paste https://github.com/jjfiv/GuessingGame.git into the URI field.
- Click "Next"
- Wait for it to find "master"
- Click "Next"
- (optional) Choose a directory to store the project.
- Click "Next"
- Choose "Import as general project"
- Click "Next"
- Click "Finish"
- Right-Click on the new project that showed up in the "Package Explorer" on the left. Select "Configure > Convert to Maven Project".
- Expand the "GuessingGame" folder, expand the "src/main/java" and "(default package)" folders.
- Double-Click on
GuessingGame.java
- Run the code. Do one of:
- Press the Green Run button at the top.
- Use the Run menu at the top and select Run.
- Right-Click and choose "Run As > Java Application"
- The "Console" tab on the bottom should show you the output of the program. (When you implement the rest of the game, you will also need to type here... the cursor looks like it's in the wrong place sometimes but don't worry.)
Remember, type to learn syntax and cite! Use the solution as example code.
Although we haven't discussed Java syntax, we can identify things that are familiar: loops, if statements, etc.
- (5) Tell the user "That guess is out of range" if their guess is too high or too low.
- (5) See if you can a print statement "That was a very good guess!" if the user is within 10 or so of the correct answer. (Think about using the absolute value of their error!)
- Go to the "File" menu and choose "Export".
- Expand the "General" folder.
- Choose "Archive File"
- Click "Next"
- Make sure the project you are exporting is checked.
- Fill in the "To archive file:" field with "YourEmail-P0.zip" e.g., I do "jjfoley-P0.zip" You probably should use the "Browse" button to choose another place for it, like your desktop. -- you may get an error if you don't.
- Make sure "Save in zip format" is checked.
- Click "Finish"
- Upload that zip file to Moodle!
Check off all the things you did in the form.