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.
Remember: it doesn't matter how far you get while here in studio. Ask questions, take your time, make sure you understand the work you do. Explore and try things to answer questions you have.
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?
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. Run each program as you go to see the results of your work.
Feel free to end the output with punctuation that indicates the level of enthusiasm associated with your greeting.When you are happy with this part commit and push your work. If you need help with this ask your TA!
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.5
Note 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.
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.
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.
Use ArgsProcessor to accept input and store these values using variables with the appropriate data types.
This conversion can be accomplished by casting, a topic you should find in your text or in the lecture material.
Given this input for a given semester's grading policy:
Jarett: Total score: 90.65 Grade for this course: 90 Final grade has a... Plus: false Minus: true
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 and push 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
- If you request propagation, it does not happen immediately, but should be posted in the next day or so
This demo box is for studio 1