Display the date and a message

Assignment Help Computer Engineering
Reference no: EM132200768

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: EM132200768

Questions Cloud

Find the marginal utility functions for each good : Find the marginal utility functions for each good, and provide an economic in tepretation of their sign. Find the MRS for this utility function and provide.
Show the equivalent value in meter and centimeter : Write a Java GUI application to convert between US length metrics and the International length metrics.
Which of the following statements is true of linux : Which of the following statements is true of Linux?
What is sonia total effective budget in dollars : Let the market price initially be that one hour of phone banking and one hour of canvasing can each be bought or sold for $10.
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.
What does the coase theorem say about the case : What does the Coase theorem say about the case in which player 1 isnot liable for damages? Specifically, how does output compare to part (c)?
Compute the summation of even numbers and odd numbers : Compute the summation of even numbers and odd numbers from myNums and name them evenSum and oddSum.
Write a java boolean method which takes a 2-d array : Write a Java boolean method, equalRowCol, which takes a 2-dimensional array of int as a parameter and returns true if there is an entry.
What is the path between 0 and 5 : What is the path between 0 and 5? What is the weight of the path between 0 and 5?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Who needs to be on the incident response team

In today's highly connected world, cyber incidents happen on a daily basis. Every corporation from the very large to small and medium (SME) companies need.

  Describe the key problems and issues in the case study

Describe the key problems and issues in the case study. Formulate and include a thesis statement, summarizing the outcome of your analysis in 1-2 sentences.

  Write a try block in which you place a loop that attempts

Write a C# console application in which you declare an array of five integers and store five values in the array.

  What are the various benchmark tests that are available

What are the various benchmark tests that are available for testing a computer system or computer network?

  Create a string that describes the outcome of the game

Create a String that describes the outcome of the game like shown below and send that to both Clients.

  Create a pipe and forks a child process

The child writes back to its parent through its side of the pipe stating "Daddy, my name is ".The parent then writes the message received from the child to its.

  Prepare a program that implements a stack

We can create a stack using linked lists if we force ourselves to insert and remove nodes only at the top of the list.

  Assembly program

Specify the assembly language program (of equivalent binary instructions), created by a compiler from following pseudo-code program. Suppoose all variables are integer.

  What is difference between system analysis and system design

What is the difference between systems analysis and systems design? First discuss the aims of each of them (systems analysis and systems design) and how these aims are achieved.

  Compute the standard deviation at each day

Compute the 20 days moving average: avg(n) = avg(n-1)*factor + close of today*(1-factor). Compute the standard deviation at each day.

  Write down an essay of 500-750 words in which you describe

using a graphic organizer of your choice identify and explain six technology- induced methods that can be used in your

  What is network neutrality

Respond to the discussion 1 with 150 words What is network neutrality? Why has the Internet operated under net neutralityup to this point in time.

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