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
natali 33 [55]
4 years ago
6

"The main program will call a series of methods to process a set of data. One method will read data into an array. A second meth

od will print the values stored in an array in a neat format. Another method will find the average of the values stored in an array. A fourth method will construct a new array from an existing array."
Computers and Technology
1 answer:
saw5 [17]4 years ago
4 0

Answer:

Check the explanation

Explanation:

import java.util.*;

import java.io.File;

public class Main

{

 

public static void main(String[] args) {

           

double[] second = new double[10];

double[] arr = new double[10];

arr = readData(10,arr);

     

System.out.println("here is the original array");

     

printArray(3,arr);

double avg = findAverage(5,arr);

System.out.println("The avearage value is" + avg);

System.out.println("here is the new array");

     

second = howFarAway(9,avg,arr,second);

     

printArray(3,narr);

     

avg = findAverage(5,narr);

System.out.println("The avearage value is" + avg);

 

}

public static double[] readData(int n,double[] numbers)

  {

 

      File file = new File("number.txt");

Scanner fileScanner = new Scanner(file);

      for(int i=0; i<n; i++)

          numbers[i]=fileScanner.nextDouble();

 

  return numbers;

 

  }

 

public static void printArray(int q, double[] numb)

 

  {

 

      for(int i=0;i<numb.length;i++)

 

      {

 

          System.out.print(numb[i]);

          System.out.print(" ");

 

          if((i+1)%q==0)

              System.out.println("");

 

      }

  }

 

public static double findAverage(int k ,double[] p)

 

  {

  double s=0;

 

  for(int i=0;i<k;i++)

  s = s+p[i];

 

  return s/k;

 

  }

public static double[] howFarAway(int m,double avg,double[] arr,double[] narr)

 

  {

 

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

  narr[i]=arr[i]-avg;

 

      return narr;

 

  }

}

You might be interested in
Where was this taken
Korolek [52]

Answer:

Mostar city

Explanation:

look at the architecture

6 0
3 years ago
Read 2 more answers
What is a curson?
sp2606 [1]

Answer:

C. Blinking vertical line on your screen

Explanation:

A cursor is tha blinking vertical line on your screen.

5 0
4 years ago
Write the following functions. Each function needs function comments that describes function and its parameters double sphereVol
luda_lava [24]

Answer:

Output

height: 10

radius: 2

Cylinder volume: 125.6

Cone Surface: 76.6037

Cone Volume: 41.8667

Sphere volume: 33.4933

Sphere surface: 50.24

Cylinder volume: 125.6

Explanation:

//Declaring variables

#include <iostream>

#include <cmath>

using namespace std;

//Defining Pi value

const double PI=3.14;

//Decliring the functions

//volume function for cone

double volumeCone(double r,double h){

       return  PI * r * r  * (h/3);

}

//volume function for sphere surface

double surfaceSphere(double r){

       return 4 * PI  * r * r;

}

//volume function for cylinderVol

double cylinderVol(double r,double h){

       return  PI * r * r * h;

}

//volume function for sphere volume

double sphereVol(double r){

       return 4/3.0 * PI * r * r * r;

}

//volume function for cone surface

double surfaceCone(double r,double h){

       return  PI * r * (r+sqrt(h *h + r  * r));

}

int main(){

       double r,h;

//print the values of height and radius

       cout<<"height: ";

       cin>>h;

       cout<<"radius: ";

       cin>>r;

//print the values of geometric forms

       cout<<"Cylinder volume: "<<cylinderVol(r,h)<<endl;

       cout<<"Cone Surface: "<<surfaceCone(r,h)<<endl;

       cout<<"Cone Volume: "<<volumeCone(r,h)<<endl;

       cout<<"Sphere volume: "<<sphereVol(r)<<endl;

       cout<<"Sphere surface: "<<surfaceSphere(r)<<endl;

       cout<<"Cylinder volume: "<<cylinderVol(r,h)<<endl;

       

       

}

4 0
3 years ago
BRAINLIEST A compact disc stores information on a plastic ______________________________ with billions of pits? 100PTS
Cloud [144]

Answer:

area

Explanation:

7 0
3 years ago
Read 2 more answers
What is the minimum score for the dmv test?
Naddika [18.5K]
You can only get 6 wrong of the 30 questions.
3 0
4 years ago
Read 2 more answers
Other questions:
  • Create a class called Name that will have three fields first name, middle initial, and last name as parameters. Add a constructo
    15·1 answer
  • I want to know why almost every single "expert answer verified" thing I come across is wrong. If it's wrong, why the h is it exp
    8·2 answers
  • A network that typically reaches a few meters, such as up to 10 meters (33 feet), and consists of personal devices such as mobil
    14·1 answer
  • A half-life is the amount of time it takes for a substance or entity to fall to half its original value. Caffeine has a half-lif
    6·1 answer
  • When workers demonstrate patience, are able to manage there emotions, and get along with other employees, which skills are being
    11·2 answers
  • How would you define media literacy?
    12·1 answer
  • Which programming language represents data in the form of a series of zeros and ones​
    7·1 answer
  • Need answer ASAP. I’ll mark brainliest if correct
    10·1 answer
  • Isla is writing a report on the best roller coasters in America. Which device could help her with this?
    14·1 answer
  • Service-oriented architecture includes "reuse." Which of the following is a description of why a business finds it useful? Using
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!