0% found this document useful (0 votes)
9 views2 pages

Week 2 - Pseudocode and Flowchart - 4

Uploaded by

Anonymous
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)
9 views2 pages

Week 2 - Pseudocode and Flowchart - 4

Uploaded by

Anonymous
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/ 2

1. Draw a flowchart to convert the distance in mile to kilometer.

Set KM per
mile to 1.609 and distance mile to 100. Prompt the distance in mile from
the user and display the distance in kilometer.

Set mile to km = Set distance mile to


Start
1.609 100

Calculate distance in
kilometers by
Input distance in multiplying the input Display the calculated
miles distance by the distance in kilometers
conversion factor (KM
per mile)

End

2. Write a pseudocode to prompt the maximum and minimum temperature


readings on a particular day, accept those readings as integers, and
calculate and display to the screen the average temperature, calculated
by (maximum temperature + minimum temperature)/2.
Start
Input maximum temperature
Input minimum temperature
Set average temperature = (maximum temperature + minimum
temperature) / 2
Display "The average temperature is: " + average temperature
End
3. Write a pseudocode and python code to accept Basic from an employee
and calculate salary of an employee by considering following things.
(Grade_pay is double of Basic. DA is 70% of Basic. TA is RM 200. HRA is
20% of Basic.)(Formula for salary = Grade_pay + DA + TA + HRA).
Start Basic = float(input("Enter
Input Basic Basic salary: "))
Set Grade_pay = 2 * Basic
Set DA = 0.70 * Basic Grade_pay = 2 * Basic
Set TA = 200 DA = 0.70 * Basic
Set HRA = 0.20 * Basic TA = 200
Set Salary = Grade_pay + HRA = 0.20 * Basic
DA + TA + HRA
Display Salary Salary = Grade_pay + DA + TA
End + HRA

print("Total Salary:", Salary)

You might also like