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
Luden [163]
3 years ago
13

Algorithm for arithmetic mean program

Computers and Technology
1 answer:
slega [8]3 years ago
3 0
<span>For integers, we can perform all the basic arithmetic operations such as addition, ... In a computerprogram however, it means "take x, multipy it by itself, and assign the ..... Exercise: Write a C++program that implements Euclid's algorithm.</span><span>please mark me as brainleist answer</span>
You might be interested in
Write a RainFall class that stores the total rainfall for each of 12 months into an array of doubles. The program should have me
RSB [31]

Answer:

Explanation:

The code provided worked for the most part, it had some gramatical errors in when printing out the information as well as repeated values. I fixed and reorganized the printed information so that it is well formatted. The only thing that was missing from the code was the input validation to make sure that no negative values were passed. I added this within the getMonths() method so that it repeats the question until the user inputs a valid value. The program was tested and the output can be seen in the attached image below.

import java.io.*;

import java.util.*;

class Rainfall

{

   Scanner in = new Scanner(System.in);

   private int month = 12;

   private double total = 0;

   private double average;

   private double standard_deviation;

   private double largest;

   private double smallest;

   private double months[];

   public Rainfall()

   {

       months = new double[12];

   }

   public void setMonths()

   {

       for(int n=1; n <= month; n++)

       {

           int answer = 0;

           while (true) {

               System.out.println("Enter the rainfall (in inches) for month #" + n + ":" );

               answer = in.nextInt();

               if (answer > 0) {

                   months[n-1] = answer;

                   break;

               }

           }

       }

   }

   public void getTotal()

   {

       total = 0;

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

       {

           total = total + months[i];

       }

       System.out.println("The total rainfall for the year is " + total);

   }

   public void getAverage()

   {

       average = total/12;

       System.out.println("The average monthly rainfall is " + average);

   }

   public void getLargest()

   {

       double largest = 0;

       int largeind = 0;

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

       {

           if (months[i] > largest)

           {

               largest = months[i];

               largeind = i;

           }

       }

       System.out.println("The largest amount of rainfall was " + largest +

               " inches in month " + (largeind + 1));

   }

   public void getSmallest()

   {

       double smallest = Double.MAX_VALUE;

       int smallind = 0;

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

       {

           if (months[n] < smallest)

           {

               smallest = months[n];

               smallind = n;

           }

       }

       System.out.println("The smallest amount of rainfall was " + smallest +

               " inches in month " + (smallind + 1));

   }

   public static void main(String[] args)

   {

       Rainfall r = new Rainfall();

       r.setMonths();

       r.getTotal();

       r.getSmallest();

       r.getLargest();

       r.getAverage();

   }

}

8 0
2 years ago
domain controllers store local user accounts within a sam database and domain user accounts within active directory. true or fal
Natalka [10]

Answer:

True

Explanation:

The domain controller is a server that responds within windows server domains to request for security authentication. It enforces security for windows and they are useful for storing the account information of users, that is local users within a Security Account Manager. Therefore the answer to this question is true.

Thank you!

5 0
2 years ago
Answer for a, b, and c
Darya [45]

The answer is a. im pretty positive but if im wrong super sorry

5 0
3 years ago
When double quotes are used to assign values to string variables, the PHP interpreter must check the entire string to see if it
NikAS [45]

Answer:

Interpolation string.

Explanation:

The proces of adding the variable in middle the string.The interpolation  Replace the value of the Variable when the string data is processed .In the Interpolation process  the variable is permitted with string containing double quotes.In the interpolation string  the interpreter check the entirely string that  the variable in middle the string.

Following is the example of interpolation string in Php

$n1 = "RAM";

echo "hello $name"; // output

Output:

hello RAM

6 0
3 years ago
Process is useful for a quick turnaround in game development?
aleksley [76]
Rapid prototyping as it allows the production of a functional program in a short time
7 0
3 years ago
Read 2 more answers
Other questions:
  • Wireless network devices use ________ to communicate with each other.
    9·2 answers
  • Which type of interview is conducted in a format where the interviewee is questioned and presented to a panel of individuals?
    7·2 answers
  • Where Can you find 2tickets Universal Studios Horror night
    10·2 answers
  • You need to design a backup strategy. You need to ensure that all servers are backed up every Friday night and a complete copy o
    6·1 answer
  • . Write a toString method for this class. The method should return a string containing the base, height and area of the triangle
    10·1 answer
  • How do you know where the home row of the keyboard is?
    14·2 answers
  • What is a Forloop and what is it used for?
    7·2 answers
  • Whats with the bot spamming customer care numbers...kinda annoying when im trying to help people.
    12·1 answer
  • Buying the newest phone as soon as it is released when your current phone works perfectly is not a good idea for all but which o
    10·2 answers
  • URGENT HELPP<br> WILL MARK BRAINLIST
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!