answersLogoWhite

0

TWO

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do you sum up numbers from 1 to n?

import java.util.Scanner;public class average {static int i=0;static double sum = 0;static double average = 0;public static double calcSum(double sum){double count;Scanner input = new Scanner(System.in);while(i < 5){count = input.nextDouble();sum = sum + count;i++;}return sum;}public static double calcAverage(double average){double sum = calcSum(sum);average = calcSum(sum) / 5;return average;}public static void main(String[] args) {System.out.println("Please enter 5 numbers.");System.out.println("Sum is: "+calcSum(sum));System.out.println("Average is: "+calcAverage(average));}}


Write java program for mean of ten numbers?

// numbers to work with double[] nums = {1, 2, 3, 4.5, 5.5, 6, 7.5, 8, 9, 10}; double sum = 0; // total sum for (int i = 0; i &lt; nums.length; ++i) { sum += nums[i]; } // final average final double mean = (sum / nums.length);


If you add up all of the numbers of a roulette wheel what number would you get?

A roulette wheel has the numbers 1-36 and zero, and sometimes double zero. Zero &amp; double zero sum to 0 The sum of n numbers is 1/2 n(first + last) Sum of numbers of roulette wheel = 1/2 x 36 x (1 + 36) + 0 = 666.


Program to find the sum of harmonic series?

Let's assume that you want the sum of the general harmonic series: sum(n=0,inf): 1/(an+b) Since we know that the harmonic series will converge to infinity, we'll also assume that you want the sum from 0 to n. double genHarmonic(const double n, const double a, const double b) { double sum = 0.0; // perform calculations int k; for(k = 0; k &lt;= n; ++k) { sum += 1.0 / (a * k + b); } return sum; }


Program to find the sum of the series as 1 plus x plus x2 plus x3 plus?

The idea is to use a loop. To reduce the additional effort (and innacuracy) of power calculations, you can do repeated multiplication, as part of the loop. For example, in Java:double sum = 1;double xpower = 1.0;for (int i = 1; i


What is the relationship between the probability of an event and its compliment?

Their sum is 1.Their sum is 1.Their sum is 1.Their sum is 1.


How do you convert a single sigma sum to a double sigma sum?

Multiply sum by 2.


If two fair dice are rolled what is the probability of rolling a double given that the sum was 11?

Let A = rolling a double Let B = sum is 11 P(A)=6/36=1/6 P(B)=2/36=1/18 since (5,6) and (6,5) produce a sum of 11. We want to find P(A/B)= P(A &amp; B) / P(B) = 0 / P(B)=0 P(A &amp; B) represent the event getting a double and the sum being 11.


What is the sum of 1 and 1?

The sum of 1 and 1 is 2.


Math- What does sum mean?

Sum, or summation, is just addition. For example, the sum of 1 and 2 is 1 + 2 = 3. The term "sum" is generally used for large sets or series. For example, the sum of the first 100 natural numbers is 1 + 2 + 3 + ... + 100 = 495. Sum is the total of 2 or more numbers as determined by the math process. Mathematically it means the answer to an addition problem.


What is the sum of prime numbers from 1-1000?

Well, honey, the sum of prime numbers from 1 to 1000 is 76,127. Don't worry, I double-checked it just for you. Now go impress your friends with your newfound prime number knowledge.


How do you Write a java program to find the sum and average of 10 float values?

import java.util.Scanner; public class float_values{ private static double sum = 0, average = 0; public static void main(String[] args){ Scanner reader = new Scanner(System.in); double[] values = new double[10]; for (int count = 0; count &lt; 10; count++){ System.out.println("Enter number " + (count + 1)); values[count] = reader.nextDouble(); } for ( int i = 0; i &lt; values.length; i++){ sum += values[i]; } average = (sum / values.length); System.out.println("The sum of the numbers is " + sum); System.out.println("The average of the numbers is " + average); } }