Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please read the explanation in Part A and then do the pseudocode for it in part B. That's all that's needed. Part A: Brief introduction

Please read the explanation in Part A and then do the pseudocode for it in part B. That's all that's needed.

Part A: Brief introduction to the Command-line Calculator:

The goal is to design and develop a simple command-line calculator. In this calculator, the user should be able to do simple mathematical operations, such as addition, subtraction, multiplication and division for various numbers. After running the program, first a list of five possible options is shown to the user. Then, the user must select one option from the list. A next set of messages will be shown to the user based on the selected option (in this first assignment, we assume that just options B and E are functional and if a user selects other options, an error message will be shown). In case the user selects option E, the program will show a goodbye message and terminate. If option B is selected, the user must enter the first number, then enter an operator (operators included in the prompt), and finally enter the second number. The program will then show the result of that calculation and prompt again to receive the selected option from the user. To give you a clear idea about the expectation, a sample output of the program is shown for this assignment. Those parts which are bold-italic are the user inputs during the execution.

Welcome to my Command-Line Calculator (CLC)

Developer: Your name will come here Version: 1

Date: Development date will come here

Select one of the following items:

B) - Binary Mathematical Operations, such as addition and subtraction.

U) - Unary Mathematical Operations, such as square root, and log.

A) - Advances Mathematical Operations, using variables, arrays.

V) Define variables and assign them values.

E) - Exit

B

Please enter the first number:

12

Please enter the operation ( + , - , * , / ):

+

Please enter the second number:

3

The result is 15

Please select your option ( B , U , A , V, E )

U

Sorry, at this time I don't have enough knowledge to serve you in this category. Please select your option ( B , U , A , V , E )

A

Sorry, at this time I don't have enough knowledge to serve you in this category. Please select your option ( B , U , A , V , E )

V

Sorry, at this time I don't have enough knowledge to serve you in this category.

Please select your option ( B , U , A , V , E )

B

Please enter the first number:

18

Please enter the operation ( + , - , * , / ):

*

Please enter the second number:

3

The result is 54

Please select your option ( B , U , A , V , E )

B

Please enter the first number:

9

Please enter the operation ( + , - , * , / ):

-

Please enter the second number:

13

The result is -4

Please select your option ( B , U , A , V , E )

E

Thanks for using my Simple Calculator. Hope to see you soon again, Goodbye!

As mentioned before, in this first version of the calculator, you just need to cover the four mathematical operations, addition, subtraction, multiplication, and division. Also, for all calculations, the user can only perform the operation for two operands, like the example above.

Part B: Pseudocode: (40 marks)

Using the above explanation and sample outputs of the program execution, write the pseudocode for the Command-line Calculator program. As a hint, some lines have been written, and you should complete the rest.

Start

Show a Welcome message to the user

Loop { for asking the user to input their option}

a) Show a prompt for user selection

.

.

End of loop

Show a Goodbye message

End

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

What is the purpose of a companys balance sheet?

Answered: 1 week ago

Question

Demonstrate through language that you are grateful to be informed.

Answered: 1 week ago