[an error occurred while processing this directive]

Individual Work 3 - Practice: Ifs

[an error occurred while processing this directive]

Description

In this assignment you will not be using Processing. Instead, you will be practicing using ifs. The down-side is that you will not be creating anything visual. The up-side is that as you go along, Eclipse will use JUnit testing to let you know if your code works.

Directions

Read all directions before beginning your work.

  1. Start by importing IW3Ifs.zip into Eclipse.
  2. In the Project Explorer, open the src folder then the (default package) folder. Notice two files:
    1. IfMethods.java: you will edit this file
    2. IfMethodsTest.java: do not edit this file
  3. The IfMethods.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.
  4. Once you think you have a solution to one of the problems, run the program and check the results in the JUnit test window. If you get a red x next to the name of the method, then you have a syntax error in your code that you should fix. If you have a blue x, then your code runs, but produces an incorrect result. The sample input, expected output, and actual output will be displayed. If you have a green check, then your code passed all the tests.

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.

Grading

Recall that individual work assignments are worth 50 points each. Refer to the syllabus for more course grading information.

Each of the five problems are worth 10 points, broken down as follows. Partial credit may be awarded.

Submission

Submit by taking two actions: create a printout and upload a file. Details are below.

  1. Ensure that your name appears as a comment at the top of the IfMethods.java code file.
  2. Make a printout of the IfMethods.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.
  3. Upload your IfMethods.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.
[an error occurred while processing this directive]