Write a computer program in C which will simulate a
calculator. Your calculator needs to support the five basic operations (addition, subtraction,
multiplication, division and modulus) plus primality testing (natural number is prime if it has no
non-trivial divisors).Example of the output follows:
Calculator Menu:
(1) Addition
(2) Subtraction
(3) Multiplication
(4) Division
(5) Modulus (integers only)
(6) Test if prime (integers only)
(7) ExitPlease choose an operation: 2
Enter the first number: 18
Enter the second number: 20
18 – 20 = -2
Calculator Menu:
(1) Addition
(2) Subtraction
(3) Multiplication
(4) Division
(5) Modulus (integers only)
(6) Test if prime (integers only)
(7) ExitPlease choose an operation: 6
Enter the number to be tested: 22
Not prime: 2 x 11 = 22
Calculator Menu:
(1) Addition
(2) Subtraction
(3) Multiplication
(4) Division
(5) Modulus (integers only)
(6) Test if prime (integers only)
(7) ExitPlease choose an operation: 7
Good Bye!
You program MUST be bug-free, well commented (Including author information, program
description, lab section, date, etc.)
calculator., CECS130, Computer, program, simulate, solved, which, will, Write
[SOLVED] Cecs130 lab 3 write a computer program in c which will simulate a calculator.
$25
File Name: Cecs130_lab_3__write_a_computer_program_in_c_which_will_simulate_a_calculator..zip
File Size: 734.76 KB
Only logged in customers who have purchased this product may leave a review.
Reviews
There are no reviews yet.