Question

In: Computer Science

1 Write structured pseudocode to show the following: If you are at home, get comfortable and...

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

Solutions

Expert Solution

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


Related Solutions

Draw a structured flowchart or write pseudocode that describes the process of guessing a number between...
Draw a structured flowchart or write pseudocode that describes the process of guessing a number between 1 and 100. After each guess, the player is told that the guess is too high or too low. The process continues until the player guesses the correct number. Pick a number and have someone try to guess it by following your instructions. Submit the flowchart or pseudocode and the results of your test. Create a python program based on your flowchart or pseudocode....
1. Write pseudocode for the following program. You do not have to write actual C++ code....
1. Write pseudocode for the following program. You do not have to write actual C++ code. Assume you have a text file, that has been encrypted by adding 10 to the ASCII value of each character in the message. Design a decryption program that would reverse this process, and display the original message to the console.to the new array. 2.Write the code for the specified program. Use proper style and naming. Test and upload your code as a CPP file....
write pseudocode for the following problems not c code Pseudocode only Write a C program to...
write pseudocode for the following problems not c code Pseudocode only Write a C program to print all natural numbers from 1 to n. - using while loop Write a C program to print all natural numbers in reverse (from n to 1). - using while loop Write a C program to print all alphabets from a to z. - using while loop Write a C program to print all even numbers between 1 to 100. - using while loop...
READ THE FOLLOWING CAREFULLY TO GET FULL VALUE FROM THE PRACTICE. IF NOT COMFORTABLE WITH CLASSES,I...
READ THE FOLLOWING CAREFULLY TO GET FULL VALUE FROM THE PRACTICE. IF NOT COMFORTABLE WITH CLASSES,I WOULD START WITH DEFINING THE CLASS WITH ONE constructor AND GO FROM THEREUse the following to calculate a GPA (the following is for calculation information only):A = 4.00 grade points per credit hourA- = 3.70 grade points per credit hourB+ = 3.33 grade points per credit hourB = 3.00 grade points per credit hourB- = 2.70 grade points per credit hourC+ = 2.30 grade...
write the pseudocode and code to solve the following: you are given a list. determine the...
write the pseudocode and code to solve the following: you are given a list. determine the sum of all the elements in the list without using the built in puthon function sum(). Take your code and create your own function and name it my_sum_algo() which will return the sum of numbers PS please write comments in the code for my understanding, and please write jn jn PYTHON 3 languge. Thank you, have a great day !
For the following question, please show your work. Every number you get, show how you got...
For the following question, please show your work. Every number you get, show how you got it. And please make everything as clear as possible. Thanks in advance. 2. What is the outstanding balance on the following loan after the borrower has made 12.5 years of payments? (For full credit, calculate manually and show all of your work.) (20 pts) Loan amount: $300,000 Term: 25 years Discount Points: 5 Payments: Monthly Interest Rate: 4.5% (annual)
Please I can get a flowchart and a pseudocode for this java code. Thank you //import...
Please I can get a flowchart and a pseudocode for this java code. Thank you //import the required classes import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BirthdayReminder {       public static void main(String[] args) throws IOException {        // declare the required variables String sName = null; String names[] = new String[10]; String birthDates[] = new String[10]; int count = 0; boolean flag = false; // to read values from the console BufferedReader dataIn = new BufferedReader(new...
The following problem should be done in pseudocode. Problem 1 The programmer intends for this pseudocode...
The following problem should be done in pseudocode. Problem 1 The programmer intends for this pseudocode to display three random numbers in the range of 1 through 7. According to the way we've been generating random numbers in the book; however, there appears to be an error. Assume that the random() function is a built-in library function. Correct the pseudocode so that the program works as it should (This has 1 error and is easy to spot) //This program displays...
on the following question please show the formula for the steps and from were you get...
on the following question please show the formula for the steps and from were you get the numbers) Cost-volume-profit analysis Di & Co. has the following budgeted information for a contract: - Fixed costs $ 270,000 Variable cost per unit $         20 Selling price per unit   $         40 Budgeted output / sales units          15,000 Required: (a) Compute the number of units that must be sold to breakeven.                              (b) How many units must be sold to earn $80,000 target profit?                                    ...
(on the following question please show the formula for the steps and from were you get...
(on the following question please show the formula for the steps and from were you get the numbers) Cost-volume-profit analysis Di & Co. has the following budgeted information for a contract: - Fixed costs $ 270,000 Variable cost per unit $         20 Selling price per unit   $         40 Budgeted output / sales units          15,000 Required: (a) Compute the number of units that must be sold to breakeven.                              (b) How many units must be sold to earn $80,000 target profit?                                    ...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT