Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork, Commit, Merge - Medium Issue (Java) #422

Closed
nikohoffren opened this issue Sep 3, 2023 · 1 comment
Closed

Fork, Commit, Merge - Medium Issue (Java) #422

nikohoffren opened this issue Sep 3, 2023 · 1 comment

Comments

@nikohoffren
Copy link
Member

Fork, Commit, Merge - Medium Issue (Java)

Create a Calculator in Java

Note: You don't have ask permission to start solving the issue or get assigned, since these issues are supposed to be always open for new contributors. The actions-user bot will reset the file back to previous state for the next contributor after your commit is merged. So you can just simply start working with the issue right away!

Navigate to the tasks/java/medium directory from the root of your project.
Then open a file called Calculator.java and start implementing the Calculator class!

Description:

Create a simple calculator class in Java that performs basic operations: addition, subtraction, multiplication, and division.

Requirements:

  • The calculator class should have methods called add, subtract, multiply and divide.
  • The calculator should be able to handle both integers and floating-point numbers.

Don't modify the code in the main method! It contains bunch of tests that will run when the program is executed.

How to run:

Make sure you are in the right directory:

cd tasks/java/medium

Compile the program:

javac Calculator.java

Run the compiled program:

java Calculator.java

Expected output:

Addition: 8.0
Subtraction: 2.0
Multiplication: 15.0
Division: 1.6666666666666667

If the program works as requested in the task, you are ready to make a pull request!


To work with this issue, you need to have Java installed to your local machine.
Check out README.md for more instructions of installing Java and how to make a pull request.

Feel free to ask any questions here if you have some problems!

Also, kindly give this project a star to enhance its visibility for new developers!

RashakDude added a commit to RashakDude/fork-commit-merge that referenced this issue Sep 12, 2023
@RashakDude
Copy link
Contributor

Hi @nikohoffren, Please check #520

nikohoffren added a commit that referenced this issue Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants