Pseudocode:
program calculator
while(True) #main loop
{ #get choice until input="Q"
#print main menu
print("Welcome to the Calculation Program")
print("(1) Addition")
print("(2) Subtraction")
print("(3) Multiplication")
print("(4) Division")
print("(Q) Quit Program")
#finish print main menu
input=getinput from user (1,2,3,4,Q) #ask the user to input a
choice and set input as the choice.
if input=="Q", then print("End Calculator"), break #if input is
"Q", then exit main loop
if input==1 #Addition
{
while(True) #addition loop until user ends
{
print("Adds two numbers. Enter "Q" to quit") #print
directions
x=getinput from user (first number) #Takes user's first input and
stores in x
y=getinput from user (second number) #Takes user's second input and
stores in y
if (x=="Q" or y=="Q") then break #if Q, exit addition
print(x+y) #print the answer
}
}
if input==2 #Subtraction
{
while(True) #subtraction loop until user ends
{
print("Subtracts two numbers. Enter "Q" to quit") #print
directions
x=getinput from user (first number) #Takes user's first input and
stores in x
y=getinput from user (second number) #Takes user's second input and
stores in y
if (x=="Q" or y=="Q") then break #if Q, exit subtraction
print(x-y) #print the answer
}
}
if input==3 #Multiplication
{
while(True) #multiplication loop until user ends
{
print("Multiplies two numbers. Enter "Q" to quit") #print
directions
x=getinput from user (first number) #Takes user's first input and
stores in x
y=getinput from user (second number) #Takes user's second input and
stores in y
if (x=="Q" or y=="Q") then break #if Q, exit multiplication
print(x*y) #print the answer
}
}
if input==2 #Division
{
while(True) #division loop until user ends
{
print("Divides two numbers. Enter "Q" to quit") #print
directions
x=getinput from user (first number) #Takes user's first input and
stores in x
while(True) #Loop to check for 0 denominator
{
y=getinput from user (second number) #Takes user's second input and
stores in y
if (y is not 0) then break #if y is ok, then stop input y
loop
print("Please enter a non-zero denominator") #send error message
and get input again with loop
}
if (x=="Q" or y=="Q") then break #if Q, exit division
print(x/y) #print the answer
}
}
#Restart main loop and reprints main menu, etc.
}
Using labview from national instruments ator that can do the following: addition, subtraction, multiplication, division, (8)...
Using Assembly Language (MIPS), design a program calculator that can perform the following: Addition, Subtraction, Multiplication, Division, Power and Square Root Functions. Code must be able to accept floating point as well.
Problem 3 (35) Design a calculator that performs four operations: addition, multiplication, division and subtraction with 2 integer type numbers a) Ask user what type of operation to perform (+, , * or/) a. If the user inputs 'none' then the program terminates. Otherwise it will keep continuing the calculation. (hint: use while) b) Ask user to provide 2 integer number inputs c) Perform operation (whatever operation they mentioned in a) d) Print result e) In division operation, perform a...