Write a java console application that reads a string

Assignment Help Computer Engineering
Reference no: EM132200752

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)

help please it must have

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

Reference no: EM132200752

Questions Cloud

Solve for optimal labor demand : A firm uses a production function of the form Y=z*K^0.33*Nd^0.67 and chooses labor input Nd to maximize profits taking the wage rate w that it pays per unit.
Good source and a poor source of information : What makes a good source and a poor source of information? How can you tell?
Evaluate the integers to determine the smallest value : Prompt the user for the number of integers that will be input, then prompt the user for that number of integers.
Let talk about reliability of information : Let's talk about reliability of information. Where do you guys go to get your news from? How do you avoid fake news?
Write a java console application that reads a string : Write a Java console application that reads a string from the keyboard and tests whether it contains a valid date.
Evaluate the effectiveness of the training program : How will you evaluate the effectiveness of this training program? What other things must you think about when planning this training program?
Describe some of your ideas for backup procedures : Describe some of your ideas for backup procedures, who will back up the data, how often and where will the copies be stored, etc?:
Write palindrome program python to check palindrome : Write palindrome program either in java or c++ or perl or python to check whether the string given is a palindrome or not.
Could some form of a swot analysis be useful : In your enhanced vision, be sure to expand your marketing concepts to include the relevant environment factors from your reading.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Find a regular expression for the language

Find a regular expression for the language over {a, b} that consists of all strings containing exactly one occurrence of substring ab.

  Write a class that throws when a string has more than 30

Write a class that throws an ExtraneousStringException when a string has more than 30 characters in it

  Sha-256 and rc4

SHA-256 (with 256-bit output) is more resistant to the attacks based on birthday paradox than SHA-1. Key reuse is deadly for the stream ciphers such as RC4.

  Explain your thought process to the class

Code compilers are installed on this server and are regularly used to implement new versions of the customer-facing application product.

  Define how to handle new hires and job changes

Discuss, in your own words using 500 words or more, the relationship between users and roles in databases. Explain why we use roles rather than simply.

  Discuss regulatory issues surrounding the area

You may use resources from the APUS Online Library, any library, government library, or any peer-reviewed reference

  Write an abstract superclass encupsulating a vehicle

Write an abstract superclass encupsulating a vehicle: A vehicle has two attributes it's owner's name and it's number of wheels.

  How many bytes are used to store a character in php

How many bytes are used to store a character in PHP? What are the differences between single- and double-quoted literal strings?

  Write down a c program to generate a matrix

Write down a C program to generate a matrix (2-D Array) of integers in the range 1 to 100.

  Create an alias by extracting three alphabets

Create an alias by extracting three alphabets from middle of the username and appending the current year to it.

  Draw cause-and-effect diagram for this problem

On the first day of registration, some students face difficulty accessing the system, draw Cause-and-effect diagram for this problem.

  Explailning the forensic investigative approach

We require to assure this applicant know how to find the facts of incident and develop an initial forensic investigative approach.

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