Individual Work 4 - Practice: Loops
[an error occurred while processing this directive]Description
In this assignment you will not be using Processing. Instead, you will be practicing using loops. The down-side is that you will not be creating anything visual. The up-side is that as you go along, Eclipse will use something called JUnit testing to let you know if your code works.
Directions
Read all directions before beginning your work.
- Start by importing IW4Loops.zip into Eclipse.
- In the Project Explorer, open the src folder then
the (default package) folder. Notice three files:
- IW4.java: you will edit this file
- Coin.java: do not edit this file
- TestMyLoops.java: do not edit this file
- The IW4.java file contains five method readers and default return statements. You will remove the return statement currently in each method and replace it with the result of the computations described in the corresponding comments.
- Once you think you have a solution to one of the problems, run the program and check the results in the JUnit test window.
Resources
The resources below are the only resources you should use in completing this assignment. In particular, do not use the CSC 130 tutors and do not search any electronic resources such as the Web for sample code. You may visit the tutors for general guidance, but they have been instructed not to help with the specific assignment questions.
- Use pencil and paper to sketch ideas
- Use your class notes and the class Web site
- Use the general resources on the CSC 130 Main Page
- Use the textbook
- Visit the instuctor during office hours or by appointment
Grading
Recall that individual work assignments are worth 50 points each. Refer to the syllabus for more course grading information.
- (8) Correct mathematical/computational approach
- (2) Use of comments to explain approach
Submission
Submit by taking two actions: upload a java file and make a printout. Details are below.
- Ensure that your name appears as a comment at the top of the IW4.java code file.
- Make a printout of the IW4.java code file. Use duplex if possible so you submit fewer pieces of paper. Ensure that each method prints entirely on one side of a page - avoid splitting method code across pages. If you have multiple sheets, staple them. Print the file before class starts, not during class.
- Upload your IW4.java file to the appropriate Moodle page. Do not export your code and do not submit a zip file. Just submit the single .java file.