Create a class IndependenceUSA and write code which asks the user to enter text that contains the American Independence day ( July 4th 1776). Read the date using the method next() 3 times. The user should enter the Independence day in the order month, day, year as shown in the first two runs below( we are not case sensitive) . Use the String method compareToIgnoreCase() to test the validi- ty of the date and print “Hurrah!” if the date entered is correct, or “No, no , no! Incorrect!” if the date incorrect is incorrect, or of the date entered in the wrong order. In other words, you compare your input to “July” , “4”, “1776” , in that order and you don't case for capital or small case letters.
Create a class IndependenceUSA and write code which asks the user to enter text that contains the
American Independence day ( July 4th 1776). Read the date using the method next() 3 times. The
user should enter the Independence day in the order month, day, year as shown in the first two runs
below( we are not case sensitive) . Use the String method compareToIgnoreCase() to test the validi-
ty of the date and print “Hurrah!” if the date entered is correct, or “No, no , no! Incorrect!” if the
date incorrect is incorrect, or of the date entered in the wrong order. In other words, you compare
your input to “July” , “4”, “1776” , in that order and you don't case for capital or small case letters.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images