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 is likely the cause of the bass from a sound system rattling the windows on your car?
Andrei [34K]
The vibration of the sound system
4 0
2 years ago
To display the size of your backup file, you can use the Windows program called: Windows Explorer Scan disk Defrag Windows Acces
Nitella [24]
Windows Explorer scan disk
7 0
2 years ago
What is an allocation unit?
sdas [7]
It is a unit of disk space allocation for files and directories. Hope this helps :) 
5 0
3 years ago
you have been tasked with configuring a digital information station in the office's lobby. guests will be able to use the statio
REY [17]

The most important security consideration for the station is code signing. With code signing, consumers may feel confident about the software they are downloading and can stop worrying about infecting their computer.

With code signing, consumers may feel confident about the software they are downloading and can stop worrying about infecting their computer or mobile device with malware. Code signing has grown in importance for software developers and distributors as more software may be downloaded from the Internet.

Malware can be easily installed on a victim's computer by an attacker who poses as a trustworthy source. As long as users only download software that is regarded as safe by their operating system, code signing ensures that these types of assaults cannot happen.

Nowadays, the Operating System looks for the digital certificate produced through code signing when software is downloaded onto a computer to ensure the security of the software being installed. The user is informed and given the option to stop or continue the installation if no digital certificate is detected.

To know more about code signing click here:

brainly.com/question/28860592

#SPJ4

3 0
8 months ago
Employees are one of the main contributors to cybersecurity breaches because of _____? Select 3 options.
Tema [17]

Answer: inattention, lack of knowledge, and negligence.

Explanation: employees are often the cause of workplace incidents because they may be unknowledgeable about security protocols, negligent, or simply make a mistake.

5 0
2 years ago
Other questions:
  • Para saan po yung points dito?
    15·1 answer
  • Write a program that will askthe user to enter the amount of a purchase. The program should thencompute the state and county sal
    5·1 answer
  • Is anyone really good at immerse 2 learn??
    9·1 answer
  • What term refers to a device or software system that collects environmental information and makes independent decisions.
    6·1 answer
  • i have a class for computers and i need a free hardrive are there any websites that give me one for free in 3 days??​
    15·1 answer
  • Which type of storage disk and disk drive can you use in the given situation?
    12·1 answer
  • Consider the following static method.
    9·1 answer
  • Computers that are joined together are called networks true or false
    10·1 answer
  • The residual volume can be measured directly with: Select an answer and submit. For keyboard navigation, use the up/down arrow k
    12·1 answer
  • Content area a leased asset will appear on the balance sheet as a long-term asset. true false'
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!