The results of your studio session are to be reported and documented in a file that you save in your workspace. You are to commit that report prior to leaving studio. In the descriptions of the studio exercises, verbs like report and document are indications of activities you should summarize and discuss in your report.In your groups, take turns documenting results, looking over shoulders, and staffing the keyboard.
It is unacceptable to copy anything without understanding it. At any point, the TA or instructor can point to something you've done and ask you why it works, or change it and ask what would happen with the modification.
- To receive credit for a studio, your team must cleared by a TA using the green box at the bottom of this page.
- Be careful how you use the web. You are required to develop solutions as a group by thinking not by finding solutions that have been thought out by others. You must be able to explain anything that you have done.
The label contains a name you need to access the studio repository for your group.
After pasting:https://shell.cec.wustl.edu:8443/cse131/svn/studio1-ZZZZZZ
If the person currently keyboarding does not want to share his or her computer, then commit the repository and somebody else can check it out using the above instructions.
Try this now on the Hello class. When it asks you how you are feeling, enter whatever comes to mind.
The tools we use are replete with buttons and menus to make programming
easier. One such button near the top of your eclipse window is a green
circle containing a white triangle:
Clicking on this button will run the program again.
Try running the program using the button. Isn't that more fun?
For example, to run the Hello example, included in this studio, you would type:java studio1.Helloand hit enter. Try that. ![]()
On the command line, you can supply the program's inputs directly, instead of being prompted for them one at a time.
In the command line window, type:java studio1.Hello spunkyand hit return. Notice that the program now uses spunky as its input.
Some of the following exercises are adapted from Princeton University's COS 126 course, based on our text by Sedgewick and Wayne.
For each of the following exercises, find the file in your studio repository and complete it to do the assigned task.
Feel free to end the output with punctuation that indicates the level of enthusiasm associated with your greeting.
Be sure to put in proper punctuation to separate the names.
Some of you may already know some Java. We have not yet covered the if statement. You must use what has been taught so far (simple expressions and assignment) to accomplish this task.
Sample output:OK, for this one, you are on your own. We are not giving you code for this, but will instruct you how to create your own Java file from scratch:
Average of 5 and 6 is 5.5Note that the output is specified as a double, because the average of two integers is not necessarily an integer.
- Refer to other studio code to see how this is done.
- It is likely that when you type in the code, eclipse will flag your code with an error, because it doesn't know (yet) about ArgsProcessor.
Silly eclipse.
You can get eclipse to solve its own problem by mousing over the error, and using the first suggestion that pops up, namely to include ArgsProcessor from the cse131 package.
Sometimes eclipse is über silly and won't tell you about that fix until you have saved your file. So save it.- Try to use meaningful messages to prompt for values. The units for the values will be interpreted as grams. For example, if 3 is specified for carbs, that means that this run of your program is for food that has 3 grams of carbohydrates.
A not so nice prompt:
int n1 = ap.nextInt("Yo, sup?");and a nice prompt:int n1 = ap.nextInt("The first of two integers to be averaged?");- Run your program and makes sure it prompts you correctly for its values.
- Ask a TA to check your work at this point.
Often, there is no right or wrong answer. Be prepared to defend your choices.
When you done with this studio, you must be cleared by the TA to receive credit.
- Commit all your work to your repository
- Fill in the form below with the relevant information
- Have a TA check your work
- The TA should check your work and then fill in his or her name
- Click OK while the TA watches