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 these converts analog audio signals into digital codes in a computer?
DaniilM [7]
It would either be A. Audio card or D. Sound card but most likely A
6 0
2 years ago
Read 2 more answers
Because of the relative ease of developing new operating systems, a company with significant market power, such as Microsoft, ma
Snezhnost [94]

Answer: this is an example of a contestable market

Explanation: The theory of contestable markets is associated with the American economist William Baumol. In essence, a contestable market is one with zero entry and exit costs. This means there are no barriers to entry and no barriers to exit, such as sunk costs and contractual agreements.  In this case due the competition Microsoft may charge less for    their product so the barrier's trend is to go down.

3 0
2 years ago
Whats worth more in adopt me- A Mega Owl or a Mega Frost Dragon?
serg [7]

Answer:

I think mega frost dragon i d k

Explanation:

6 0
2 years ago
Read 2 more answers
The _____, also known as the system chassis, is a container that houses most of the electronic components that make up a compute
vodka [1.7K]

Answer:

I am pretty sure it is the RSA

Explanation:

7 0
2 years ago
I - For any two points on the Internet, there exists only one path between the two points II - Routing on the Internet is fault
sukhopar [10]

Answer:

I - False

II -True

Explanation:

For any communication between two points on the Internet, routing is to choose an optimum path.

But routing is also fault tolerant and redundant, which means that there are <em>alternative</em> paths to deal with possible problems and provide security during transmission.

4 0
3 years ago
Other questions:
  • Which option will enable Mina to apply several formats to the spreadsheet cells at the same time?
    5·1 answer
  • Most manual-transmission vehicles use a _______ to gauge engine speed in RPMs. A. variable valve timer B. tachometer C. torque i
    11·1 answer
  • What information medium is used to access information from the Internet in the form of HTML pages?
    12·1 answer
  • Why does everyone refer to dogs as being loyal
    11·2 answers
  • Cindy visits her favorite website on a lunch break using a hospital computer. After she downloads a file, she notices that the c
    7·1 answer
  • Which of the following is the BEST solution to allow access to private resources from the internet?
    9·1 answer
  • There's an App for That!
    5·1 answer
  • We cannot imagine a life without the Internet. Imagine that you had to live without being connected to the Internet. Discuss the
    9·1 answer
  • What ribbon command on the home tab can you use to change a cell fill color
    5·2 answers
  • __________ are very simple devices that connect network components, sending a packet of data to all other connected devices.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!