Question

Please do the following: a-) Write a pseudocode that receives a positive number from the user,...

Please do the following: a-) Write a pseudocode that receives a positive number from the user, and then, starts printing and keep printing the word “CS” until the number of the printings matches the received number from the user. b-) Write an algorithm for the same problem. c-) Draw a flowchart for the same problem

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a.

Step 1: Start

Step 2: Ask user for a number n

Step 3: Run loop from 1 to n

Step 4: print 'CS'

Step 5: increment the loop

Step 6: Stop

b.

Program : printing 'CS', n number of times

Declare variable i, n as integer

Enter number n from user and store it

for i=1 to n do

Display 'CS'

i++

End

c.

Add a comment
Answer #2

a-) Pseudocode:

vbnetCopy code1. Prompt the user to enter a positive number.2. Read and store the number as 'numPrints'.3. Set 'count' to 0.4. Repeat the following steps until 'count' is equal to 'numPrints':
     5. Print "CS"
     6. Increment 'count' by 1.7. End.

b-) Algorithm:

sqlCopy code1. Start2. Display "Enter a positive number: "3. Read 'numPrints' from the user4. Set 'count' to 05. Repeat while 'count' is less than 'numPrints':     6. Display "CS"     7. Increment 'count' by 18. End

c-) Flowchart:

sqlCopy code    +------------------+
    |    Start         |
    +------------------+
             |
             V    +------------------+
    |  Display Prompt  |
    +------------------+
             |
             V    +------------------+
    |   Read Input     |
    +------------------+
             |
             V    +------------------+
    |    Set count     |
    +------------------+
             |
             V    +------------------+
    |   Check count    |
    |   < numPrints    |
    |   Condition?     |
    +------------------+
            / \           /   \
          V     X    +------------------+
    |   Display "CS"   |
    +------------------+
             |
             V    +------------------+
    |  Increment count |
    +------------------+
             |
             V    +------------------+
    |   Repeat Loop    |
    +------------------+
             |
             X             |
    +------------------+
    |       End        |
    +------------------+

Note: In the flowchart, the diamond-shaped box represents a condition or decision point. The rectangle-shaped box represents a process or action. The arrows indicate the flow of control or direction of the program execution.


answered by: mervetokaz
Add a comment
Know the answer?
Add Answer to:
Please do the following: a-) Write a pseudocode that receives a positive number from the user,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • write the pseudocode and draw the flowchart to calculate how many words entered by the user...

    write the pseudocode and draw the flowchart to calculate how many words entered by the user until the user enters the word "stop" by using while/end while loop logic structure

  • Example 3: Draw a flowchart that performs the following: Ask a user to enter a number....

    Example 3: Draw a flowchart that performs the following: Ask a user to enter a number. If the number is between 0 and 10, write the word blue. If the number is between 10 and 20, write the word red. if the number is between 20 and 30, write the word green. If it is any other number, write that it is not a correct color option. Example 4: Draw a flowchart to print all multiples of 5 between 1...

  • Q2 Write pseudocode and flow chart of the following problem Qi. Write pseudocode and flow chart...

    Q2 Write pseudocode and flow chart of the following problem Qi. Write pseudocode and flow chart that prompts (input) the capacity, in gallons, of an automobile fuel tank and the miles per gallon the automobile can be driven. The program outputs the number of miles the automobile can be driven without refueling. Q ii. Centigrade and Fahrenheit are two scales to measure temperature. Write pseudocode and flow chart that that prompts (input) the user to enter Centigrate and then print...

  • Write a program that receives a positive integer n from the user and then calculates the...

    Write a program that receives a positive integer n from the user and then calculates the sum below by using a loop. Your program needs to ask the user to re-enter a different number if the user enters a non-positive one. Display the result. 1 SUM 1 2 3 ... n x x n = = = + + + +

  • Write a program that receives a series of numbers from the user and allows the user...

    Write a program that receives a series of numbers from the user and allows the user to press the enter key to indicate that he or she is finished providing inputs. After the user presses the enter key, the program should print the sum of the numbers and their average.   >>> totalSum =0 >>> count=0 >>> while True:    number=input("Enter a number or press enter to quit:")    if number =="":        break    totalSum += float(number)    count+=1...

  • I need Pseudocode Algorithm only, please Write a program that asks the user to enter the...

    I need Pseudocode Algorithm only, please Write a program that asks the user to enter the name of his or her favorite city. use a String variable to store the input. The program should display the following: The number of characters in the city name the name of the city in all uppercase letters the name of the city in all lower case letters the first character in the name of the city

  • 6. Write a program (compile and run), a pseudocode, and draw a flowchart for each of...

    6. Write a program (compile and run), a pseudocode, and draw a flowchart for each of the following problems: a) Obtain three numbers from the keyboard, compute their product and display the result. b) Obtain two numbers from the keyboard, and determine and display which (if either) is the smaller of the two numbers. c) Obtain a series of positive numbers from the keyboard, and determine and display their average (with 4 decimal points). Assume that the user types the...

  • Please help me write a Pseudocode (please do NOT answer in JAVA or Python - I...

    Please help me write a Pseudocode (please do NOT answer in JAVA or Python - I will not be able to use those). Please ALSO create a flowchart using Flowgarithm program. Thank you so much, if answer is provided in Pseudocode and Flowchart, I will provide good feedback and thumbs up to the resonder. Thank you! Tic-Tac-Toe Game Write a program that allows two players to play a game of tic-tac-toe. Use a two- dimensional char array with three rows...

  • For this assignment, you will write a program that guesses a number chosen by your user....

    For this assignment, you will write a program that guesses a number chosen by your user. Your program will prompt the user to pick a number from 1 to 10. The program asks the user yes or no questions, and the guesses the user’s number. When the program starts up, it outputs a prompt asking the user to guess a number from 1 to 10. It then proceeds to ask a series of questions requiring a yes or no answer....

  • Steps: Write a program that upon getting mass value from user, converts it to energy using...

    Steps: Write a program that upon getting mass value from user, converts it to energy using Einstein’s mass-to-energy conversion equation. You must write a function to calculate energy. Writing the whole thing in main will not get any credit. Note: Conversion equation=> e = m x c^2 Please do these steps: 1-Draw flowchart diagram or write the pseudocode 2-Write your code 3-Run the code 4-Test for all possible inputs!

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT