TCP1101 Assignment PDF
TCP1101 Assignment PDF
Multimedia University
Cyberjaya
Trimester 1, 2020/2021
Assignment Part 1
Group Members:
Problem statement 3
Functional requirements 4
2
Problem statement
(By Quinito Norman Octaviano)
3
Functional requirements
(By Fatema Tuj Johra)
>>The input file must be in “.csv” format, otherwise it will show an error.
2. On the menu system, it is able to choose a subject and output it’s marks. It also catches any
wrong inputs by the user.
>>On the menu system, there will be options for the user to select the subject according
student ID and age and show it’s marks individually.
E.g: Load data, view per subject, compare subject, exit. Inside every option there will be
more options for the user to choose from.
3. For each subject, need to use the following functions to figure out:
a. Minimum
b. Maximum
c. Median
d. Mean
e. Variance
f. Standard Deviation
>>Minimum: This function will figure out the minimum marks among all the students.
>>Maximum: This function will figure out the maximum marks among all the students.
>>Median: This function will figure out the median value (middle position).
E.g: If there are 5 numbers. It will show the middle on which means the 3rd number. If there
are 6 numbers it will add the 3rd and 4th number, then subtract 1 before dividing by 2.
>>Mean: This function will calculate the average among all student’s marks by following
formula:
Sum of all student’s marks / Sum of all students
>>Variance: Variance is basically the squared value of Standard Deviation, so the function
will work by calling the function to calculate Standard Deviation, passing the same
parameters to it, and then squaring the value returned.
4
>>Standard Deviation: Standard Deviation is mainly the square root of the variance, so
that’s how the function will work. It will calculate a quantity expressing how much members
of the group differ from the mean value for the group.
4. For any 2 chosen subjects, need to use the following functions to figure out:
a. Pearson’s Correlation
b. Linear Regression
>>Pearson’s Correlation: The function will calculate the correlation coefficient of any 2
subjects chosen by the user. The function will calculate the sum total of values of both
subjects, the product of all rows and its sum, the squared value of each row and its total sum
for one subject. The following will be used towards the formula to be used for the calculation.
>>Linear Regression: This function will calculate the linear regression of any 2 subjects
chosen by the user. The function will calculate the sum total of values of both subjects, the
product of all rows and its sum, the squared value of each row and its total sum for one
subject. The following will be used towards the formula to be used for the calculation.
5. The calculated results can be presented into the following using a function and be
displayed in a two-column table format with appropriate column headings.
a. Frequency table
b. Histogram
c. Pass/Fail (above or below mean)
>>Frequency Table: This function will show how many times each mark will occur E.g:
The number of students who got 67 marks is 4.
>>Histogram: This function will display the number of students whose marks are between a
given range.
E.g: The number of students who got between 60-70 marks is 4
(output shown >> 60-70 | **** )
>>Above/Below Mean: This will display the students who got above or below the calculated
mean for the chosen subject
6. The menu system is able to display all the data that has been calculated and stored in a text
file
5
The menu system: design and motivation
(By Fam Yao Deng)
6
We will have 2 menus inside the system which is a main menu and a sub menu for
calculation. First,the system will have 5 options to choose, load data, view by subject,
compare subject,overall report and exit. Next, if load data has been chosen, the system will
ask for the name for the file, and if it enters the wrong file name, it will repeat and ask for the
input again until a valid file name has been entered. Next, after it gains access to the csv file,
it will go to store all the data from the csv file into several arrays so it can calculate and print
the data.
After that, in view by subject, it will go to a sub menu that will show list of subjects
and ask for the input for which subjects to choose, then after it received the input, it will show
9 options, which are min, max, mean , median , variance, and standard deviation, histogram,
marks frequency distribution and above or below mean. Users can choose one of the options,
so that the system will be able to calculate the data stored inside arrays.After calculating the
data, it will be saved inside a txt file.
If a user chooses to compare 2 subjects, the system will ask the input for subject 1 and
subject 2. Then, the user will need to choose between pearson’s correlation and linear
regression , and the system will perform the selected option,calculating the data and store it
data in a file. Next,if the user wishes to display all the data stored,they can select the fourth
option which is overall report. Finally, the user can quit the system and all the data will not be
lost since the data is already stored in the files.
7
Structured chart for the system subcomponents
(By Mohammed Al Hindi)
This structured chart shows the flow of the Menu Driven Program, it shows everything from
the beginning to the end.
Although this is the thought of how the program should work for now. This structured chart is
subject to change if necessary alterations are required.
All the information required for a software engineer to understand how the program works is
shown with clear indications of the ordering.
8
Algorithms and proper explanation for the computations used
(By everyone)
9
Flowchart for Mean by Fam Yao Deng
10
Maximum Flowchart by Mohammed Al Hindi
11
Minimum Flowchart by Mohammed Al Hindi
12
Standard Deviation Flowchart by Fatema Tuj Johra
13
Variance Flowchart by Fatema Tuj Johra
14
Pearson’s Correlation Flowchart by Quinito Norman Octaviano
15
Linear Regression Flowchart by Quinito Norman Octaviano
16