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

  Create a linked list of student

The program initializes the list by first reading the students' names from the text file and setting the final grades to 0.00.

  Write a program that obtains the execution time of selection

Write a program that obtains the execution time of selection sort, bubble sort, merge sort, quick sort.

  Develop a plan of action for cleaning up the wiring

The original structure was built in 1965. The facility has undergone several remodels aesthetically, with no real infrastructure changes.

  It user support activity

Provide an effective support role to users of computer systems - Demonstrate the skills and knowledge necessary to install/upgrade hardware and software for an end-user.

  Design the stack of given problem using a ram

A 16-bit machine has a byte-addressable memory. Bytes 0 and 1 of the memory contain decimal values 31 and 241, respectively. If the machine uses 2s complement.

  Create a high-level network security policy

Create a high-level network security policy that identifies key network security measures. List of network assets and their use(s)

  Describe any of the internetworking

examine the impact of Global Intellectual Property Law upon the Telecommunication industry and upon businesses. Does it have a positive impact or none at all?

  Create a doubly linked list whose nodes contain strings

Create a doubly linked list whose nodes contain Strings. Create a main method that thoroughly tests each function you build to show that it works.

  New system implementation

In new system implementation, what could you do as the lead system designed to assure the implementation went smoothly?

  Build an app that executes a query against the players

Build an app that executes a query against the Players table of the Baseball database included in the Databases folder with this chapter's examples.

  Make use of a regularexpressionvalidator control

make Use of Visual Studio.NET 2005 to create an ASP.NET project with four aspx forms. Use Master Pages to display a company name selected by your group at the top each form.

  Determine the design issues with the new system

A large, fast-food chain unveiled a new touch screen register for its franchises. Each cashier was assigned a user id and password combination to log.

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