Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please read the program explanation in Part A. I already completed the Pseudocode from Part B , it is attached at the bottom so you

Please read the program explanation in Part A. I already completed the Pseudocode from Part B , it is attached at the bottom so you dont need to worry about that. I just need the flowchart required in part c for the pseudocode that I attached from Part B. Please use raptor. Do not answer this question if you dont have raptor please.

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:

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

Part C: Flowchart

Using the pseudocode you wrote in the previous part, draw a flowchart for it. You can use any flowchart software, like Raptor, Flogorithm, draw.io, or draw it on any software with graphical capabilities, like Dia (available on the School UNIX server), Word, PowerPoint, or Paintbrush.

This is the pseudocode for it:

image text in transcribed

image text in transcribed

Here below is the pseudocode for the given question: PRINT "Please enter your name:" name = INPUT () PRINT "Please enter the date (in the format DD/MM/YYYY):" date = INPUT () PRINT "Welcome to my Command-Line Calculator (CLC)" PRINT "Developer: " + name + "Version: 1" PRINT "Date:" + date WHILE True DO PRINT "Select one of the following items:" PRINT "B) - Binary Mathematical Operations, such as addition and subtraction." PRINT "U) - Unary Mathematical Operations, such as square root, and log." PRINT "A) - Advances Mathematical Operations, using variables, arrays." PRINT "V) - Define variables and assign them values." PRINT "E) - Exit" option = IMPUT ( ) IF option == "B" THEN PRINT "Please enter the first number:" first_num = INPUT () PRINT "Please enter the operation (+,,,/): " operation = INPUT() PRINT "Please enter the second number:" second_num = INPUT () IF operation =="+" THEN result = first_num + second_num ELSE IF operation ==" " THEN result = first_num - second_num ELSE IF operation ==" THEN result = first_num * second_num ELSE IF operation =="/" THEN result = first_num / second_num ELSE PRINT "Invalid operator selected" PRINT "The result is " + result ELSE IF option == "U" THEN PRINT "Sorry, at this time I don't have enough knowledge to serve you in this category." ELSE IF option == "A" THEN PRINT "Sorry, at this time I don't have enough knowledge to serve you in this category. " ELSE IF option == "V" THEN PRINT "Sorry, at this time I don"t have enough knowledge to serve you in this category." ELSE IF option == "E" THEN PRINT "Thanks for using my Simple Calculator. Hope to see you soon again, Goodbye!" BREAK ELSE PRINT "Invalid option selected. Please try again." END WHILE

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

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions