Sunday, 05 20th

Last update09:44:47 AM

Login With Facebook

Combinestudy

CS506 Fall 2011 First Assignment

Assignment No. 01
SEMESTER Fall 2011
CS506- Web Design and Development

Total Marks: 15

Due Date: 31/10/2011

Instructions

Please read the following instructions carefully before solving & submitting assignment:

It should be clear that your assignment will not get any credit (zero marks) if:

  1. The assignment is submitted after due date.
  2. The submitted assignment does not open or file corrupt.
  3. The assignment is copied (from other student or ditto copy from handouts or internet).
  4. Student ID is not mentioned in the assignment File or name of file is other than student ID.

Uploading instructions

Your Submission must include:

  1. All the Source Code (.java files) and other if necessary files to compile and run your program.
  2. If and only if there are multiple files to submit place all the files in a Zip file and Upload it on VULMS else only source code file is required to be submitted.

Note: Use Notepad for coding and JDK package for java source code compilation and running (JDK is also available on download section of VULMS)

Objective

The objective of this assignment is

 

  1. To give you some practice exercise of File Handling and understanding use of it.

For any query about the assignment, contact at cs506@vu.edu.pk

GOOD LUCK 

Marks: 15

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 = sumSQ/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.





upload assignment
Upload your Solution