attachment_22e0249150130c198e1cb0f407d5783d.docx - Calculator No Control Flow Due Sat 11:00 pm Objective Gain experience with advanced OOP

attachment_22e0249150130c198e1cb0f407d5783d.docx -...

• Homework Help
• 5

This preview shows page 1 - 3 out of 5 pages.

Calculator - No Control Flow Due: Sat @ 11:00 pm Objective Gain experience with advanced OOP techniques (The State Design Pattern) Description You will write a 4 function calculator without using any control flow , meaning you cannot write any code that will be executed conditionally. Instead you will apply object-orientation programming approaches to make decisions based on types instead of values. Specifically, you are expected to use the state pattern to complete this assignment. The following are banned in your submissions: Conditionals if/else if/else match/case throw/try/catch/finally (Can be used to simulate conditionals) Loops for while do/while Any way of directly simulating Conditionals or Loops that is against the spirit of this assignment. (Ex. Taking advantage of short circuit evaluations) If your submission, including testing and comments, contains any of the keywords listed above it will not be graded.
The calculator itself will be a 4-function calculator with the buttons and functionality: Digits 0-9 Adds the pressed digit to the end of the currently displayed number, or replaces the currently displayed number if an operation has just been pressed (Start RHS) or computed with = (Begin new LHS) Decimal Begins the decimal portion of the number being typed. If already in the decimal portion this button has no effect (and must not break other functionality) If no digits were pressed for the current number, LHS or RHS, the decimal button should assume there is a 0 for the whole number and begin the decimal portion of the number. Ex. If the user presses [.,3, 5] the displayed text should be 0.35 Clear Returns the calculator to its initial state with 0.0 being displayed Operations (+, -, *, /)

You've reached the end of your free preview.

Want to read all 5 pages?

• Fall '19
• James

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern