Cal State L.A. logo and University Seal - Link back to main page

CIS 283 - Programing assignment01

Email: jperezc at calstatela.edu

 

For this assignment you are going to write code for the following class:

- Book

Here are the specifications of class Book:

Book must have 4 INSTANCE variables. They are all Strings and have the following names:

title, authFirstName, authLastName, isbn

Book must have one method called printBook. Define printBook so that if, for example, the value of title were "Java for Beginners", the value of authFirstName were "Jon", the value of authLastName were "Smith", and the value of isbn were "12345678" then the following would be printed:

title: Java for Beginners
First name: Jon
Last name: Smith
isbn: 12345678

But for another book the value of title could be "Java 6", the value of authFirstName could be "Mary", the value of authLastName could be "Brown", and the value of isbn could be "666" then the following would be printed:

title: Java 6
First name: Mary 
Last name: Brown 
isbn: 666

please use the following command in the code of printBook in order to print: Test01.println(). For example, if you wanted to print the value of variable X you would write: Test01.println(X). Use this statement instead of the usual System.out.println().

Read the instructions carefully.

    • create a folder called Assignment01
    • create a file called Book.java and save it in folder Assignment01
    • write a method called printBook for your class Book. HINT: the header of the definition of the method should look like:

    void printBook()

    • download file Test01.class and put it in your folder Assignment01
    • compile all java files in folder Assignment01
    • type the following command in the DOS prompt window:

    java Test01

    • tests will be run on your code and appropriate messages will be printed out showing which tests passed and which failed. At the end the program will tell you which option to choose in the web form: 283progassignment01.htm
Email: jperezc at calstatela.edu