We have been working very hard since 2009 to facilitate in your learning Read More. We can't keep up without your support. Donate Now.

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More

 

Question:                                                                        

Write a program that computes the average and standard deviation of the text floating point numbers in a file. Use the following formulas for the average and the standard deviation of N values. The formulas compute the sum, the sum of squares, the average, the average square, the variance, and finally, the standard deviation.

sum = x1 + x2  + x3 + ... + xN-1 + xN

 

sumSQ = x12 + x22  + x32 + ... + xN-12 + xN2

 

avg = sum/N

 

avgSQ = avgSQ/N

 

var = avgSQ - avg2

 

sd  = var(1/2)

The input file will contain any number text floating point numbers, similar to the following:

10.5

12.9

9.67

12.05

8.23

10.08

10.23

7.7

10.4

11.34

Numbers could be several, or none per line, and negative numbers are perfectly OK.

 

Note: All the source code should be written manually. Your code must justify enough for 15 marks.

 

 

Lectures Covered: This assignment covers Lecture # 01-09

Deadline

Your assignment must be uploaded/submitted at or before 31/10/2011.          

 


+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)


Views: 3937

Attachments:

Replies to This Discussion

Upload Solution File

Myspace text generator

kashif u have Solution ? if yes please share here

Nai brother mere pass solution nai hay ,,,,,,, Still trying to solve ....

any body reply time is short  please reply hurry.........................

yar kisi say b nai bani abi tak? me say yar data file say nikal nai raha file say nikal jai to assignment bn gae

try ho rahi hy ab dekhen

new modified assignment has been uploaded by our teacher.

new modified formula

 

avgSQ = avgSQ/N  ---- goes to  avgSQ = sumSQ/N

please not

Brother MT sh this is right formula donot Worry

 

mateen Brother during the execution of the code input file not found ka error a raha ha where should be the input file copied.

 

import java.io.*;

public class Assignment1 { public static void main(String args[]){

FileReader fr=null;

BufferedReader br=null;

try{ fr=new FileReader("input.text");

br=new BufferedReader(fr);

String s=br.readLine(); while(s!=null); {

System.out.println(s);

s=br.readLine();}

br.close();

fr.close(); }

catch(IOException ioex){

System.out.println(ioex); }

}
}

  • File not found ka message print ho raha ha kase thek ho ga

RSS

Looking For Something? Search Here

Today Top Members 

HELP SUPPORT

This is a member-supported website. Your contribution is greatly appreciated!

© 2020   Created by +M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.