Dr. Johnson's Review Sheet for CIS 270 Exam 1

Main Menu

Materials covered: Chapters 3, 7, 8

Assignments covered: 1, 2, 3

How to study (in order of priority):

  1. Review slide shows and text, take notes
  2. Review the above assignments

Resources you can and cannot use:

You can use any books, notes, or files that you bring. You can also use the Internet for information. You cannot share book, notes, or files with anyone else during the exam. You cannot communicate with anyone during the exam. You cannot use any other kind of electronic device other than your computer (turn off cell phones). Violation of these rules will result in an XF grade in the course.

Sample test problem 1:

Create an application with a Student class having instance fields ssn, name, transcript (data type Transcript), gpa, and deansList (data type boolean). Include the Transcript class with instance field courses (data type ArrayList<Course>) and the Course class with instance fields department, courseNum, and grade. Create a constructor and a toString() method for each class. The Student class also has a method called setDeansList() which sets the value of deansList to true if GPA is >= 3.0, false otherwise.

Create a tester class that uses JOptionPane to get information about a student and the courses taken. The tester class uses a while loop to continue with new students until the user is finished. The application displays all the student information including the transcript and gpa. Follow all good programming practices and Java conventions.

Completely document both classes (javadoc not required).

A sample solution to this problem are located at \\cisclass\Class\CIS270\Johnson\Sample Programs\Exam 1 Study Guide Solutions Spring 2009

Sample test problem 2:

Create a file called Book.java that has a class called Book. The instance fields of Book are bookId, title, author, and cost. Create one constructor that has four parameters corresponding to these instance fields. Also create a toString() method that returns a string containing the instance fields of a book. No additional variables should be included in the Book class. You may also need a method called getCost().

Create a file called Store.java containing a class called Store. The instance fields of Store are an ArrayList<Book> called inventory and an integer variable called numberOfBooks. The Store class has a constructor and a toString() method that returns a string containing the instance fields of a store. No additional variables should be included in the Store class. Add a method called addBook() that adds a book to inventory and a method called calculateTotalCost() that calculates the total cost of the store’s inventory of books. You may also need a method called setNumberOfBooks().

 Finally, create a file called StoreTester.java that creates a Store object, creates three Book objects, and adds them to the store’s inventory. Then display the store’s inventory of books (using the toString() method in Store) and display the total cost of the store’s inventory (using calculateTotalCost()). You can display the output in a JOptionPane window or the console.

Some sample solutions to this problem are located at \\cisclass\Class\CIS270\Johnson\Sample Programs\Exam 1 Study Guide Solutions Spring 2009