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

  Discuss the abc password management system is enforcing

Briefly describe what policy or policies the ABC password management system is enforcing

  Conduct cyber assessment using cset cybersecurity framework

Create for your company & conduct cyber assessment using the CSET Cybersecurity Framework (CSF) requirement-based assessment

  Define array type team-record-array with integer components

Define an array type Team_Record_Array with Integer components indexed by Teams. Declare an array variable Win_Loss to be of type Team_Record_Array.

  In your own words what is a data structure

Provide an example application for which a list is appropriate. Please be sure to provide details with your application.

  Explain what is a virtual machine

What is a virtual machine? Discuss this definition in terms of the Pep/7 computer. Describe the features of the Pep/7 CPU that we covered in this chapter.

  What is an interrupt address vector

Discuss the basic difference between polled I/O and interrupt I/O. What is the difference between subroutine and interrupt I/O?

  How many times will the cpu have to reference memory

How many times will the CPU have to reference memory in order to fetch and execute a two-word indirect addressing mode instruction (b) if the instruction is a JMP instruction?

  Thread problem the eaters must give their dishes to the

thread problem the eaters must give their dishes to the dishwasher by putting them on a conveyor belt that has a

  What is wrong with the given variable declaration

Declare a variable suitable for holding the number of bottles in a case. What is wrong with the following variable declaration? int ounces per liter = 28.35

  Show that at one trinode restructuring operation is needed

Show that at most one trinode restructuring operation is needed to restore balance after any insertion in an AVL tree.

  What do the methods setmaxage setvalue and get comment do

What are the primary benefits of using an IDE for building servlet applications? What do the methods setMaxAge, setValue, and get Comment do?

  Create and test an html document that has a form

Create and test an HTML document that has a form with the text box to collect the user's name and Four checkboxes.

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