Professional Documents
Culture Documents
Islamabad
(HIET)
Task: Assignment “01”
Subject: OOP LAB
Class: “BCS”
Semester: 3rd/ Fall 2021
Submission to: Ma’am Nafeesa
Submission by: Ali sher
CMS ID: 2055-2020
Date: 08 Nov, 2021
Write a program that asks the user to input marks of five courses and then computes the average,
variance and standard deviation of them. The formula for variance is; S2 = [∑ (xi - a)2]/n
Where S2 is the variance and a is the average of the five scores x1, x2, x3, x4 and x5. The standard
deviation is the square root of variance.
The program must have at least 3 functions to compute average, variance and a display function
that displays these values. Your program should ask the user to exit or input the scores again.
Task.1: Program;
#include <iostream>
Int main()
// Phy, Chem, Bio, Eng, and Math are the five subjects
// Phy = Physics
// Chem = Chemistry
// Bio = Biology
// Eng = English
// Math = Mathematics
Cin>>Phy;
Cin>>Chem;
Cin>>Bio;
Cin>>Eng;
Cin>>Math;
// Output
Return 0;
Task.2: Program;
//Student: Ali sher 2055-2020
//Task: OOP Lab Assignment 01
#include <iostream>
Using namespace std;
Int main()
{
Int* arr = nullptr;
Populate_array(arr, 8);
Return 0;
}
Print_array(arr, N);
Cout << endl;
Sort(arr, N);
Cout << “Please Enter a Number and Let’s See If It Exists or Not: “<<endl;
Cin >> x;
If (find(arr, x))
{
Cout << “Hey! Your Number Does Exists”;
}
Else
{
Cout << “Opps! Your Number does not exists Sorry”;
}
}
Print_array(arr, N);
}
Void print_array(int* arr, int N)
{
return false;