1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sauron [17]
3 years ago
15

Write a program that asks the user to enter two dates (in YYYY-MM-DD format), and then prints which date is earlier. Your progra

m should print an error message if the user enters an invalid date (like 2019-15-99).
Computers and Technology
1 answer:
Dafna11 [192]3 years ago
4 0

Answer:

import java.util.*;

public class Dates {

   public static void main(String[] args) {

       String January,February, March, April, May, June, July,  

       August, September,October, November, December, month;

       January = February = March = April = May = June = July =  

               August = September = October = November = December = month = null;

       Scanner myScanner = new Scanner(System.in);  

       System.out.print("Enter date in the format mm/dd/yyyy: ");

       String input = myScanner.next();

       String months = input.substring(0,1);

       int monthInt = Integer.parseInt(months);

       if (monthInt == 01){

           month = January;

       }

       else if (monthInt == 02){

           month = February;

       }

       else if (monthInt == 03){

           month = March;

       }

       else if (monthInt == 04){

           month = April;

       }

       else if (monthInt == 05){

           month = May;

       }

       else if (monthInt == 06){

           month = June;

You might be interested in
**PLEASE HELP**
ruslelena [56]
Normally, you might expect that anything related to Sodium and Chlorine is insanely dangerous and shares properties of both(B), but since the two are making a compound, that is not true. Compounds almost never share the properties of the elements they are made from. So your answer is D.
8 0
3 years ago
True or False
krok68 [10]

I think that the answer is false. But I'm not sure.Let meknow if I'm right.

8 0
3 years ago
Read 2 more answers
10(            )  8(532.2 )                         
blagie [28]

Answer:

346.30

Explanation:

7 0
3 years ago
Aquatic animals have different levels of tolerance to pH scale changes in water. For example a wood frog will die if the pH of w
igomit [66]
We can assume that the acidity of the river has a pH value of at least 6 or greater. We know this because given that clams die if acidity is less than 6 and frogs die when acidity is less than 4, if they both survive, acidity must not be lower than 6 pH
4 0
4 years ago
3. If you want to have certain icons available regardless of what tab you're using, you should add them to the A. Ribbon. B. Sta
Vanyuwa [196]
The Correct Answer is:
D. Quick Access toolbar.

If you want to have certain icons available regardless of what tab you're using, you should add them to the <span>Quick Access toolbar.

Hope This Helps :)

P.S
If you would mark me as brainiest that would be great! :D
</span>
4 0
4 years ago
Other questions:
  • How can you best protect yoursel and when using social media
    14·2 answers
  • Answer how do you properly dispose of a large box of assorted computer parts, including hard drives, optical drives, computer ca
    11·1 answer
  • Which browser do most web users use and why do you think that it is that way? Make sure you search online for statistics to conf
    5·1 answer
  • What is blockchain? How it works? I heard bitcoin uses it.
    8·1 answer
  • Which of the following examples has four beats in each measure?
    12·2 answers
  • Question 1 of 30
    13·1 answer
  • What are the advantages of knowing demographics over psychographics and vice versa?
    12·1 answer
  • What are the missing words in the program?<br> divide(numA,numB):<br> numA/numB
    9·2 answers
  • How does Map Put function work in Java? *
    12·1 answer
  • 1-List some applications appropriate for each of the display technologies: raster refresh systems,plasma panels, and LCDs.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!