This question's due date has already passed. You may post a tutorial, but there's no guarantee that the original asker will purchase the tutorial. But other people might!

Question

$14.00 Java lab 3 of 6

Asked by :
luna86
luna86 Not confirmed
Rating (44):A
Questions Asked: 53
Tutorials Posted: 33,
Earned: $2,679.60
 
 
Q:

In this lab you will create two programs that use classes and methods.

Deliverables

Program files for each of the following two programs

  1. Cylinder
  2. Date

At the beginning of ALL your programs, put a comment box that includes the program name, your name, and a brief description of the program.

Example: 

/***********************************************************************
Program Name: ProgramName.java
Programmer's Name: Student Name
Program Description: Describe here what this program will do
***********************************************************************/

How to submit your assignment: 

  1. The programs MUST have the same names as the assignment title.
  2. Each Java source file (*.java) must include a corresponding class file (*.class) program as evidence of success.
  3. In addition to the program source code files and byte code files, put all your program source code files and screen shots of your program output files into a Word document.
  4. You must use a zipped folder to send your weekly assignment to the Dropbox. Do not send subfolders within your zipped folder. Place ALL of the .java and .class files for the week into the one zipped folder. The zip folder should be named: CIS355A_YourLastName_iLab_Week3, and this zip folder will contain all the weekly programming assignments.

i L A B  S T E P S

STEP 1: Cylinder (20 points)

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 named volume() 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.

Grading Rubric

Cylinder

Points

Description

Standard header included

1

Must contain program's name, student name, and description of the program

Program compiles

2

Program does not have any error

Program executes

2

Program runs without any error

Created Cylinder class

3

Program contains the Cylinder class

Constructor created that initializes variables

2

A constructor method exists in the Cylinder class and initializes radius and height

Contains a volume method

2

The volume method exists in the Cylinder class and it returns the volume of a Cylinder object

CylinderTest class, which drives the application, is created

4

A driver class with the main method

Correct output is displayed

4

Program displays the radius, height, and volume of three Cylinder objects

Subtotal

20

 


STEP 2: Date (20 points)

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:

  1. Incrementing into the next month, for example, use date: 02/28/2011
  2. Incrementing into the next year, for example, use date: 11/27/2011
  3. Incrementing into the next month in a leap year, for example, use date: 02/28/2012

Sample Program Output: 

Checking increment
Date object constructor for date 11/27/2011
Incremented Date:11/28/2011
Incremented Date:11/29/2011
Incremented Date:11/30/2011
Day 31 invalid. Set to day 1.
Incremented Date:12/1/2011
Incremented Date:12/2/2011
...
Incremented Date:12/30/2011
Incremented Date:12/31/2011
Day 32 invalid. Set to day 1.
Incremented Date:1/1/2012
Incremented Date:1/2/2012
Incremented Date:1/3/2012
Incremented Date:1/4/2012
Incremented Date:1/5/2012
Incremented Date:1/6/2012

 

Available Tutorials to this Question
 
$10.00
Java lab 3 of 6
  • This tutorial was purchased 4 times and rated C- by students like you.
  • Posted on May. 15, 2012 at 08:00:31AM
Posted by :
longbodie
longbodie
Rating (215):A
Questions Asked: 1
Tutorials Posted: 592,
Earned: $8,164.42
 
A:
Preview: ... and edit nam ...

The full tutorial is about 12 words long plus attachments.

attachmentlogo

Attachments:
output1.jpg (19K)
output2.jpg (81K)
Java lab 3 of 6.zip (54K) 

 Date/Date.class
 Date/Date.java
 Date/Screenshot2.doc
 Cylinder/Cylinder.class
 Cylinder/Cylinder.java
 Cylinder/CylinderTest.class
 Cylinder/CylinderTest.java
 Cylinder/Screenshot.doc
 ]

  • This tutorial has appended information.
 
$14.00
Correct A+++ Solution!!! - Cylinder and Date classes
  • This tutorial was purchased 10 times and rated No Rating by students like you.
  • Posted on May. 15, 2012 at 09:17:19AM
Posted by :
rozarus
rozarus
Rating (386):A+
Questions Asked: 2
Tutorials Posted: 751,
Earned: $16,351.66
 
A:
Preview: ... ution in the a ...

The full tutorial is about 7 words long plus attachments.

attachmentlogo

Attachments:
code.zip (106K) 

 document.docx
 Cylinder.class
 Cylinder.java
 CylinderTest.class
 CylinderTest.java
 Date.class
 Date.java
 DateTest.class
 DateTest.java
 ]

 
$14.00
Java lab 3 of 6
  • This tutorial was purchased 10 times and rated No Rating by students like you.
  • Posted on May 15, 2012 at 6:19:11PM
Posted by :
lightsource
lightsource Not confirmed
Rating (2355):A+
Questions Asked: 4
Tutorials Posted: 5431,
Earned: $110,817.87
 
A:
Preview: ... ed files ...

The full tutorial is about 15 words long plus attachments.

attachmentlogo

Attachments:
datecylinder.zip (22K) 

 datecylinder/Cylinder.java
 datecylinder/CylinderTest.java
 datecylinder/Date.java
 datecylinder/DateTest.java
 datecylinder/screenshot_cylinder.JPG
 datecylinder/screenshot_date.JPG
 ]

  • This tutorial has appended information.
 
$10.00
A++ solution with Screenshot - CIS355A Week 3 Cylinder.java Date.java
  • This tutorial was purchased 1 time and rated No Rating by students like you.
  • Posted on Dec 12, 2012 at 6:05:50PM
Posted by :
adinh3290
adinh3290
Rating (309):A-
Questions Asked: 3
Tutorials Posted: 1164,
Earned: $13,602.11
 
A:
Preview: ... A++ solution ...

The full tutorial is about 10 words long plus attachments.

attachmentlogo

Attachments:
Cylinder_Screenshot.jpg (35K) (Preview)
Date_Screenshot.jpg (114K) (Preview)
Week3 Programs.zip (2K) 

 Cylinder.java
 CylinderTest.java
 Date.java
 DateTest.java
 ]

 
$15.00
Java iLab 3 of 6 - an original and A++ work !!!
  • This tutorial hasn't been purchased yet.
  • Posted on Feb. 24, 2013 at 07:19:36AM
Posted by :
soleil91
soleil91
Rating (33):A
Questions Asked: 1
Tutorials Posted: 319,
Earned: $2,669.50
 
A:
Preview: ... A++ solution ...

The full tutorial is about 9 words long plus attachments.
 
$14.00
Complete solution of CIS355A week 3
  • This tutorial hasn't been purchased yet.
  • Posted on Feb 24, 2013 at 7:25:02PM
Posted by :
AH_SOLUTION
AH_SOLUTION
Rating (15):A+
Questions Asked: 0
Tutorials Posted: 135,
Earned: $882.80
 
A:
Preview: ... ete solu ...

The full tutorial is about 6 words long plus attachments.

attachmentlogo

Attachments:
Cylinder.zip (158K) 

 Cylinder/Cylinder.java
 Cylinder/Cylinder.jpg
 Cylinder/CylinderTest.java
 ]

DateTest.zip (89K) 

 DateTest/Date.class
 DateTest/Date.java
 DateTest/DateTest.class
 DateTest/DateTest.java
 DateTest/Day.jpg
 ]

 
$8.00
Java iLab 3 of 6: Cylinder and Date - an A++ Work and very Detail !!!
  • This tutorial hasn't been purchased yet.
  • Posted on Apr 16, 2013 at 5:01:42PM
Posted by :
special_one
special_one
Rating (213):A
Questions Asked: 0
Tutorials Posted: 304,
Earned: $8,946.31
 
A:
Preview: ... question thank you for purch ...

The full tutorial is about 25 words long plus attachments.