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

  What is the intended meaning of the given queries

Write a PROLOG program which checks if a list contains another as a sublist. What is the intended meaning of the given queries?

  Design a set of instructions to program the dma controller

Design a set of instructions to program the DMA controller. Specify the instruction formats, assuming ASC as the CPU.

  What is the running time of the algorithm

Write a program that implements a function SwapTree() that takes a binary tree and swaps left and  right children of every node. What is the running time of your algorithm.

  Sketch the power spectral density of given function

Express the narrowband noise processes shown in Fig. in quadrature form. For each process, choose two different center frequencies.

  Analyse the general nature of artificial intelligence

COMP.7212 - Artificial Intelligence Techniques Assignment - Combinatorial Optimisation, Toi Ohomai Institute of Technology, New Zealand

  Explain the segments of adoption curve with an example

Explain why the one characteristic is the main driver of the rate of diffusion withan example? Explain the five segments of adoption curve with an example?

  What factors are important in your decision

Decide what factors are important in your decision as to which computer to buy and list them. After you select the system you would like to buy, identify which terms refer to hardware and which refer to software.

  How would the given customer be classified

Specify the success class as 1 (loan acceptance), and use the default cutoff value of 0.5. How would this customer be classified?

  Comprehensive non statistical attributes sampling

Marty Alewine, a newly promoted senior at your firm, has been assigned as in charge of the audit of Doxey Electronics. Doxey has been a client of your firm.

  Assume monetary benefits of an information system of 40000

assume monetary benefits of an information system of 40000 the first year and increasing benefits of 10000 a year for

  Write down an application that displays a menu

Write down an application that displays a menu.

  Add the counting numbers from 1 up to an integer

Write an assembly language program in a file that will add the counting numbers from 1 up to an integer that is supplied in a word in memory.

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