Lab 4 - lab4CS101 October 30, 2007 1 Objectives Method...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
lab4–CS101 October 30, 2007 1 Objectives Method declaration and invocation Math class Loops and selection control 2 Lab description In this lab assignment, you are going to implement a set of methods, each of which is for solving a given task. The requirement of each methods is below. In the main method, you shall write code to get user input and call each of the following method. Please Fnd some test cases for each method to test their correctness. 2.1 method1 In business applications, you are often asked to compute the mean and standard deviation of data. Please write a method that generate ten random numbers between 0 and 1000, including both 0 and 1000, and computes the mean and standard deviations of these numbers using the following formula: mean = n i =1 x i n = x 1 + x 2 + ... + x n n (1) deviation = r R R ± n i =1 x 2 i - ( n i =1 x i ) 2 n n - 1 (2) The prototype of the method is public static void meanDeviation()
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/29/2008 for the course CS 101L taught by Professor Vineyard during the Fall '07 term at Kettering.

Page1 / 2

Lab 4 - lab4CS101 October 30, 2007 1 Objectives Method...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online