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
mamaluj [8]
3 years ago
9

Complete main() to read dates from input, one date per line. Each date's format must be as follows: March 1, 1990. Any date not

following that format is incorrect and should be ignored. Use the substring() method to parse the string and extract the date. The input ends with -1 on a line alone. Output each correct date as: 3/1/1990. Ex: If the input is:
Computers and Technology
1 answer:
rewona [7]3 years ago
8 0

Answer:

Explanation:

The following code was written in Java it creates a switch statement for all the month values in order to turn them from Strings into integer values. Then it reads every line of input places them into an array of dates if they are the correct input format, and loops through the array changing every date into the correct output format.Ouput can be seen in the attached picture below.

import java.util.ArrayList;

import java.util.Scanner;

class Brainly {

   public static int intForMonth(String monthString) {

       int monthValue;

       switch (monthString) {

           case "January": monthValue = 1;

               break;

           case "February": monthValue = 2;

               break;

           case "March": monthValue = 3;

               break;

           case "April": monthValue = 4;

               break;

           case "May": monthValue = 5;

               break;

           case "June": monthValue = 6;

               break;

           case "July": monthValue = 7;

               break;

           case "August": monthValue = 8;

               break;

           case "September": monthValue = 9;

               break;

           case "October": monthValue = 10;

               break;

           case "November": monthValue = 11;

               break;

           case "December": monthValue = 12;

               break;

           default: monthValue = 00;

       }

       return monthValue;

   }

   public static void main(String[] args) {

       Scanner scnr = new Scanner(System.in);

       ArrayList<String> dates = new ArrayList<>();

       String date;

       String month;

       String day;

       String year;

       int i = 0;

       while (true) {

           date = scnr.nextLine();

           if (date.equals("-1")) {

               break;

           }

           dates.add(date);

       }

       for (i = 0; i < dates.size(); i++) {

           try {

               month = dates.get(i).substring(0, dates.get(i).indexOf(" "));

               day = dates.get(i).substring(dates.get(i).indexOf(" ") + 1, dates.get(i).indexOf(","));

               year = dates.get(i).substring(dates.get(i).indexOf(",") + 2, dates.get(i).length());

               System.out.println(intForMonth(month) + "/" + day + "/" + year);

           } catch (Exception e) {}

       }

   }

}

You might be interested in
The ____ keyword specifies that a function or method does not return a value.
dedylja [7]
The void keyword. Otherwise you use a type name, such as int or char or string.
4 0
3 years ago
My internet works but my router won't let any devices connect to it unless you use a cat. 5 cable :\
katovenus [111]
You would need to get a CAT5 cable, these usually dont cost much, as the manufacturing of these cables is cheaper and more common.

If you mean wireless connectivity, this could be due to your router not supporting wireless, meaning you would have to get a Wireless Access Point
5 0
3 years ago
You want to establish the validity of a test designed for computer technicians using a predictive criterion-related validation s
fgiga [73]

Answer:

(C) people applying for computer technician jobs in your company.

Explanation:

According to my research on information technology, I can say that based on the information provided within the question in order to establish the validity of the test you should give the test to people applying for computer technician jobs in your company. Then examine and compare their score with their job performance if hired.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

6 0
3 years ago
​User documentation _____. Group of answer choices ​allows users to prepare overall documentation, such as process descriptions
MatroZZZ [7]

Answer:

And user documentation consists of instructions and information to users who will interact with the system

Explanation:

user documentation will not allow user to prepare overall documentation because it is already prepared so not A.

user documentation does not need implementation, So not B.

user documentation may not be a printed one . So not C

And user documentation consists of instructions and information to users who will interact with the system, so D is the right option

3 0
3 years ago
The type of power that has the ability to call on connections and networks both inside and outside the organization for support
givi [52]

Answer: c) Connection power

Explanation:

Connection power is the power that is established personally in the field of business.A person having connection with powerful person personally outside or inside the organizational field then he/she can attain the desired goals or result through connecting with them, influencing powerful person's decision, getting their things done etc .

  • Other options are incorrect because association power, information power,coercive power and referent power are the power to establish connection organization to achieved aim.
  • Thus, the correct option is option(c)
5 0
3 years ago
Other questions:
  • To what device, inside the computer, do all other devices connect
    10·2 answers
  • Windows server 2012 r2 supports two types of folder shares. what are those two types?
    6·1 answer
  • A short circuit locator should be periodically run along the cords used in a shop to check for shorts and open circuits. A.)True
    12·2 answers
  • Microsoft Word is ________________ software.
    8·1 answer
  • What is true about content based filtering
    8·1 answer
  • Which term describes an approach to security similar to defense in depth in that it supports multiple layers, but uses a differe
    14·1 answer
  • Project: Math Tutor Program with Error Handling
    9·2 answers
  • What is the most important job of a web server?
    11·2 answers
  • Write the pseudocode for this flowchart
    6·1 answer
  • Which attributes does not come in tag?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!