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
katrin2010 [14]
3 years ago
11

Write code that will copy the contents of the file into an array. You can assume that the file will only have 5 data values

Computers and Technology
1 answer:
SpyIntel [72]3 years ago
8 0

Answer:

Explanation:

The following code is written in Java. It is a function that reads the file in the URL that is given in the parameter. It then places the file into a String and assumes that each element is separated by a space (" "). It then loops through that string adding each element into the created local ArrayList. Finally, It prints the contents of the ArrayList and returns the ArrayList.

public static ArrayList<String> toArray (String file) throws IOException {

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

               BufferedReader reader = new BufferedReader(new FileReader(file));

               String readFile = reader.readLine();

               reader.close();

               for (int x = 0; x < readFile.length(); x++) {

                       int start = 0;

                       if (readFile.charAt(x) == ' ') {

                               myArr.add(readFile.substring(start,x));

                               start = x + 1;

                       }

               }

               for (String x : myArr) {

                       System.out.println(x);

               }

               

               return myArr;

       }

You might be interested in
Alison is having a hard time at work because her Inbox is flooded with emails every day. Some of these emails are unsolicited. S
EastWind [94]

Answer:

create another email for a buisness and private/personal. important emails will go to her personal while junk and un needed emails will go to the buisness

Explanation:

8 0
4 years ago
Read 2 more answers
During the installation of Windows Server 2019 Standard Edition, you encounter a disk that is marked as Disk 0 Unallocated Space
sp2606 [1]

There are different kinds of system software.  What should you do to complete the installation on this disk is to Create a new partition and then perform the installation

<h3>How are Hands-On Projects done?</h3>

This kind of project are often  completed in the right order that they were given and it often take about three hours or less to complete it in general. This projects needs:

• A system that has Windows Server 2019 that is said to be already installed based on  Hands-On Project 1-1/1-2.

• A Windows Server 2019VM2 virtual machine  also installed based  on Hands-On Project 3-5.

Note that when one wants to install an operating system, one has to  drive or make partition available so as to copy all the files..

During the installation of Windows Server 2019 Standard Edition, you encounter a disk that is marked as Disk 0 Unallocated Space on the Windows Setup wizard.

What should you do to complete the installation on this disk?

Create a new partition and then perform the installation

Load the device drivers for the Disk

Click Next to proceed with the installation

Format the disk using the Format option

Learn more about Windows Server from

brainly.com/question/25554117

6 0
2 years ago
A city-wide wireless network is an example of which type of network?<br> CAN<br> MAN<br> WAN<br> WMN
poizon [28]

Answer:WAN

Explanation:

This means Wide Area Network. It is a combination of about two local area networks designed to serve a large geographical area such as a city.

4 0
3 years ago
Which of the following statements regarding EFT is false? EFT still requires the endorsement of a check EFT allows payment to be
hammer [34]

A smart way of moving money from one personal banking account directly to another account is called EFT or electric fund transfer. There is a maximum clearance time of 24 hours for transfer.  The most widely-used program is Direct Deposit, in which payroll is deposited straight into an employee's bank account initiated through an electronic terminal, including credit card, Therefore, the following<span> statement regarding EFT is false?</span>

<span>1.                  </span><span>EFT still requires the endorsement of a check </span>

3 0
3 years ago
Where on a computer is the operating system generally stored?
Brilliant_brown [7]

The operating system on a computer is generally stored at hard disk.

4 0
3 years ago
Other questions:
  • TO COMPUTING IN BUSINE
    14·1 answer
  • Define a function below, get_subset, which takes two arguments: a dictionary of strings (keys) to integers (values) and a list o
    8·1 answer
  • What systemctl command configures a unit to start the next time the computer boots?
    10·1 answer
  • Anyone else getting 502 bad gateway on here?
    7·1 answer
  • What does the CFO of a company do
    14·1 answer
  • Which of the following describes a characteristic of organic light-emitting diodes (OLEDs) used in clothing?
    6·2 answers
  • Which of the following BEST describes the part of video or movie creation during which filming occurs, digital modelers create a
    9·2 answers
  • Do companies speed up internet when you run speed test
    13·1 answer
  • 3. What of the following is the main components of computer system?
    9·2 answers
  • Accessibility is the degree to which a product or service is readily available and usable by _____.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!