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

  Questionproblem 1execute following boolean functions with

questionproblem 1execute following boolean functions with the appropriate multiplexer and external gatesf1 sum

  Which type of i-o addressing separate i-o or memory mapped

List parallel 110 devices used with computers you arc familiar with either in the laboratory or in a personal computer.

  What would be the equivalent condition in an exit statement

What would be the equivalent condition in an exit statement? What is the major criterion for selecting a while statement over a loop statement?

  Using java write a class called temperature

Using JAVA Write a class called Temperature that has two instance variables: a temp value (a floating-point number - data type double) and a character.

  Create a windows application that has the functionality

Create a windows application that has the functionality of a calculator but works with decimal values. Because division by zero is not thrown by the CLR when the operands are nonintegral.

  Create program to use vector and list to store ten integers

Create program to use vector and list to store 10 integers in order (from smallest to largest). You need to find proper location using vector or list function.

  What is the purpose of using asymptotic notation such as o

What is the purpose of using asymptotic notation such as O, Omega and Theta instead of using the exact number of comparisons done by a sorting algorithm?

  How entries move up the skip list during insertions

Visualize how entries move up the skip list during insertions and are linked out of the skip list during removals.

  Why does the collaborative system represent a cost penalty

Why does this represent a cost penalty to the overall system? Does it matter? Discuss from the perspective of some of the examples.

  Express currently used tools and recommended measures

Web phishing, pharming and vishing are popular web based scams. examine currently used tools and recommended measures to defeat this kind of attacks efficiently? Specifically focus on solutions that can be implemented at the network infrastructure ..

  What functions does a device controller perform

What functions does a device controller perform? How can a cache be used to improve performance when reading data from and writing data to a storage device?

  Explain if statement, a switch statement, or a combination

Do you think it would be better to set this up as an if statement, a switch statement, or a combination? Write down the code if it helps to explain your answer.

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