Ask Question
26 July, 23:40

Write pseudocode for a program which will ask a user to enter two numbers a and b. It then asks what operation is to be performed: a*b, a/b, a//b or a%b, performs the appropriate calculation and prints out the result. If the user does not enter a valid response, print an error message.

+4
Answers (1)
  1. 27 July, 01:26
    0
    get int input for a

    get int input for b

    get string input for operator

    if a is not int or b is not int throw exception and print error

    if operator is not * / / / or % throw exception and print error

    if operator is * do multiplication of a and b and make answer c

    else if operator is / do division of a and b and make answer c

    else if operator is / / do floor division of a and b and make answer c

    else if operator is % do floor modulo of a and b and make answer c

    print c
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write pseudocode for a program which will ask a user to enter two numbers a and b. It then asks what operation is to be performed: a*b, ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers