Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Assignment 3 - Introduction to Software Development with C++ | CSE 1502, Assignments of Computer Science

Material Type: Assignment; Class: Intro Sftwr Dev w/C++; Subject: Computer Sciences; University: Florida Institute of Technology; Term: Spring 2005;

Typology: Assignments

Pre 2010

Uploaded on 08/01/2009

koofers-user-9k3-1
koofers-user-9k3-1 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSE 1502 Spring 2005
Introduction to Software Development with C++
Instructor: Venkatesh Ramamoorthy
Assignment 3 (Turn in by FRIDAY 04-Mar-2005)
1. Write a program which inputs N followed by a set of N integers {x1, x2, x3, ... xN}, and
outputs the average A and the variance V of the set, given by:
xi
A =
N
xi2 – NA2
V =
N – 1
where the sum takes on the numbers from x1 to xN.
Inputs
The number of integers N. Your input prompt should appear as “Enter the
number of integers:
The N integers, x1, x2, x3 xN. In order to read each of these, your input
prompt should repeatedly appear as: “Enter integer”. Each input prompt
should appear on a new line.
Validations
Can you figure out what validations should be done on each input listed
above?
Outputs
Your outputs A and V should appear along with the following prompts:
Average = (average)
Variance = (variance)
For example, if the average is 100 and the variance is 2.75, then these outputs
should appear as follows:
Average = 100
Variance = 2.75
Test Values
For a sample of 10 observations, namely, {40, 83, 48, 61, 40, 45, 42, 44}, the
average A should display 50.375 while the variance should display 219.70.
pf2

Partial preview of the text

Download Assignment 3 - Introduction to Software Development with C++ | CSE 1502 and more Assignments Computer Science in PDF only on Docsity!

CSE 1502 Spring 2005 Introduction to Software Development with C++ Instructor: Venkatesh Ramamoorthy Assignment 3 (Turn in by FRIDAY 04-Mar-2005)

  1. Write a program which inputs N followed by a set of N integers {x 1 , x 2 , x 3 , ... xN}, and outputs the average A and the variance V of the set, given by: ∑ xi A = N ∑ xi^2 – NA^2 V = N – 1 where the sum ∑ takes on the numbers from x 1 to xN. Inputs - The number of integers N. Your input prompt should appear as “ Enter the number of integers: ” - The N integers, x 1 , x 2 , x 3 … xN. In order to read each of these, your input prompt should repeatedly appear as: “ Enter integer ”. Each input prompt should appear on a new line. Validations - Can you figure out what validations should be done on each input listed above? Outputs - Your outputs A and V should appear along with the following prompts: Average = (average) Variance = (variance) For example, if the average is 100 and the variance is 2.75, then these outputs should appear as follows: Average = 100 Variance = 2. Test Values - For a sample of 10 observations, namely, {40, 83, 48, 61, 40, 45, 42, 44}, the average A should display 50.375 while the variance should display 219.70.

Project Name This assignment should be submitted in the Project Name assignment File Name Please turn in your .cpp file saved as assignment03.cpp Notes

  • Ensure that the variable names are user-friendly. For example, do not name the average as A and the number of observations as N (or n ).
  • Watch out for the validations.