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
In excel, a number can contain the characters__
KATRIN_1 [288]
Comma and period? You can have numbers like 123,456.78
7 0
3 years ago
Conner has located a research source that is sponsored by a pharmaceutical company. Based on the sponsorship, Conner must be car
gogolik [260]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct answer is:

Conner has located a research source that is sponsored by a pharmaceutical company. Based on the sponsorship, Conner must be careful that the information is not <u>Biased.</u>

<u></u>

When you evaluate and use information from multiple sources, you need to evaluate the information that it must be error-free and not biased and it should be accurate information as you needed.

As in this example, Conner needs to research that the information should not be biased because the information or research source is sponsored by a pharmaceutical company and there is chances of biasedness. So, Conner must be careful that information is not biased.

6 0
3 years ago
Tim is in charge of the upcoming interschool baketball tournamnent. He wants to arrange all of the teams and their members in al
zalisa [80]
I think the answer is C.
7 0
3 years ago
Which of the following is not a technology that can be used to conserve resources?
amm1812
<span>Natural gas when extracted through human industry will utilise resources to construct the necessary plant and machinery and then result in the consumption of a resource. Therefore this is the technology that cannot be seen as conserving resources.</span>
6 0
3 years ago
Read 2 more answers
What is the most significant result based on the development of windmills and water wheels?
daser333 [38]
Power both wind mills and water wheels produced power which was used for textile factories ect
6 0
3 years ago
Other questions:
  • 1. Create an array of ints with 20 elements. With a random number generator, seeded with time, assign a random number between 1
    8·1 answer
  • What is NOT an issue associated with tag management systems? There is no automation available for tag management systems. Managi
    5·1 answer
  • A _________ is automatically launched by some trigger and appears in front of the active window
    12·1 answer
  • Select the characteristics that describe the evolution of computers that predate the personal computer (select all correct answe
    12·1 answer
  • A(n) _____ is a firm that delivers a software application, or access to an application, by charging a usage or subscription fee.
    6·1 answer
  • Find the number of times a value appears in a list, and create a new list that contains the index positions where the value occu
    6·1 answer
  • Why is it better for a CPU to have more than one cache?
    6·2 answers
  • How do i delete cookies on a chromebook?
    8·1 answer
  • St. CHarles school's music community is organizing a fundraiser. They want to create a simple but attractive website. However, t
    7·1 answer
  • 9.18 lab: even/odd values in a vector write a program that reads a list of integers, and outputs whether the list contains all e
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!