Lab Exercise on 27th October 2022 (Aiman Danial Bin Mohd Zaulkarnin,291716), BLIT (Subject Programming 1)
Lab Exercise and Revision Topic 1 (27th October 2022, time : 10.30am -12.30pm, location : SOC Lab 3)
Dear madam, the highlighted text below is hyperlinked to a word document containing the revision you have assigned to the class complete with answer.
Lab Exercise: Creating Algorithm (pseudocode and flow chart) for problem solving
Exercise 1
IPO
Input: midSem, assignment, quiz
Process: carryMarks = midSem+assignment+quiz
Output: carryMarks
Pseudocode
Start
Input midSem, assignment, quiz
Calculate carryMarks = midSem+assignment+quiz
Output carryMarks
End
Flow Chart
Exercise 2
IPO
Input: length, width, height
Process: volume = length x width x height
Output: volume
Pseudocode
Start
Input length, width, height
Calculate volume = length x width x height
Output volume
End
Flow Chart
Exercise 3
IPO
Input: π = 3.142, radius
Process: area of circle = π x radius x radius
Output: area of circle
Pseudocode
Start
Input π = 3.142, radius
Calculate area of circle = π x radius x radius
Output area of circle
End
Flow Chart
Exercise 4
IPO
Input: USD
Process: RM = USD x 4.2
Output: RM
Pseudocode
Start
Input USD
Calculate RM = USD x 4.2
Output RM
End
Flow Chart
Exercise 5
IPO
Input: score1, score2, score3
Process: averageScore = (score1 + score2 + score3) /3
Output: averageScore
Pseudocode
Start
Input score1, score2, score3
Calculate averageScore = (score1 + score2 + score3) /3
Output averageScore
End
Flow Chart
Exercise 6
IPO
Input: number of visitors, ticket price = RM50
Process: total ticket price = number of visitors x ticket price
Output: total ticket price
Pseudocode
Start
Input number of visitors, ticket price = RM50
Calculate total ticket price = number of visitors x ticket price
Output total ticket price
End
Flow Chart
Exercise 7
IPO
Input: parking fee per hour = RM1.50, hours parked
Process: total fee = hours parked x parking fee per hour
Output: total fee
Pseudocode
Start
Input parking fee per hour = RM1.50, hours parked
Calculate total parking fee = hours parked x parking fee per hour
Output total parking fee
End
Flow Chart
Exercise 8
IPO
Input: itemname, itemprice, itemquantity
Process: total price = itemprice x itemquantity
Output: itemname, total price
Pseudocode
Start
Input itemname, itemprice, itemquantity
Calculate total item price = itemprice x itemquantity
Output itemname, total item price
End
Flow Chart
Exercise 9
IPO
Input: total balance, withdrawal amount
Process: total balance after = total balance - withdrawal amount
Output: total balance, withdrawal amount, total balance after
Pseudocode
Start
Input total balance, withdrawal amount
Calculate total balance after = total balance - withdrawal amount
Output total balance, withdrawal amount, total balance after
End
Flow Chart
Exercise 10
IPO
Input: Handbag actual price, discount percentage
Process: Handbag price = Handbag actual price - (Handbag actual price x discount percentage)
Output: Handbag price
Pseudocode
Start
Input Handbag actual price, discount percentage
Calculate Handbag price = Handbag actual price - (Handbag actual price x discount percentage)
Output Handbag price
End
Flow Chart
Comments
Post a Comment