Reference no: EM13918893
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
(0) 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
(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.)
Current profit
: What is the current profit?What is the break-even point in units?What would the break-even point in units be if commissions are increased and salaries decreased?If sales increase by 8,000 units, what will the profit be under the new plan?
|
Find optimal number of gloves to produce at each facility
: Use LINGO or Excel Solver to find the solution to your mathematical model to determine the optimal number of gloves to produce at each facility.
|
What are the eight drivers of an innovation economy
: What are the eight drivers of an innovation economy? Which of the eight drivers of an innovation economy influences your organization the most? Explain your answer. What is the influence of these eight drivers on your organization, and why?
|
Investment in the marketing of a brand over time
: Question 1: ________ represent(s) the cumulative added value of a company's investment in the marketing of a brand over time.
|
Mathematical sequences in calculator program
: 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..
|
Which reading strategies will use to enhance a unit of study
: Which reading and writing strategies (tools) will you use to enhance a unit of study? Why did you select those in differentiating instruction for specific students? Will the differentiation result in improved learning? How will you gather evidence..
|
Solve the revised model with lingo or excel solver
: Reformulate the model given by (8.10) through (8.19) based on the new definition of the decision variables. Solve the revised model with LINGO or Excel Solver.
|
Explain in terms of energy conservation
: Explain in terms of energy conservation how, by knowing the vertical drop height, the energy at impact of a pendulum impactor can be calculated.
|
What is procter and gamble business strategy
: How is P&G using collaboration systems to execute its business model and business strategy? List and describe the collaboration systems and technologies it is using and the benefits of each.
|