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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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