Write a driver class

Assignment Help JAVA Programming
Reference no: EM131604459

Write a class named DaysOfMonth.java. The class's constructor should accept two arguments:
- An integer for the month (1 = January, 2 February, etc).
- An integer for the year

The class should have a method named getNumberOfDays that returns the number of days in the specified month. The method should use the following criteria to identify leap years:

1. Determine whether the year is divisible by 100. If it is, then it is a leap year if and if only it is divisible by 400. For example, 2000 is a leap year but 2100 is not.

2. If the year is not divisible by 100, then it is a leap year if and if only it is divisible by 4.

For example, 2008 is a leap year but 2009 is not.

Write a driver class called DaysOfMonthDemo.java. This program asks the user to enter the month (letting the user enter an integer in the range of 1 through 12) and the year. The program should then display the number of days in that month. Here is a sample run of the program:

Enter a month (1-12): 2 [Enter] Enter a year: 2008 [Enter]
Expected Output
Number of days in February, 2008: 29 days

Reference no: EM131604459

Questions Cloud

How many of each item should be ordered : Perform an operation to determine how many of each item should be ordered to maintain the stock - The program must use a pop-up dialogue box to get
What problems do experts encounter trying : what problems do experts encounter trying to ascertain if the sex was not consensual
Find the minimum cost to produce one thousand items : With quantities x and y of two raw materials available, Q = x½y½ thousand items can be produced at a cost of C = 2x + y thousand dollars.
The palliative care research : The ACS funded the Palliative Care Research (American Cancer Society, 2017b). According to this study, the original goals of palliative care.
Write a driver class : Determine whether the year is divisible by 100. If it is, then it is a leap year if and if only it is divisible by 400. For example, 2000 is a leap year but 210
How can you easily identify ipv-six multicast addresses : How can you easily identify IPv6 multicast addresses? Provide a good example. What commands are used to apply initial router configurations?
The expected returns of each of the four individual assets : What are the expected returns of each of the four individual assets and the three portfolios if the current SML is plotted with an intercept of 3.0?% ?
Find the marginal rate of increase of the number of bees : An agricultural worker in Uganda is planting clover to increase the number of bees making their home in the region. There are 100 bees in the region naturally.
Explain the ancient civilizations of mesopotamia : How is the Mesoamerica and Andean South America civilizations are compared, how are they similar to the ancient civilizations of Mesopotamia

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd