SlideShare una empresa de Scribd logo
1 de 2
SOLUTIONJUG.COM

CIS/355 iLab 3 of 6

CLICK HERE TO GET THE SOLUTION !!!!!!!!




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
                                                   Must contain program's name, student name, and
Standard header included                    1
                                                   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               A constructor method exists in the Cylinder class
                                            2
variables                                          and initializes radius and height
                                                   The volume method exists in the Cylinder class and
Contains a volume method                    2
                                                   it returns the volume of a Cylinder object
CylinderTest class, which drives
                                            4      A driver class with the main method
the application, is created
                                                   Program displays the radius, height, and volume
Correct output is displayed                 4
                                                   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
Grading Rubric
                Date                    Points                         Description
                                                Must contain program’s name, student name, and
Standard header included                    1
                                                description of the program
Program compiles                            2   Program does not have any error
Program executes                            2   Program runs without any error
                                                Date class has nextDay method and does not use any
Created Date class                          6
                                                other predefined Java class for date
DateTest class, which drives the                User enters the values for month, day, and year in a
                                            4
application, is created                         numeric format and test the nextDay method
Correct output is displayed                 5   The correct date increment is displayed
                            Subtotal 20



CLICK HERE TO GET THE SOLUTION !!!!!!!!

Más contenido relacionado

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Cis 355 ilab 3 of 6

  • 1. SOLUTIONJUG.COM CIS/355 iLab 3 of 6 CLICK HERE TO GET THE SOLUTION !!!!!!!! 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 Must contain program's name, student name, and Standard header included 1 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 A constructor method exists in the Cylinder class 2 variables and initializes radius and height The volume method exists in the Cylinder class and Contains a volume method 2 it returns the volume of a Cylinder object CylinderTest class, which drives 4 A driver class with the main method the application, is created Program displays the radius, height, and volume Correct output is displayed 4 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
  • 2. 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 Grading Rubric Date Points Description Must contain program’s name, student name, and Standard header included 1 description of the program Program compiles 2 Program does not have any error Program executes 2 Program runs without any error Date class has nextDay method and does not use any Created Date class 6 other predefined Java class for date DateTest class, which drives the User enters the values for month, day, and year in a 4 application, is created numeric format and test the nextDay method Correct output is displayed 5 The correct date increment is displayed Subtotal 20 CLICK HERE TO GET THE SOLUTION !!!!!!!!