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
Naya [18.7K]
3 years ago
6

CS124 PRATCTICE

Computers and Technology
1 answer:
Levart [38]3 years ago
6 0

Answer:

b

Explanation:

You might be interested in
Write a program that accepts a file name from the command line, then initializes an array with test data using that text file as
postnew [5]

Answer:

Complete code is given below:

Explanation:

import java.io.BufferedReader;

import java.io.FileNotFoundException;

import java.io.FileReader;

import java.io.IOException;

import java.util.Arrays;

import java.util.Scanner;

public class ArrayCalcs {

private int size;

String [] parts =null;

// based on number of elements in file, array will create.

double[] arr=null;

public void readFile(String file){

try{

FileReader fr = new FileReader(file+".txt");

BufferedReader br = new BufferedReader(fr);

String line = br.readLine();

int count = 0;

while (line != null) {

parts = line.split(" ");

for( String w : parts)

{

count++;

}

line = br.readLine();

}

size=count;

arr=new double[size];

for(int i=0;i<size;i++){

arr[i]=Double.parseDouble(parts[i]);

}

// System.out.println(count);

// System.out.println(Arrays.toString(parts));

System.out.println(Arrays.toString(arr));

} catch (FileNotFoundException ex){

System.out.println("This file does not exist");

} catch (IndexOutOfBoundsException e){

System.out.println("Thie file has more than 7 lines");}

catch (IOException e) {

System.out.println(e.getMessage());

}

}

public double getTotal(){

double sum=0.0;

for(double d:arr){

sum=sum+d;

}

return sum;

}

public double getAverage(){

double avg=getTotal()/arr.length;

return avg;

}

public double getHighest(){

double high=arr[0];

for(int i=0;i<arr.length-1;i++){

if(arr[i] > high)

high = arr[i];

}

return high;

}

public double getLowest(){

double low=arr[0];

for(int i=0;i<arr.length-1;i++){

if(arr[i] < low)

low= arr[i];

}

return low;

}

public static void main(String[] args) {

Scanner s = new Scanner(System.in);

System.out.println("Enter file name:");

String file=s.next();

ArrayCalcs ac=new ArrayCalcs();

ac.readFile(file);

System.out.println(" Highest Element: "+ac.getHighest());

System.out.println("Lowest Element: "+ac.getLowest());

System.out.println("Total: "+ac.getTotal());

System.out.println("Average: "+ac.getAverage());

}

}

4 0
3 years ago
What is a collection of data that is stored in a computer system
Vitek1552 [10]
0 and 1's are stored in a computer which is converted into a electric signal that goes to the screen and keyboard which sends a signal back<span />
4 0
3 years ago
Read 2 more answers
Xor meaning in computer science
Jlenok [28]

<h2>eXclusive OR</h2>

<h3>✅X. (eXclusive OR) A Boolean logic operation that is widely used in cryptography as well as in generating parity bits for error checking and fault tolerance. XOR compares two input bits and generates one output bit. The logic is simple. If the bits are the same, the result is 0.</h3>
8 0
3 years ago
Read 2 more answers
Whereas enterprise network convergence focuses on the consolidation of traditionally distinct voice, video, and data communicati
Vinil7 [7]

Answer: Unified communication

Explanation: Unified communication is the communication technique in which merges various communication routines into a individual business.It works as the phone system which helps in increment of productivity in an organizational business.

The unifying of voice,data/information,video etc is done for optimizing and improving the business that also results in  faster communication rates, secure communication etc.

4 0
3 years ago
List the actual network numbers for each of these subnets. (If the list is longer than 16, simply list the first 3 and final 3 "
Andre45 [30]
69 is the answer because I know or it could be 430
3 0
3 years ago
Other questions:
  • TCP waits until it has received three duplicate ACKs before performing a fast retransmit. Why do you think the TCP designers cho
    13·1 answer
  • you want to search in your contacts in your email program. You enter the person's first name and last name in the search box. Yo
    8·1 answer
  • To use the Web, each client computer requires a data link layer software package called a Web browser. True False
    8·1 answer
  • One of the disadvantages of Audacity is that it has limited technical support since it is a free program.     true or false
    11·2 answers
  • 15. In cell D6, enter a formula to calculate the percentage of High Priority Customers Sales out of All Customers 2016 sales. (T
    11·1 answer
  • It is possible to collaborate on a presentation with a group of people using the Internet.
    14·1 answer
  • An F-1 ____________ may be authorized by the DSO to participate in a curricular practical training program that is an__________
    8·1 answer
  • What are the ten application areas of computer?​
    10·1 answer
  • Test unit 8 edhesive answers ​
    15·1 answer
  • Joining a computer to active directory involves joining the computer to a workgroup. True or false.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!