Hire Experts For Answers
Order NowRelated Study Services
- Homework Answers
- Coursework writing help
- Term paper writing help
- Writing Help
- Paper Writing Help
- Research paper help
- Thesis Help
- Dissertation Help
- Case study writing service
- Capstone Project Writing Help
- Lab report Writing
- Take my online class
- Take my online exam
- Do my test for me
- Do my homework
- Do my math homework
- Online Assignment Help
- Do my assignment
- Essay Writing Help
- Write my college essay
- Write my essay for me
DESCRIPTION
Posted
Modified
Viewed
16
or this project, youll create a form that lets the user perform the operations provided by a basic calculator. Youll also create a class that performs the required operations.
The design of the Calculator form
Operation
To perform an addition, subtraction, multiplication, or division operation, the user clicks the first number, followed by the appropriate operator key (+, -, *, /), followed by the second number and the equals key (=). Each time the equals key is clicked, the operation is repeated.
To calculate the square root or the reciprocal of a number or to change the sign of a number, the user clicks the number followed by the appropriate operator key (sqrt, 1/X, +/-). Each time the user clicks the operator key, the operation is repeated.
Each time the user clicks a number key, the number is displayed in the text box at the top of the form. This text box also displays the result of an operation when the user clicks the sqrt, 1/X, +/-, or = key.
To erase the last digit entered, the user clicks the Back key.
To clear all the values entered, the user clicks the Clear key.
Specifications
Create a class named Calculator that implements the functions of the calculator. Design whatever methods and properties you need for this class.
The Calculator class should accept decimal parameters and provide a decimal result for its calculated values.
If the user tries to divide a number by zero, the calculator should display an error message in the text box. The form class should use a try-catch statement to catch a divide-by-zero exception.
Notes
The calculator thats created in this project is similar to the calculator that comes with Windows. If you want to, you can study the behavior of the Windows calculator so you have a better idea of how it works.
One of the differences between the calculator created in this project and the Windows calculator is that you can perform a calculation by clicking an operator key other than the = key with the Windows calculator. In other words, you can add a list of numbers like this using the Windows calculator: 3 + 12 + 14 + 8 =. With the calculator for this project, you have to perform each calculation separately by clicking the = key like this: 3 + 12 = + 14 = + 8 =.
Optional: An enhancement would be for the application to provide for entries from the keyboard. For example, if the user presses the 1 key, the number 1 should be displayed in the calculator. Similarly, if the user presses the = key, the current calculation should be performed. Note, however, that not all of the calculator buttons map to keyboard keys.
If you need to simplify this project, you can eliminate the square root and reciprocal functions.
The Calculator class design:
Property Description
CurrentValue The result currently displayed by the calculator.
Method Description
EnterValue Enters a value into the calculator. The calculator retains the two most recently entered values.
Add Sets the pending operation to Add.
Subtract Sets the pending operation to Subtract.
Multiply Sets the pending operation to Multiply.
Divide Sets the pending operation to Divide.
Equals Calculates the result of the pending operation.
Reciprocal Calculates the reciprocal of the current value.
SquareRoot Calculates the square root of the current value.
Clear Clears the calculator.
This order does not have tags, yet.
Attachments
No uploads for this question
Explanations and Answers
0
No answers posted
Post your Answer - free or at a fee
NB: Post a homework question for free and get answers - free or paid homework help.
Get answers to: Calculator or similar questions only at Tutlance.
Related Questions
- Data Analytics Hw
- C# .Net Applications That Create A Mortgage Loan Calculator
- Html Css And Javascript
- C# Functions
- Include Irvine32.Inc Project
- Java Program To Write A Program For An Admin To Have Multiple Users And Password
- Java Coding Project
- Very Simple Html Web Programming. Make The Text In The First Paragraph Green, The Second Red, The Third Green
- Writing A Simple Game Program In Java
- Software
- Mips Assembly Program To Check For Odd And Even Parity
- Programming C Project
- Visual Basic 8 Small Assignments In One
- Java Creating A Shape Class
- Python Code
- Predictive Analytics - Final Project
- Bluej(Java)
- Mips Homework Assignment
- Wright Assembly Code
- Need Help With A Java Assignment
- Mips Homework Assignment
- Project 3
- C String Programming Assignment
- Program2
- Tokenize A String
- Can You Help Me To Do My Lab Homework? C++
- Can You Help Me To Do My Small Project? C++
- Introduction To Data Science Assignment
- Csci 1301 Array Code In Drjava
- 8X8 Battleship In C
- C Battleship Project
- Bowling Scores Java
- Online Degrees Visual Basic Assignment
- C++ Timecard Winforms
- Maze Project In Mips Assembly Code
- C++ Battleships Assignment
- Final Project For Neuro Data Programming Class
- C++ And Assembly Battleship Game
- Powershell And Linux
- C Virtual Memory Simulator
- Java Tuition Calculator
- Java
- Javascript
- Javascript Assignment
- Java Exam
- You Will Complete C++ Code For A Tree-Based Data Structure For Storing A Collection Of Strings
- Rent Estimate Model
- C++ Computer Programming Assignment
- Python Assignment
- Website Login / Registration Application