Giter VIP home page Giter VIP logo

cecs130-lab-4's Introduction

Introduction to Programming Languages CECS130

Lab 4.

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:

  1. Addition
  2. Subtraction
  3. Multiplication
  4. Division
  5. Modulus (integers only)
  6. Test if prime (integers only)
  7. Factorial (integers only)
  8. Power
  9. Your function
  10. Exit
    Please choose an operation: 8
    Enter the first number: 5
    Enter the second number: 3
    5^3 = 125

Calculator Menu:

  1. Addition
  2. Subtraction
  3. Multiplication
  4. Division
  5. Modulus (integers only)
  6. Test if prime (integers only)
  7. Factorial (integers only)
  8. Power
  9. Your function
  10. Exit
    Please choose an operation: 10
    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.)

cecs130-lab-4's People

Contributors

leftengeist avatar

Watchers

James Cloos avatar  avatar

cecs130-lab-4's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.