Display the date and a message

Assignment Help Computer Engineering
Reference no: EM132200466

Question :

Write a Java console application that reads a string from the keyboard and tests whether it contains a valid date.

Display the date and a message that indicates whether it is valid.

If it is not valid, also display a message explaining why it is NOT valid.

The input date will have the format mm/dd/yyyy.

A valid month value mm must be from 1 to 12 (January is 1). You can use:

String monthPart = inputDate.substring(0, 2);
int month = Integer.parseInt(monthPart);
to get the month value.

A valid day value dd must be from 1 to a value that is appropriate for the given month. September, April, June, and November each have 30 days.

Assume February has 28 days. All other months have 31 days.

The year can be any 4 digit year.

Be sure to use a switch statement at least once (perhaps for checking the valid months)

Reference no: EM132200466

Questions Cloud

Calculate the wavelength for the electronic transition : Calculate the wavelength (in nm) for the electronic transition from n = 3 to n = 5 in the hydrogen atom.
What kind of shots are mostly used in the film and why : Is there any symbolical use in using the colors black and white in the Streetcar film? Is there any particular symbolism conveyed in the film.
Calculate the theoretical yield of fes : An initial reaction mixture contains 9.42 g of Fe and 8.50 g of S. The following reaction occurs:
Calculate the theoretical yield of pi3 : If 48.0 g of iodine are reacted with an excess of phosphorus according to the following chemical equation:
Display the date and a message : Write a Java console application that reads a string from the keyboard and tests whether it contains a valid date.
How many milliliters of water must be added : How many milliliters of water must be added to 350 mL of 0.840 M HCl to dilute the solution to 0.250 M?
What is the optimal holding of demand deposits : What is the optimal holding of demand deposits according to Baumol's square-root rule? Find also the number of transfers made over the year.
What is the concentration of the original h3po4 solution : If 30.0 mL of 0.15 M Ba(OH)2 was needed to neutralize 50.0 mL of an H3PO4 solution. What is the concentration of the original H3PO4 solution?
Calculate the ph of the best buffer : You have a 250.0 mL sample of 0.25 M HF acid (Kg = 7.2 x 10-4). Calculate the pH of the best buffer.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Declare necessary subtypes-array types and array variables

Declare the necessary subtypes, array types, and array variables for the situation. A 24-component Float array for which the index goes from 1 to 24.

  Develop an opinion as to the degree to which hypertext links

Select two opposing viewpoints from web sources and by providing a review of their content develop an opinion as to the degree to which hypertext links are a good idea.

  Explain two types of computer attacks/ viruses

In order to limit the creation of malicious code, do you think that access to elements of document object model and some Javascript functionality be limited? In discussing the answer, describe two types of computer attacks/ viruses that may be ini..

  What would be the value of the flags

If the last operation performed on a computer with an 8-bit word was an addition in that the two operands were 00000010 and 00000011, what would be the value of the following flags.

  Add a process addtext to the question class

Add a method addText to the Question class, and give a different implementation of ChoiceQuestion that calls addText rather than storing an array list of choices.

  Do you think city of chicago got good deal from arrangement

Value-added contracts can be quite rare-and very dramatic. Do you think the city of Chicago got a good deal from this arrangement? Why or why not?

  Describe best practices for using a vpn

Describe different types of VPNs (hardware or software based). Discuss how the use of a VPN may support BYOD.

  Develop and test an html document that collects information

Develop and test an HTML document that collects the following information from the user: last name, first name, middle initial, age and weight.

  Write a class named testscores

Write an exception named InvalidTestScores, which is thrown by the TestScores class if any of the test scores in the array are invalid.

  What is the difference between formative assessment and

1 in a 750-1000 word essay draft your proposal to utilize software to support assessment in the classroom. consider the

  The identification of cardinality between entities

An inspection occurs at a particular date and time, with a numeric score from 1 to 5, and notes about the outcome of the inspection.

  Analyze how the data breach could have been prevented with

write a three to five page paper on your selected case in which youdescribe the data breach incident and the primary

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