Discount Get CIS 355A ALL WEEKS Solution ONLY $80.98 $122.70
CIS 355A Week 1 STEP 1 - Write a Java program named ShowEscapeSeq... [$6.12]
CIS 355A Week 1 STEP 2 - Write an application called Circle.java ... [$6.13]
CIS 355A Week 1 STEP 3 - Write an application called PracticeArit... [$6.13]
CIS 355A Week 2 STEP 3 - Write a program called Diamond.java that... [$6.13]
CIS 355A Week 2 STEP 1 - Large - Write a Java application program... [$6.12]
CIS 355A Week 2 STEP 2 - A palindrome is a sequence of characters... [$6.13]
CIS 355A Week 3 STEP 1 - Create a class called Cylinder.java that... [$8.88]
CIS 355A Week 3 STEP 2 - Create a program called Date.java to per... [$8.89]
CIS 355A Week 4 STEP 1 - Write a program called InheritanceTest.j... [$7.66]
CIS 355A Week 4 STEP 2 - Write a program called DayGui.java that ... [$7.66]
CIS 355A Week 4 STEP 3 - Write a program called OfficeAreaCalcula... [$7.66]
CIS 355A Week 5 STEP 1 - Write a program named GuessGame.java tha... [$13.99]
CIS 355A Week 5 STEP 2 - Write a program called TextFileIO.java t... [$8.22]
CIS 355A Week 6 STEP 1 - Write a Java GUI application called Inde... [$7.66]
CIS 355A Week 6 STEP 2 - Write a Java GUI application Index2.java... [$7.66]
CIS 355A Week 6 STEP 3 - Write a program called ThreeArrayLists.j... [$7.66]
Get Selected Weeks Solution with ONLY NOT Add Selected Tutorials To Cart
CIS355A CIS 355A CIS/355A - Week 3 - STEP 2 - Create a program called Date.java to perform error-checking on the initial values, for instance: fields month, day, and year
    CIS355A CIS 355A CIS/355A - Week 3 - STEP 2 - Create a program called Date.java to perform error-checking on the initial values, for instance: fields month, day, and year

CIS355A CIS 355A CIS/355A - Week 3 - STEP 2 - Create a program called Date.java to perform error-checking on the initial values, for instance: fields month, day, and year

$8.89

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

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 Date class

6

Date class has nextDay method and does not use any other predefined Java class for date

DateTest class, which drives the application, is created

4

User enters the values for month, day, and year in a numeric format and test the nextDay method

Correct output is displayed

5

The correct date increment is displayed

Subtotal

20

 

Solution contains java source file (*.java), class file (*.class) and screenshot

You can using any java IDE, create new project and add all java source code to src folder and run programs.

If you have more question, please contact me via email support@extutorials.com

I will help you any time

Thanks

Attached Files

Move over [ preview ] file name to preview content in it!

  • Date.zip [76.8KB]
    • Date.class [1.6KB]
    • Date.java [1.4KB] [ preview ]
    • DateTest.class [1.4KB]
    • DateTest.java [0.8KB] [ preview ]
    • ScreenShot-Date.jpg [71.4KB]

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



PURCHASE SAVE
2 Tutorials 10%
3 Tutorials 13%
4 Tutorials 16%
5 Tutorials 19%
6 Tutorials 22%
7 Tutorials 25%
8 Tutorials 28%
9 Tutorials 31%
10 Tutorials 34%
add url more

9MZQASHWN73B