CSU Banner

CS 163/164, 🀨 Fall 2019 🀨

Lab 6 - Interfaces

Thursday, Sep. 12th or Friday, Sep. 13th


The purpose of this lab is to write Java code over the following topics:

1. Getting Started

  1. Create a new Java Project named Interfaces
  2. Copy L6if.java and Test.java into the project, make sure they are in the "src" folder.
  3. Create a class called Convert and have it implement L6if.
  4. Write the methods in the interface according to the pre and post conditions given below.
  5. In Test.java the first test case is given to you. Read the comment and create additional test cases so your output matches the comment.
  6. Show your code and output to the TA for credit.

2. Write the method body for toFahrenheit

  1. This method has the following properties:
  2. Preconditions:
  3. Postconditions:

3. Write the method body for toASCII

  1. This method has the following properties:
  2. Preconditions:
  3. Postconditions:

4. Write the method body for webify

  1. This method has the following properties:
  2. Preconditions:
  3. Postconditions:

5. Write the method body for isEven

  1. This method has the following properties:
  2. Preconditions:
  3. Postconditions:

6. Write the remaining test cases in Test.java

  1. The comments in Test.java indicate we want your output to look like this:
  2. Follow the remaining comments in Test.java to write test cases for your methods.

Show your assignment to the TA for credit

© 2016 CS163/CS164 Colorado State University. All Rights Reserved.