Write a class named daysofmonth

Assignment Help JAVA Programming
Reference no: EM131604416

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:

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.

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]

Reference no: EM131604416

Questions Cloud

Write down your specific recommendations to janet : Write down your specific recommendations to Janet? Do you agree or disagree with their recommendations for Janet
Explain the criminal justice agencys involvement : What is the reasoning for the criminal justice agency's involvement and the timing of the news story or press release
Estimate the production level that maximizes profit : Use the marginal cost and marginal revenue at a production of q = 5000 to determine whether production should be increased or decreased from 5000.
What was hipaa designed to protect : What did the National Provider Identifier Rule, implemented in 2007, require healthcare providers do?What was HIPAA designed to protect?
Write a class named daysofmonth : 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
Calculate the companys return on equity : Calculate the company's return on equity and explain whether the managers are providing a good return on the capital provided by the company's shareholders.
What is the price of the product : At approximately what production level, q, is profit maximized? Explain your reasoning.
Create a mystack class that uses an arraylist : Create a MyStack class that uses an ArrayList to make a stack - Return true if the braces are balanced or else return false
Explain the stress on employees during evaluation : What can you do to reduce the stress on employees during evaluation but still make sure the evaluation is thorough

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