Calculator.java Review And Opinions





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















Here's A Java Calculator Program I Just Made Recently, But It Doesn't Meet My Expectations! I Want It In A More Convenient Way Like It Has 6 Classes And Some Exclamation Marks, I Wanna Get A+ So Please Help Me!



1) Can I loop the codes so after displaying the answer, It runs the code again?
2) Can I somehow decrease the number of classes and the length of codes?
3) Can I clear screen in the console like in C++, So it should display a separate view for the Intro and the answer?



Here's The Code:



import java.util.Scanner;
public class javaCalc {

public static void welcome() {
System.out.println("Welcome to Calculator.java v0.1");
System.out.println("(Developed By RAZ0229)");
}

public static void main(String args) {

welcome();

System.out.flush();
System.out.println("n1) Addition");
System.out.println("2) Substraction");
System.out.println("3) Multiplication");
System.out.println("4) Division");
System.out.println("nChoose A Basic Operator:");

Scanner operandOne = new Scanner(System.in);
int inpOperation = operandOne.nextInt();

switch(inpOperation) {
case 1: additionMethod();
break;

case 2: substractionMethod();
break;

case 3: multiplicationMethod();
break;

case 4: divisionMethod();
break;

default: System.out.println("n(Invalid Argument)");
return;

}

}

public static void additionMethod() {
Scanner operandOne = new Scanner(System.in);
System.out.println("Enter The First Quantity:");
float numOne = operandOne.nextFloat();
System.out.println("Enter The Second Quantity:");
float numTwo = operandOne.nextFloat();
float answer = numOne + numTwo;
System.out.println(numOne + " + " + numTwo + " = " + answer);
}

public static void substractionMethod() {
Scanner operandOne = new Scanner(System.in);
System.out.println("Enter The First Quantity:");
float numOne = operandOne.nextFloat();
System.out.println("Enter The Second Quantity:");
float numTwo = operandOne.nextFloat();
float answer = numOne - numTwo;
System.out.println(numOne + " - " + numTwo + " = " + answer);
}

public static void multiplicationMethod() {
Scanner operandOne = new Scanner(System.in);
System.out.println("Enter The First Quantity:");
float numOne = operandOne.nextFloat();
System.out.println("Enter The Second Quantity:");
float numTwo = operandOne.nextFloat();
float answer = numOne * numTwo;
System.out.println(numOne + " x " + numTwo + " = " + answer);
}

public static void divisionMethod() {
Scanner operandOne = new Scanner(System.in);
System.out.println("Enter The First Quantity:");
float numOne = operandOne.nextFloat();
System.out.println("Enter The Second Quantity:");
float numTwo = operandOne.nextFloat();
float answer = numOne / numTwo;
System.out.println(numOne + " / " + numTwo + " = " + answer);
}
}









share|improve this question























  • Firstly, I am immediately noticing that your operatorMethod() all contain duplicate code. Consider refactoring all this code out.

    – PhaseRush
    Nov 17 '18 at 7:34











  • Also, youve only showed one class here. Did you mean methods, maybe? In addition, you can run this code as many times as possible. You need to abstract-ify the functionality out into a method call, and call this method whenever you need in main.

    – PhaseRush
    Nov 17 '18 at 7:35











  • Reviewing working code is off-topic for Stack Overflow, the question belongs on Code Review

    – greg-449
    Nov 17 '18 at 8:21











  • You should handle invalid inputs by user to make it rebouste. And keep below code in separate method where you will only get and validate the user inputs. Scanner operandOne = new Scanner(System.in); System.out.println("Enter The First Quantity:"); float numOne = operandOne.nextFloat(); System.out.println("Enter The Second Quantity:"); float numTwo = operandOne.nextFloat();

    – Devendra
    Nov 17 '18 at 8:48




















0















Here's A Java Calculator Program I Just Made Recently, But It Doesn't Meet My Expectations! I Want It In A More Convenient Way Like It Has 6 Classes And Some Exclamation Marks, I Wanna Get A+ So Please Help Me!



1) Can I loop the codes so after displaying the answer, It runs the code again?
2) Can I somehow decrease the number of classes and the length of codes?
3) Can I clear screen in the console like in C++, So it should display a separate view for the Intro and the answer?



Here's The Code:



import java.util.Scanner;
public class javaCalc {

public static void welcome() {
System.out.println("Welcome to Calculator.java v0.1");
System.out.println("(Developed By RAZ0229)");
}

public static void main(String args) {

welcome();

System.out.flush();
System.out.println("n1) Addition");
System.out.println("2) Substraction");
System.out.println("3) Multiplication");
System.out.println("4) Division");
System.out.println("nChoose A Basic Operator:");

Scanner operandOne = new Scanner(System.in);
int inpOperation = operandOne.nextInt();

switch(inpOperation) {
case 1: additionMethod();
break;

case 2: substractionMethod();
break;

case 3: multiplicationMethod();
break;

case 4: divisionMethod();
break;

default: System.out.println("n(Invalid Argument)");
return;

}

}

public static void additionMethod() {
Scanner operandOne = new Scanner(System.in);
System.out.println("Enter The First Quantity:");
float numOne = operandOne.nextFloat();
System.out.println("Enter The Second Quantity:");
float numTwo = operandOne.nextFloat();
float answer = numOne + numTwo;
System.out.println(numOne + " + " + numTwo + " = " + answer);
}

public static void substractionMethod() {
Scanner operandOne = new Scanner(System.in);
System.out.println("Enter The First Quantity:");
float numOne = operandOne.nextFloat();
System.out.println("Enter The Second Quantity:");
float numTwo = operandOne.nextFloat();
float answer = numOne - numTwo;
System.out.println(numOne + " - " + numTwo + " = " + answer);
}

public static void multiplicationMethod() {
Scanner operandOne = new Scanner(System.in);
System.out.println("Enter The First Quantity:");
float numOne = operandOne.nextFloat();
System.out.println("Enter The Second Quantity:");
float numTwo = operandOne.nextFloat();
float answer = numOne * numTwo;
System.out.println(numOne + " x " + numTwo + " = " + answer);
}

public static void divisionMethod() {
Scanner operandOne = new Scanner(System.in);
System.out.println("Enter The First Quantity:");
float numOne = operandOne.nextFloat();
System.out.println("Enter The Second Quantity:");
float numTwo = operandOne.nextFloat();
float answer = numOne / numTwo;
System.out.println(numOne + " / " + numTwo + " = " + answer);
}
}









share|improve this question























  • Firstly, I am immediately noticing that your operatorMethod() all contain duplicate code. Consider refactoring all this code out.

    – PhaseRush
    Nov 17 '18 at 7:34











  • Also, youve only showed one class here. Did you mean methods, maybe? In addition, you can run this code as many times as possible. You need to abstract-ify the functionality out into a method call, and call this method whenever you need in main.

    – PhaseRush
    Nov 17 '18 at 7:35











  • Reviewing working code is off-topic for Stack Overflow, the question belongs on Code Review

    – greg-449
    Nov 17 '18 at 8:21











  • You should handle invalid inputs by user to make it rebouste. And keep below code in separate method where you will only get and validate the user inputs. Scanner operandOne = new Scanner(System.in); System.out.println("Enter The First Quantity:"); float numOne = operandOne.nextFloat(); System.out.println("Enter The Second Quantity:"); float numTwo = operandOne.nextFloat();

    – Devendra
    Nov 17 '18 at 8:48
















0












0








0


1






Here's A Java Calculator Program I Just Made Recently, But It Doesn't Meet My Expectations! I Want It In A More Convenient Way Like It Has 6 Classes And Some Exclamation Marks, I Wanna Get A+ So Please Help Me!



1) Can I loop the codes so after displaying the answer, It runs the code again?
2) Can I somehow decrease the number of classes and the length of codes?
3) Can I clear screen in the console like in C++, So it should display a separate view for the Intro and the answer?



Here's The Code:



import java.util.Scanner;
public class javaCalc {

public static void welcome() {
System.out.println("Welcome to Calculator.java v0.1");
System.out.println("(Developed By RAZ0229)");
}

public static void main(String args) {

welcome();

System.out.flush();
System.out.println("n1) Addition");
System.out.println("2) Substraction");
System.out.println("3) Multiplication");
System.out.println("4) Division");
System.out.println("nChoose A Basic Operator:");

Scanner operandOne = new Scanner(System.in);
int inpOperation = operandOne.nextInt();

switch(inpOperation) {
case 1: additionMethod();
break;

case 2: substractionMethod();
break;

case 3: multiplicationMethod();
break;

case 4: divisionMethod();
break;

default: System.out.println("n(Invalid Argument)");
return;

}

}

public static void additionMethod() {
Scanner operandOne = new Scanner(System.in);
System.out.println("Enter The First Quantity:");
float numOne = operandOne.nextFloat();
System.out.println("Enter The Second Quantity:");
float numTwo = operandOne.nextFloat();
float answer = numOne + numTwo;
System.out.println(numOne + " + " + numTwo + " = " + answer);
}

public static void substractionMethod() {
Scanner operandOne = new Scanner(System.in);
System.out.println("Enter The First Quantity:");
float numOne = operandOne.nextFloat();
System.out.println("Enter The Second Quantity:");
float numTwo = operandOne.nextFloat();
float answer = numOne - numTwo;
System.out.println(numOne + " - " + numTwo + " = " + answer);
}

public static void multiplicationMethod() {
Scanner operandOne = new Scanner(System.in);
System.out.println("Enter The First Quantity:");
float numOne = operandOne.nextFloat();
System.out.println("Enter The Second Quantity:");
float numTwo = operandOne.nextFloat();
float answer = numOne * numTwo;
System.out.println(numOne + " x " + numTwo + " = " + answer);
}

public static void divisionMethod() {
Scanner operandOne = new Scanner(System.in);
System.out.println("Enter The First Quantity:");
float numOne = operandOne.nextFloat();
System.out.println("Enter The Second Quantity:");
float numTwo = operandOne.nextFloat();
float answer = numOne / numTwo;
System.out.println(numOne + " / " + numTwo + " = " + answer);
}
}









share|improve this question














Here's A Java Calculator Program I Just Made Recently, But It Doesn't Meet My Expectations! I Want It In A More Convenient Way Like It Has 6 Classes And Some Exclamation Marks, I Wanna Get A+ So Please Help Me!



1) Can I loop the codes so after displaying the answer, It runs the code again?
2) Can I somehow decrease the number of classes and the length of codes?
3) Can I clear screen in the console like in C++, So it should display a separate view for the Intro and the answer?



Here's The Code:



import java.util.Scanner;
public class javaCalc {

public static void welcome() {
System.out.println("Welcome to Calculator.java v0.1");
System.out.println("(Developed By RAZ0229)");
}

public static void main(String args) {

welcome();

System.out.flush();
System.out.println("n1) Addition");
System.out.println("2) Substraction");
System.out.println("3) Multiplication");
System.out.println("4) Division");
System.out.println("nChoose A Basic Operator:");

Scanner operandOne = new Scanner(System.in);
int inpOperation = operandOne.nextInt();

switch(inpOperation) {
case 1: additionMethod();
break;

case 2: substractionMethod();
break;

case 3: multiplicationMethod();
break;

case 4: divisionMethod();
break;

default: System.out.println("n(Invalid Argument)");
return;

}

}

public static void additionMethod() {
Scanner operandOne = new Scanner(System.in);
System.out.println("Enter The First Quantity:");
float numOne = operandOne.nextFloat();
System.out.println("Enter The Second Quantity:");
float numTwo = operandOne.nextFloat();
float answer = numOne + numTwo;
System.out.println(numOne + " + " + numTwo + " = " + answer);
}

public static void substractionMethod() {
Scanner operandOne = new Scanner(System.in);
System.out.println("Enter The First Quantity:");
float numOne = operandOne.nextFloat();
System.out.println("Enter The Second Quantity:");
float numTwo = operandOne.nextFloat();
float answer = numOne - numTwo;
System.out.println(numOne + " - " + numTwo + " = " + answer);
}

public static void multiplicationMethod() {
Scanner operandOne = new Scanner(System.in);
System.out.println("Enter The First Quantity:");
float numOne = operandOne.nextFloat();
System.out.println("Enter The Second Quantity:");
float numTwo = operandOne.nextFloat();
float answer = numOne * numTwo;
System.out.println(numOne + " x " + numTwo + " = " + answer);
}

public static void divisionMethod() {
Scanner operandOne = new Scanner(System.in);
System.out.println("Enter The First Quantity:");
float numOne = operandOne.nextFloat();
System.out.println("Enter The Second Quantity:");
float numTwo = operandOne.nextFloat();
float answer = numOne / numTwo;
System.out.println(numOne + " / " + numTwo + " = " + answer);
}
}






java eclipse class calculator cls






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 17 '18 at 7:28









RAZ0229RAZ0229

31




31













  • Firstly, I am immediately noticing that your operatorMethod() all contain duplicate code. Consider refactoring all this code out.

    – PhaseRush
    Nov 17 '18 at 7:34











  • Also, youve only showed one class here. Did you mean methods, maybe? In addition, you can run this code as many times as possible. You need to abstract-ify the functionality out into a method call, and call this method whenever you need in main.

    – PhaseRush
    Nov 17 '18 at 7:35











  • Reviewing working code is off-topic for Stack Overflow, the question belongs on Code Review

    – greg-449
    Nov 17 '18 at 8:21











  • You should handle invalid inputs by user to make it rebouste. And keep below code in separate method where you will only get and validate the user inputs. Scanner operandOne = new Scanner(System.in); System.out.println("Enter The First Quantity:"); float numOne = operandOne.nextFloat(); System.out.println("Enter The Second Quantity:"); float numTwo = operandOne.nextFloat();

    – Devendra
    Nov 17 '18 at 8:48





















  • Firstly, I am immediately noticing that your operatorMethod() all contain duplicate code. Consider refactoring all this code out.

    – PhaseRush
    Nov 17 '18 at 7:34











  • Also, youve only showed one class here. Did you mean methods, maybe? In addition, you can run this code as many times as possible. You need to abstract-ify the functionality out into a method call, and call this method whenever you need in main.

    – PhaseRush
    Nov 17 '18 at 7:35











  • Reviewing working code is off-topic for Stack Overflow, the question belongs on Code Review

    – greg-449
    Nov 17 '18 at 8:21











  • You should handle invalid inputs by user to make it rebouste. And keep below code in separate method where you will only get and validate the user inputs. Scanner operandOne = new Scanner(System.in); System.out.println("Enter The First Quantity:"); float numOne = operandOne.nextFloat(); System.out.println("Enter The Second Quantity:"); float numTwo = operandOne.nextFloat();

    – Devendra
    Nov 17 '18 at 8:48



















Firstly, I am immediately noticing that your operatorMethod() all contain duplicate code. Consider refactoring all this code out.

– PhaseRush
Nov 17 '18 at 7:34





Firstly, I am immediately noticing that your operatorMethod() all contain duplicate code. Consider refactoring all this code out.

– PhaseRush
Nov 17 '18 at 7:34













Also, youve only showed one class here. Did you mean methods, maybe? In addition, you can run this code as many times as possible. You need to abstract-ify the functionality out into a method call, and call this method whenever you need in main.

– PhaseRush
Nov 17 '18 at 7:35





Also, youve only showed one class here. Did you mean methods, maybe? In addition, you can run this code as many times as possible. You need to abstract-ify the functionality out into a method call, and call this method whenever you need in main.

– PhaseRush
Nov 17 '18 at 7:35













Reviewing working code is off-topic for Stack Overflow, the question belongs on Code Review

– greg-449
Nov 17 '18 at 8:21





Reviewing working code is off-topic for Stack Overflow, the question belongs on Code Review

– greg-449
Nov 17 '18 at 8:21













You should handle invalid inputs by user to make it rebouste. And keep below code in separate method where you will only get and validate the user inputs. Scanner operandOne = new Scanner(System.in); System.out.println("Enter The First Quantity:"); float numOne = operandOne.nextFloat(); System.out.println("Enter The Second Quantity:"); float numTwo = operandOne.nextFloat();

– Devendra
Nov 17 '18 at 8:48







You should handle invalid inputs by user to make it rebouste. And keep below code in separate method where you will only get and validate the user inputs. Scanner operandOne = new Scanner(System.in); System.out.println("Enter The First Quantity:"); float numOne = operandOne.nextFloat(); System.out.println("Enter The Second Quantity:"); float numTwo = operandOne.nextFloat();

– Devendra
Nov 17 '18 at 8:48














1 Answer
1






active

oldest

votes


















0














You are asking for two floats in every method and using the same prints many times, so you can just create some method such as this and call it inside your operation method to stop repeating code (constantly repeated blocks of code is a strong indicator that the block can probably be abstracted into its own method):



public static float getValues(){
float values;

/*Implement your logic here asking user for floats, then put into above array
and do calculations in your methods using float array*/

return values;
}


You can also loop your main by wrapping it in a while loop and adding an extra case to your switch statement like so (if you would like to exit program, enter 5):



public static void main(String args) {

welcome();

while (true){
System.out.flush();
System.out.println("n1) Addition");
System.out.println("2) Substraction");
System.out.println("3) Multiplication");
System.out.println("4) Division");
System.out.println("5) Quit");
System.out.println("nChoose A Basic Operator:");

Scanner operandOne = new Scanner(System.in);
int inpOperation = operandOne.nextInt();

switch(inpOperation) {
case 1: additionMethod();
break;

case 2: substractionMethod();
break;

case 3: multiplicationMethod();
break;

case 4: divisionMethod();
break;

case 5: System.exit(0);

default: System.out.println("n(Invalid Argument)");
return;
}
}
}





share|improve this answer


























  • Thanks, That just worked out fine... And sorry for the mess up there. I meant methods, not classes!

    – RAZ0229
    Nov 17 '18 at 17:46











  • @raz0229 No problem. You should mark this question as answered

    – M.G
    Nov 17 '18 at 18:11














Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53349168%2fcalculator-java-review-and-opinions%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














You are asking for two floats in every method and using the same prints many times, so you can just create some method such as this and call it inside your operation method to stop repeating code (constantly repeated blocks of code is a strong indicator that the block can probably be abstracted into its own method):



public static float getValues(){
float values;

/*Implement your logic here asking user for floats, then put into above array
and do calculations in your methods using float array*/

return values;
}


You can also loop your main by wrapping it in a while loop and adding an extra case to your switch statement like so (if you would like to exit program, enter 5):



public static void main(String args) {

welcome();

while (true){
System.out.flush();
System.out.println("n1) Addition");
System.out.println("2) Substraction");
System.out.println("3) Multiplication");
System.out.println("4) Division");
System.out.println("5) Quit");
System.out.println("nChoose A Basic Operator:");

Scanner operandOne = new Scanner(System.in);
int inpOperation = operandOne.nextInt();

switch(inpOperation) {
case 1: additionMethod();
break;

case 2: substractionMethod();
break;

case 3: multiplicationMethod();
break;

case 4: divisionMethod();
break;

case 5: System.exit(0);

default: System.out.println("n(Invalid Argument)");
return;
}
}
}





share|improve this answer


























  • Thanks, That just worked out fine... And sorry for the mess up there. I meant methods, not classes!

    – RAZ0229
    Nov 17 '18 at 17:46











  • @raz0229 No problem. You should mark this question as answered

    – M.G
    Nov 17 '18 at 18:11


















0














You are asking for two floats in every method and using the same prints many times, so you can just create some method such as this and call it inside your operation method to stop repeating code (constantly repeated blocks of code is a strong indicator that the block can probably be abstracted into its own method):



public static float getValues(){
float values;

/*Implement your logic here asking user for floats, then put into above array
and do calculations in your methods using float array*/

return values;
}


You can also loop your main by wrapping it in a while loop and adding an extra case to your switch statement like so (if you would like to exit program, enter 5):



public static void main(String args) {

welcome();

while (true){
System.out.flush();
System.out.println("n1) Addition");
System.out.println("2) Substraction");
System.out.println("3) Multiplication");
System.out.println("4) Division");
System.out.println("5) Quit");
System.out.println("nChoose A Basic Operator:");

Scanner operandOne = new Scanner(System.in);
int inpOperation = operandOne.nextInt();

switch(inpOperation) {
case 1: additionMethod();
break;

case 2: substractionMethod();
break;

case 3: multiplicationMethod();
break;

case 4: divisionMethod();
break;

case 5: System.exit(0);

default: System.out.println("n(Invalid Argument)");
return;
}
}
}





share|improve this answer


























  • Thanks, That just worked out fine... And sorry for the mess up there. I meant methods, not classes!

    – RAZ0229
    Nov 17 '18 at 17:46











  • @raz0229 No problem. You should mark this question as answered

    – M.G
    Nov 17 '18 at 18:11
















0












0








0







You are asking for two floats in every method and using the same prints many times, so you can just create some method such as this and call it inside your operation method to stop repeating code (constantly repeated blocks of code is a strong indicator that the block can probably be abstracted into its own method):



public static float getValues(){
float values;

/*Implement your logic here asking user for floats, then put into above array
and do calculations in your methods using float array*/

return values;
}


You can also loop your main by wrapping it in a while loop and adding an extra case to your switch statement like so (if you would like to exit program, enter 5):



public static void main(String args) {

welcome();

while (true){
System.out.flush();
System.out.println("n1) Addition");
System.out.println("2) Substraction");
System.out.println("3) Multiplication");
System.out.println("4) Division");
System.out.println("5) Quit");
System.out.println("nChoose A Basic Operator:");

Scanner operandOne = new Scanner(System.in);
int inpOperation = operandOne.nextInt();

switch(inpOperation) {
case 1: additionMethod();
break;

case 2: substractionMethod();
break;

case 3: multiplicationMethod();
break;

case 4: divisionMethod();
break;

case 5: System.exit(0);

default: System.out.println("n(Invalid Argument)");
return;
}
}
}





share|improve this answer















You are asking for two floats in every method and using the same prints many times, so you can just create some method such as this and call it inside your operation method to stop repeating code (constantly repeated blocks of code is a strong indicator that the block can probably be abstracted into its own method):



public static float getValues(){
float values;

/*Implement your logic here asking user for floats, then put into above array
and do calculations in your methods using float array*/

return values;
}


You can also loop your main by wrapping it in a while loop and adding an extra case to your switch statement like so (if you would like to exit program, enter 5):



public static void main(String args) {

welcome();

while (true){
System.out.flush();
System.out.println("n1) Addition");
System.out.println("2) Substraction");
System.out.println("3) Multiplication");
System.out.println("4) Division");
System.out.println("5) Quit");
System.out.println("nChoose A Basic Operator:");

Scanner operandOne = new Scanner(System.in);
int inpOperation = operandOne.nextInt();

switch(inpOperation) {
case 1: additionMethod();
break;

case 2: substractionMethod();
break;

case 3: multiplicationMethod();
break;

case 4: divisionMethod();
break;

case 5: System.exit(0);

default: System.out.println("n(Invalid Argument)");
return;
}
}
}






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 17 '18 at 7:52

























answered Nov 17 '18 at 7:38









M.GM.G

388310




388310













  • Thanks, That just worked out fine... And sorry for the mess up there. I meant methods, not classes!

    – RAZ0229
    Nov 17 '18 at 17:46











  • @raz0229 No problem. You should mark this question as answered

    – M.G
    Nov 17 '18 at 18:11





















  • Thanks, That just worked out fine... And sorry for the mess up there. I meant methods, not classes!

    – RAZ0229
    Nov 17 '18 at 17:46











  • @raz0229 No problem. You should mark this question as answered

    – M.G
    Nov 17 '18 at 18:11



















Thanks, That just worked out fine... And sorry for the mess up there. I meant methods, not classes!

– RAZ0229
Nov 17 '18 at 17:46





Thanks, That just worked out fine... And sorry for the mess up there. I meant methods, not classes!

– RAZ0229
Nov 17 '18 at 17:46













@raz0229 No problem. You should mark this question as answered

– M.G
Nov 17 '18 at 18:11







@raz0229 No problem. You should mark this question as answered

– M.G
Nov 17 '18 at 18:11






















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53349168%2fcalculator-java-review-and-opinions%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Bressuire

Vorschmack

Quarantine