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 what form do the hexadecimal numbers need to be converted for a computer’s digital circuit to process them?
MrMuchimi

Hexadecimal numbers are just a convenient representation of binary data. When entered as text, they consist of ASCII characters 0-9 and a-f. The numbers will then have to be converted to binary. This is accomplished by converting to uppercase, subtracting the ASCII offset (48 for 0-9 or 55 for A-F), so that the result is a number between 0 and 15 (inclusive). This can be stored in computer memory to represent 4 bits.

Hexadecimal numbers represent binary numbers in the following way:

hex | binary

0 = 0000

1 = 0001

2 = 0010

3 = 0011

4 = 0100

5 = 0101

6 = 0110

7 = 0111

8 = 1000

9 = 1001

a = 1010

b = 1011

c = 1100

d = 1101

e = 1110

f = 1111

As you can see, no other 4 bit combination exists.



5 0
3 years ago
The Department Manager researches new data platforms for the company and requests a list of essential features. Which essential
Ipatiy [6.2K]

Answer:

Centralisation

dashboard , programmatic access

Explanation:

hope it helps u

mark me as brainlist

4 0
3 years ago
Help me asap ill give brainliest
kobusy [5.1K]

Answer:

Give me brainliest thanks

6 0
3 years ago
5. A Disk defragmenter tool does what to a computer HDD?
Ivenika [448]

Answer:It rearranges the files on a hard drive to get quicker access to them.

5 0
2 years ago
Write the definition of a method printDottedLine, which has no parameters and doesn't return anything. The method prints to stan
Bond [772]

Answer:

public static void printDottedLine()

{

  System.out.println(".....");

}

Explanation:

The above written code is in JAVA and it is the method definition of the method mentioned in the question.Since the method returns nothing hence it's return type is void and it does not have any arguments hence there is nothing written in the parenthesis.In JAVA System.out.println is used for standard output and trminates them by newline.

3 0
3 years ago
Other questions:
  • Suppose you have an int variable called number. What Java expression produces the second-to-last digit of the number (the 10s pl
    13·1 answer
  • When people talk about "the media," they often mean:?
    6·1 answer
  • A coworker asks your opinion about how to minimize ActiveX attacks while she browses the Internet using Internet Explorer. The c
    14·1 answer
  • A user calls to report that she is experiencing intermittent problems while accessing the wireless network form her laptop compu
    9·1 answer
  • In an array based implementationof a queue a possible solution to dealing with the full condition is to
    14·1 answer
  • Which do switches create?<br> Networks<br> Wireless access points<br> Routes<br> Collision domains
    13·1 answer
  • ______ are used to store all the data in a database.
    7·1 answer
  • Implement a program that manages shapes. Implement a class named Shape with a method area() which returns the double value 0.0.
    15·1 answer
  • You decide to test an audio clip that you have inserted into your presentation, but before you do that you make sure that the co
    6·1 answer
  • What option can be used by a system administrator to ensure that dynamic updates are made only by known clients when you have a
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!