You are on page 1of 21

ASSIGNMEN

pseudocode Assignment 2 T2
CPM 111
PREPARED BY: NUR AIDA HANIM
PRINCIPLE OF
BINTI AZMAN (147111)
LECTURER: ASSOC. PROF. DR.
NURUL HASHIMAH AHAMED
PROGRAMMIN
HASSAIN MALIM
G
CONTENTS x

THE
• Problem Analysis
TITLE
• Design
• C++ Program Coding
• Test Case
Problem Analysis
Input
1. The area function (Area, Base, Height) or (Area,
Width, Length)
2. Insert number for calculator Student ID
Option selection from the menu (Calculator, Quiz,
Exit programme)
3. Option selection from the calculator and quiz
function (Triangle, Rectangle, Parallelogram, Exit
programme)
4. Option selection from the calculator function
(Circumference, Area, exit programme)
5. Option selection from on which part chosen
Answers for shape quiz chosen
Problem Analysis
Output

1. Display answer for calculator


2. Menu option for Quiz
3. Quiz marks of Triangle,
Rectangle and Parallelogram
for a specific student ID
Problem Analysis
Process
1.Call calculator function when its chosen
2.Get the student ID from user
i. Call function studentid
3.Function studentid
i. Call and read file studentMarks,txt to check the student ID existence
ii. If the student ID does not exist, the user will take the quiz as a new user
iii. If the student ID exist, the user will take the quiz as an existing user with marks stored in that file.
4.Call function stumark to insert or update new data into file
i. Call file studentMarks.txt and create temporary file (data.txt)
ii. If student ID exist, their marks for quiz will be update
iii. If student ID does not exist, its means student is a new user
iv.Close studentMarks.txt and data.txt files
5.Call function quiz
i. Call function triangle/rectangle/parallelogram and read file Triangle.txt/ Rectangle.txt/ Parallelogram.txt
to execute the quiz.
ii. Function for the shape and file read based on shape that student chose
iii. Calculate student marks and review the answer if thew want
DESIGN
PSEUDOCODE
Used Function
1. CALCULATOR
FUNCTION
Used Function
2. CIRCUMFERENCE
FUNCTION
Used Function
3. AREA FUNCTION
Used Function
4. STUDENTID
FUNCTION
Used Function
5. QUIZ FUNCTION
Used Function
6. TRIANGLE FUNCTION
Used Function
7. RECTANGLE
FUNCTION
Used Function
8. PARALLELOGRAM
FUNCTION
Used Function
9. STUMARK FUNCTION
TEST CASE
ASSIGNMEN
pseudocode Assignment 2 T2

THANK
YOU

You might also like