Skip to content

4-function calculator and non-automated unit tests. The calculator gets 2 integer inputs from the user, then calculate the result of addition, subtraction, multiplication, and division. method for each of the 4 operations -- addition, subtraction, multiplication, division

Notifications You must be signed in to change notification settings

bell-kevin/FourFunctionCalcProject

 
 

Repository files navigation

FourFunctionCalcProject

SDEV 1060 Project

You have already done an exercise to create a table of test cases for a four-function calculator. In this project, you will actually create that calculator and its unit tests.

The calculator will get 2 integer inputs from the user, then calculate the result of addition, subtraction, multiplication, and division.

You don't need to write the code to create that part of the project -- you will be testing the methods that perform the calculations, not the user interface. Write a method for each of the 4 operations -- addition, subtraction, multiplication, division; all methods need 2 parameters for the input values. These calculation methods can be in a class for math operations, or can be static methods in the main class -- your choice. The calculator can handle 2-digit numbers for input, negative and positive, so the range of input is -99 to 99, inclusive.

Create unit tests for each calculation method. Use multiple assert statements in each test method, using the data from the test cases created previously. There must be at least 10 test cases and assertions for each calculation, testing the happy path and edge cases.

Run the tests and take a screenshot of the successful results. Take screenshots of the code for all of the unit tests as well as the code for the methods for calculation.

Submission: table of test cases, specified screenshots, and the root folder for the project.

== We're Using GitHub Under Protest ==

This project is currently hosted on GitHub. This is not ideal; GitHub is a proprietary, trade-secret system that is not Free and Open Souce Software (FOSS). We are deeply concerned about using a proprietary system like GitHub to develop our FOSS project. We have an open {bug ticket, mailing list thread, etc.} where the project contributors are actively discussing how we can move away from GitHub in the long term. We urge you to read about the Give up GitHub campaign from the Software Freedom Conservancy to understand some of the reasons why GitHub is not a good place to host FOSS projects.

If you are a contributor who personally has already quit using GitHub, please check this resource for how to send us contributions without using GitHub directly.

Any use of this project's code by GitHub Copilot, past or present, is done without our permission. We do not consent to GitHub's use of this project's code in Copilot.

Logo of the GiveUpGitHub campaign

About

4-function calculator and non-automated unit tests. The calculator gets 2 integer inputs from the user, then calculate the result of addition, subtraction, multiplication, and division. method for each of the 4 operations -- addition, subtraction, multiplication, division

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%