Colorado State University

Recitation R15 - Methods, Classes, & Interfaces
Spring 2018

CS163: Java Programming


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

Java Programming

  1. Create a new Java Project named R15
  2. Copy R15Admit.java into the project.
  3. Copy R15Interface.java into the project.
  4. Create a class called R15Room and have it implement R15Interface.
    • The TA will help you do this.
  5. Declare two private instance variables
    • An int called roomBeds to hold the number of beds
    • A boolean called roomMonitor that describes whether the room has a heart monitor
  6. Write the methods in the interface according to the pre and post conditions in the interface.
  7. Create a set of test cases in the main method that test your methods.
  8. Once your code passes your test cases, run your code using R15Admit.
    Show your assignment to the TA for credit

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