[Solved] Introduction to Programming Languages CECS130 Lab #4.

$25

File Name: Introduction_to_Programming_Languages_CECS130_Lab_#4..zip
File Size: 499.26 KB

SKU: [Solved] Introduction to Programming Languages CECS130 Lab #4. Category: Tag:
5/5 - (1 vote)

Programming assignment (100 pts): Rewrite your lab 3 calculator program using functions.

Each mathematical operation in the menu should be represented by a separate function. In addition to all operations your calculator had to support in lab 3, please add additional functionality to your calculator. Include the ability to compute the factorial of an integer (Example: 4! = 1 * 2 * 3 *4 = 24), and an integer power of a number (Example: 53 = 5 * 5 * 5 = 125). Finally, add an interesting mathematical function of your choosing which computes the first n numbers of a sequence of numbers and utilizes an array to store the result before displaying it (Examples of mathematical sequences: Fibonacci, Primes).

Example of the output follows:

Calculator Menu:

  • Addition
  • Subtraction
  • Multiplication
  • Division
  • Modulus (integers only)
  • Test if prime (integers only)
  • Factorial (integers only)
  • Power
  • Your function
  • Exit

Please choose an operation: 8

Enter the first number: 5

Enter the second number: 3

5^3 = 125

Calculator Menu:

  • Addition
  • Subtraction
  • Multiplication
  • Division
  • Modulus (integers only)
  • Test if prime (integers only)
  • Factorial (integers only)
  • Power
  • Your function

(0) Exit

Please choose an operation: 0 Good Bye!

You program MUST be bug-free, user friendly (verify input from the user), well commented

(Including author information, program description, lab section, date, etc.)

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] Introduction to Programming Languages CECS130 Lab #4.
$25