DAT13303
ALGORITMA KOMPUTER
SECTION: 5
LAB: 1
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: 22 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 [Link] represents the data or information that is provided to a system or
process at the [Link], 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.
PRACTICAL EXERCISE
1. Calculate the new salary after a 15% increase.
Phase 1: Problem definition
Word Definition
calculate determine (the amount or number of something) mathematically
new produced, introduced, or discovered recently or now for the first time; not existing before
salary a fixed regular payment, typically paid on a monthly basis but often expressed as an annual
sum, made by an employer to an employee, especially a professional or white-collar worker
15% A quarter of hundred
increase to (make something) become larger in amount or size
Phase 2: Problem analysis
IPO table
Component Requirement Name of variables, formulas
I Amount of salary aos
P Formula to create new salary ns=(15%*aos)+aos
O New salary ns
Expected screen
A program to calculate the new salary after a 15% increase
Enter salary: 7500
New Salary: 8625
CONCLUSION : In conclusion the old salary is [Link] new salary aftrer 15%
increase is 8625.
2. Calculate the average mark of five students.
Phase 1: Problem definition
Word Definition
calculate determine (the amount or number of something) mathematically
average a number expressing the central or typical value in a set of data
mark a judgment, expressed as a number or letter, about the quality of a piece of
work done at school, college, or university
five a number that is one more than four
students a person who is studying at a university or other place of higher education
Phase 2: Problem analysis
IPO table
Component Requirement Name of variables, formulas
I Mark five students ms1, ms2, ms3, ms4, ms5
P Determine 5 numbers and av = (ms1 + ms2 + ms3 + ms4 +
divide all by the number of ms5) / 5
marks
O Average mark av
Sample expected screen:
A program calculate the average mark of five students.
Enter the mark of five students: mark student 1 = 85
mark student 2 = 82
mark student 3 = 75
mark student 4 = 90
mark student 5 = 88
Enter the total marks of five students: 420
Average mark of five students: 84
CONCLUSION : In conclusion,the average mark of five students after the total marks
of five students divided by 5 is 84.
3. Calculate the new price after a 10% discount.
Phase 1: Problem definition
Word Definition
calculate Determine (the amount or number of something) mathematically
new Recently created or having started to exist recently.
price The amount of money for which something is sold
10% 10% of 100 is 10.
discount a deduction from the usual cost of something
Phase 2: Problem analysis
IPO table
Component Requirement Name of variables, formulas
I Original price p
P Formula to create new np=(0.1 * p) - p
price
O New price np
Sample expected screen:
A program calculate the new price after a 10% discount.
Enter the original price : 8052
New price : 7246.80
CONCLUSION :
In conclution, the original price is RM8052. The new price after 10% discount is
RM7246.80.
4. Calculate the volume of a pyramid.
Phase 1: Problem definition
Word Definition
calculate determine (the amount or number of something) mathematically
volume The amount of space that is contained within an object or solid shape
pyramid a solid shape with a flat, square base and four flat, triangular sides which slope
inward and meet to form a point at the top
Phase 2: Problem analysis
IPO table
Component Requirement Name of variables, formulas
I Height of pyramid p_h
Length of pyramid p_l
Width of pyramid p_w
P Volume of pyramid equal to vop = (h*l*w/3)
height multiply length
multiply width and divided by
3
O Volume v
Sample expected screen:
A program calculate the volume of a pyramid.
Enter the height of the pyramid: 7
Enter the length of the pyramid: 5
Enter the width of the pyramid: 5
Volume of the pyramid: 58.333
CONCLUSION : In conclusion,the volume of the pyramid is 58.333 after multiply the
height,length and width and divided by 3.
REFERENCES
- [Link]
- [Link]
- [Link]