In: Computer Science
1 Write structured pseudocode to show the following: If you are at home, get comfortable and take a nap while you are sleepy, otherwise do not take a nap. 2 Write structured pseudocode to show the following: when you are on time for work you have time to buy coffee 3 Write structured pseudocode to indicate that you will keep drying your hair while it is still wet 4 Write structured pseudocode to show the following: when you are on time for work you have time to buy coffee
Answer: Hey! Dear Student, Kindly find your solution here. If you have any queries, feel free to ask me. Thanks.
function main()
output "Enter position at home/at work"
input position
if position = "Home" then
output "Are you feeling comfort?Y/N"
input feelComfort
if feelComfort = "Y" then
output "Are you feeling sleepy?Y/N"
input sleepy
if sleepy = "Y" then
output "Take a nap"
else
output "Don't take a nap"
end If
else
output "Hair is wet.So I'll keep drying my hair"
end If
else
output "It's time to buy a coffee"
end If
end function