0% found this document useful (0 votes)
58 views10 pages

Group 5 Computer Algorithm Lab 2

1) The document discusses an assignment to define algorithmic problems by identifying the input, process, and output. It provides pseudocode and flowcharts for 4 problems: calculating new salary after a 15% increase, average mark of 5 students, new price after a 10% discount, and volume of a pyramid. 2) Pseudocode and a flowchart are provided to calculate a new salary of RM8,625 after a 15% increase from RM7,500. 3) To calculate the average mark of 5 students, the total mark is divided by 5 to get an average of 84.

Uploaded by

gc47rysy85
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views10 pages

Group 5 Computer Algorithm Lab 2

1) The document discusses an assignment to define algorithmic problems by identifying the input, process, and output. It provides pseudocode and flowcharts for 4 problems: calculating new salary after a 15% increase, average mark of 5 students, new price after a 10% discount, and volume of a pyramid. 2) Pseudocode and a flowchart are provided to calculate a new salary of RM8,625 after a 15% increase from RM7,500. 3) To calculate the average mark of 5 students, the total mark is divided by 5 to get an average of 84.

Uploaded by

gc47rysy85
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

DAT13303

ALGORITMA KOMPUTER

SECTION: 5

LAB: 2

LECTURER NAME: DR. WAN IBTISAM BINTI HAJI WAN OMAR

STUDENT NAME
NAME MATRIK NUMBER
ALLY AKHTAR BIN ANWAR AA232367
MUHAMMAD IKHWAN ASHRAF BIN MOHD RAZIF AA230429
MUHAMMAD IZAM IZANI BIN MOHD NAZIHA AA231986

DATELINE: 29 OCTOBER 2023


INTRODUCTION
In this assignment, we are assigned to define algorithmic problem which is we need to solve
the given problem by using algorithm. In addition we need to identify the input, process, and
output of the problems.Input represents the data or information that is provided to a system or
process at the beginning.While, process refers to the actions, operations, or transformations
that the system performs on the input data. Beside, output represents the results or
information that the system generates after processing the input. at the end of the task,we
need to design expected screen. expected screen is a picture of how the screen
will be displayed.

Write the pseudocode (basic and detail) and draw the flowchart for each of the
following problem based on your Lab 1.
1. Calculate the new salary after a 15% increase.

Phrase 3:Algorithm Design


Pseudocode:
1. Basic

Start
Declare variables
Input salary
Calculate new salary
Display sum
End

2. Detail

Begin
Declare aos,ns
Display “Enter your salary”
Get aos
Calculate ns=(0.15*aos)+aos
Display “New Salary”
Stop
Flowchart:

CONCLUSION : In conclusion the old salary is 7500.The new salary aftrer 15%
increase is 8625.
2. Calculate the average mark of five students.

Pseudocode:

1. Basic

Start
Declare variables
Input mark student
Calculate 5 numbers and divide all by the number of marks
Print the average mark
End

2. Detail

Begin
Declare ms1,ms2,ms3,ms4,ms5
Display “Enter mark student 1”
Display “Enter mark student 2”
Display “Enter mark student 3”
Display “Enter mark student 4”
Display “Enter mark student 5”
Get ms1,ms2,ms3,ms4,ms5
Calculate av = (ms1 + ms2 + ms3 + ms4 + ms5) / 5
Display “average mark”
Stop
Flowchart:

CONCLUSION :
In order to get the average mark, the total mark of five students were divided by 5 and
get 84 as the answer.
3. Calculate the new price after a 10% discount.

Pseudocode:
1. Basic
Start
Declare variables
Input original price
Calculate new price after discount
Display new price
End

2. Detail

Start
Declare originalprice As float
Display “Enter original price”
Get original price
Calculate new price =(0.1 * originalprice) – originalprice
Print “new price: ”, np
End
Flowchart:

CONCLUSION :
To sum up, to get the new price after 10% discount is, the original price need to multipy
with 0.1 and minus by original price and the answer is 72546.80.
4. Calculate the volume of a pyramid.

Pseudocode:

1. Basic

Start
Declare variables
Input height of pyramid,length of pyramid,width of pyramid
Calculate volume of pyramid = (p_h * p_l * p_w / 3)
Display Volume of pyramid
End

2. Detail

Begin
Declare p_h, p_l, p_w
Display “Enter height of pyramid”
Display “Enter length of pyramid”
Display “Enter width of pyramid”
Get p_h, p_l, p_w
Calculate vop = (p_h * p_l * p_w / 3)
Display “Volume of pyramid”
Flowchart:

Conclusion:
In order to get volume of pyramid, the pyramid’s height, length and width need to be multiply
and divided by 3. The answer should be 58.3333.

You might also like