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
Kellyn needs to move Slide 8 of his presentation up so that it becomes Slide 6. What best describes how he can do this using the
sattari [20]
Hold down the slide until the slide pops up then drag slide to the sixth position then drop slide into sixth postition to affirm its position
5 0
4 years ago
What is this I’m so lost
Inga [223]
It is C or multi view since it is looking at the object from multiple sides as perspective

It is not assembly (A) since it is not showing how to put it together, it is not section(C) because it isn’t a chopped up piece of it and it is not exploded (D) because exploded is kinda like assembly where all components are separated and this picture isn’t so. It is C since it is simply showing the view from the top, side, and back
8 0
3 years ago
A. true
satela [25.4K]
The answer to this question would be false. Both one and two dimensional arrays can only hold data of a single data type. For example, a two dimensional array would never be able to contain some data of type int and some data of type String.

I hope this helps.
3 0
3 years ago
Software is the word for:
Bad White [126]
The answer is B. And Incase you were wondering D. Is hardware
5 0
3 years ago
______involves encoding information using fewer bits than the original representation Group of answer choices
stepan [7]

Answer:

The answer is "Data compression".

Explanation:

In the given question some information is missing, that is the option of the question, which can be described as follows:  

a) Data mining.

b) Information theory.

c) Data compression.

d) Image reconstruction.

Data compression is the mechanism, in which the bits arranges the data, that is changed. It encodes data, which needs less space is on the drive. It reduces the information instances and storage capacity, and other choices were wrong, which can be described as follows:

  • In option a, Data mining is used in row data searching, that's why it's not correct.
  • In option b, Information theory is used in communication, that's why it is wrong.
  • In option d, Image reconstruction is used in 3D design, that's why it is wrong.
5 0
3 years ago
Other questions:
  • Write a method that checks whether the input string or a sentence (a string with spaces) is a palindrome or not. The method shou
    13·1 answer
  • Write a program that prints all the numbers from 0 to 6 except 3 and 6. Expected output: 0 1 2 4 5
    13·1 answer
  • Microsoft's
    8·1 answer
  • 1⁰=?<br> Is equal to...........
    12·2 answers
  • A corporation needs an operating system that allows the various teams in its office to network and collaborate on projects. Whic
    10·1 answer
  • Discuss two basic types of monitors CRT and LCD give me in short ​
    9·2 answers
  • Audiovisual means that a presentation combines film and photos.<br> true or false?
    6·2 answers
  • Short notes on Supply chain Management System (SCMS)
    12·1 answer
  • Task #3 Debugging a Java Program
    14·1 answer
  • Which website offers guidance on putting together a checklist to provide guidance on configuring and hardening operating systems
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!