Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exam 1 Practical Kotlin Console Calculator: Write a Program that displays repeatedly a menu as shown in the sample run below. The user can enter
Exam Practical
Kotlin Console Calculator:
Write a Program that displays repeatedly a menu as shown in the sample run below. The user can
enter or for choosing addition, subtraction, multiplication, division or exit
respectively.
All the operations handling has to be within a functions.
After an operation is finished and output is displayed the menu is redisplayed, you may choose
another operation or enter to exit the program.
Each operation will ask the user for two numbers then calculate and display the answer.
Handle the division by zero case, by displaying an Error Message if the user is trying to divide
by
Sample run:
Main Menu
: Addition
: Subtraction
: Multiplication
: Division
: Exit
Enter a Choice:
Enter number :
Enter number :
The Answer is:
Main Menu
: Addition
: Subtraction
: Multiplication
: Division
: Exit
Enter a Choice:
Enter number :
Enter number :
Impossible to divide by Zero.
Main Menu
: Addition
: Subtraction
: Multiplication
: Division
: Exit
Enter a Choice:
Exiting...
Thank you for using the C Console Calculator
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started