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

  Provide a way to reset the game

Provide a way to reset the game and a way to quit the program. The operations should be subject to confirmation.

  Create an invoice class with four attributes

Create an Invoice class with 4 attributes: PartNumber (type int), PartDescription (type String), Quantity (type int), and Price (type double)

  Tracer for java

Implementation of a tracer of Java objects and the tracer can be invoked from any point of a Java program, accepting an object as argument.

  The fancy new french restaurant la food is very popular for

the fancy new french restaurant la food is very popular for its authentic cuisine and high prices. this restaurant does

  Write a short java application

You will write a short Java application that will accept five strings from the user. Each String will be a word in a sentence.

  Write two pages paper summarizing the given program changes

Write a 2 Page paper summarizing the above program changes and how each change will benefit the program's performance, and its functionality in general. Include references to back up each category of improvement.

  A class for counting the number of people

Specification: A class for counting the number of people in a room. This might be used to control how many people are allowed into a club with a doorman.

  Declare a variable at the beginning of the main method

Using the Future Value App declare a variable at the beginning of the main method for a linked list that stores a string. After the code calculates, formats, and displays the results for each calculation add code that formats a string with the res..

  Design into java code

As a design activity- the class diagram from a set of classes which form the basis for a simple project management tool. Your design should have the following classes: Employee Class, Project Class, Consultant Class, Manager Class, theAssignment Clas..

  Write a method insert at that takes an array of integers

Write a method, insertAt, that takes four parameters: an array of integers; the length of the array; an integer, say, insertItem; and an integer, say, index

  Splitting a linked list into two sublists in equal sizes

Write the definition of the method splitMid. Also write a program to test your method. (Use either the class UnorderedLinkedList or the class OrderedLinkedList to test your method)

  Write a sub that implements the game

Write a sub that implements the game

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