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
Which of the following phrases describes top-down processing
soldier1979 [14.2K]

Answer:

B. The effect that our experiences and expectations have on perception

Explanation:

Top-down processing refers to how our brains make use of information that has already been brought into the brain by one or more of the sensory systems. Top-down processing is a cognitive process that initiates with our thoughts, which flow down to lower-level functions, such as the senses.

Top-down processing is when we form our perceptions starting with a larger object, concept, or idea before working our way toward more detailed information. In other words, top-down processing happens when we work from the general to the specific—the big picture to the tiny details.

5 0
3 years ago
Unlike images, tex and hyperlinks, vidoes _____ A) are playable in source view B are not used to affect user's emotions C) can b
KATRIN_1 [288]

Answer:

this is a tough question but I suggest that you choose c)

7 0
4 years ago
Which of the following assumes that the repair will happen just as the technician stated?
kipiarov [429]
A (filling out carachts
3 0
3 years ago
How many types of string types does python support?​
Andru [333]

Answer:

47

Explanation:

they support all of them,more their babies and offspring

7 0
3 years ago
My mom hid my laptop and now I can't find it​
Svetach [21]

Answer: did you look everywhere ask for it and be like mom i wont do (whatever you did) ever again so please give me a chance can i plsss!!!!!! have it back?

Explanation:

simple as that step by step

3 0
3 years ago
Other questions:
  • Windows domain policy to disable windows 10 update
    7·1 answer
  • "Two technicians are discussing FWD driveshaft service. Technician A says that removal of the driveshaft usually requires partia
    15·1 answer
  • Describe a way in which a badly-designed or badly-constructed STRUCTURAL subsystem might impact the PROPULSION subsystem.
    5·1 answer
  • Rerouting traffic using arp poisoning is an attack on ________ of a network.
    8·1 answer
  • Explain the difference between invention and innovation?
    13·1 answer
  • Choose the accurate answer from the drop-down choices.
    11·1 answer
  • Mingji is working to transfer photos from her digital camera to her computer. While
    11·1 answer
  • Which of the following should you press to insert a non-
    8·2 answers
  • Why is computer called information processing machine ?????​
    6·2 answers
  • Which coding manual contains three to seven character codes with a decimal after the third character
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!