CIS 355 Lab 3: Arrays, Classes, and Objects
Type: Instant Download
Format: Zip file (Contains all documents needed for this assignment)
Version: Current 2013-14 (Click on tutorial image to view snapshot)
Frequently Asked Questions
What is included in the full course package? The entire course study guide includes the output file homework solution in notepad for CIS 355 Lab 3: Arrays, Classes, and Objects(bachelors program)
Your tutorial will include these files:
- CIS355_Lab3.Zip (Notepad document)
What if I find a question is missing? Just shoot us an email or contact us via live chat. Our expert DBM tutors will add the answers to the study guide within 1 to 3 days. You will receive a free update to the study guide with the answers you need.
Will this help me with DBM 405 problems? Yes, this guide is designed to help students get through the CIS 355 Lab 3 exercise with ease.
CIS 355 Lab 3 Arrays, Classes, and Objects:
Program files for each of the following three programs.
1. Cylinder & Cylinder test
2. Date & Date test
Step 1: Cylinder
Create a class called Cylinder.java that contains two double-precision instance variables named radius and height. The class should include a constructor that initializes the radius and height variables. Also, you need a class method namedvolume() that returns the volume of a Cylinder object. The volume of a cylinder is given by its radius squared times its height times Pi (radius * radius * height * Math.PI). You can either use the value 3.1416 for Pi or use the Java provided value named Math.PI.
Write a class called CylinderTest.java and declare an array of three Cylinder objects to call the methods you declared in the Cylinder class. Make sure that all class methods are called from main(). Have main() display the value returned by volume() and verify the returned value by hand calculations (paper/pencil). Prompt the user to enter the values for the radius and height of each Cylinder object in the array.
Step 2: Date
Create a program called Date.java to perform error-checking on the initial values, for instance: fields month, day, and year. Also, provide a method nextDay() to increment the day by one. The Date object should always remain in a consistent state.
Write a program called DateTest.java that prompts the user to enter the month, day, and year as numeric values. This program then creates a Date object using the Date class you just created and tests the nextDay() method. This can be done in a loop of 40 iterations: the Date object calls the nextDay() method and prints the date during each iteration of the loop. This loop is to illustrate that the nextDay() method works correctly. Test the following cases:
11 years ago
Purchase the answer to view it

- cis_355_lab_3.zip