SlideShare a Scribd company logo
1 of 1
Why is this code not working (java)
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
System.out.println("Would you like to add, subtract, multiply, or divide?");
String choice = input.next();
System.out.println("Pick an integer number:");
int n1 = input.nextInt();
System.out.println("Pick an integer number:");
int n2 = input.nextInt();
int r1 = Calculations.generateRandomNum(n1, n2);
int r2 = Calculations.generateRandomNum(n1, n2);
switch (choice){
case "add":
System.out.println(r1 + "+" + r2 + "=" + Calculations.add(r1, r2));
break;
case "subtract":
System.out.println(r1 + "-" + r2 + "=" + Calculations.subtract(r1, r2));
break;
case "multiply":
System.out.println(r1 + "*" + r2 + "=" + Calculations.multiply(r1, r2));
break;
case "divide":
System.out.println(r1 + "/" + r2 + "=" + Calculations.divide(r1, r2));
break;
default:
System.out.println("Invalid");
break;
}
}
}

More Related Content

Similar to Why is this code not working (java) public static void main(Stri.docx

Import java
Import javaImport java
Import javaheni2121
 
DS LAB RECORD.docx
DS LAB RECORD.docxDS LAB RECORD.docx
DS LAB RECORD.docxdavinci54
 
java program assigment -2
java program assigment -2java program assigment -2
java program assigment -2Ankit Gupta
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple ProgramsUpender Upr
 
java programming cheatsheet
java programming cheatsheetjava programming cheatsheet
java programming cheatsheetBD AB
 
Presentation1 computer shaan
Presentation1 computer shaanPresentation1 computer shaan
Presentation1 computer shaanwalia Shaan
 
PrimeRange.java import java.util.Scanner;public class PrimeRan.pdf
PrimeRange.java import java.util.Scanner;public class PrimeRan.pdfPrimeRange.java import java.util.Scanner;public class PrimeRan.pdf
PrimeRange.java import java.util.Scanner;public class PrimeRan.pdfAnkitchhabra28
 
ch03-parameters-objects.ppt
ch03-parameters-objects.pptch03-parameters-objects.ppt
ch03-parameters-objects.pptMahyuddin8
 

Similar to Why is this code not working (java) public static void main(Stri.docx (11)

Java file
Java fileJava file
Java file
 
Import java
Import javaImport java
Import java
 
DS LAB RECORD.docx
DS LAB RECORD.docxDS LAB RECORD.docx
DS LAB RECORD.docx
 
java program assigment -2
java program assigment -2java program assigment -2
java program assigment -2
 
Programs of java
Programs of javaPrograms of java
Programs of java
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple Programs
 
LAB1.docx
LAB1.docxLAB1.docx
LAB1.docx
 
java programming cheatsheet
java programming cheatsheetjava programming cheatsheet
java programming cheatsheet
 
Presentation1 computer shaan
Presentation1 computer shaanPresentation1 computer shaan
Presentation1 computer shaan
 
PrimeRange.java import java.util.Scanner;public class PrimeRan.pdf
PrimeRange.java import java.util.Scanner;public class PrimeRan.pdfPrimeRange.java import java.util.Scanner;public class PrimeRan.pdf
PrimeRange.java import java.util.Scanner;public class PrimeRan.pdf
 
ch03-parameters-objects.ppt
ch03-parameters-objects.pptch03-parameters-objects.ppt
ch03-parameters-objects.ppt
 

More from maximapikvu8

Wings of birds and wings of insects are---It is a 12 letter word in a.docx
Wings of birds and wings of insects are---It is a 12 letter word in a.docxWings of birds and wings of insects are---It is a 12 letter word in a.docx
Wings of birds and wings of insects are---It is a 12 letter word in a.docxmaximapikvu8
 
Windows provides a very simple mechanism for sharing files among users.docx
Windows provides a very simple mechanism for sharing files among users.docxWindows provides a very simple mechanism for sharing files among users.docx
Windows provides a very simple mechanism for sharing files among users.docxmaximapikvu8
 
Why was Pericles an important figure- in the City of Athens- 2- Clearl.docx
Why was Pericles an important figure- in the City of Athens- 2- Clearl.docxWhy was Pericles an important figure- in the City of Athens- 2- Clearl.docx
Why was Pericles an important figure- in the City of Athens- 2- Clearl.docxmaximapikvu8
 
why is this error showing what have i done wrong Declunilearetant v.docx
why is this error showing what have i done wrong    Declunilearetant v.docxwhy is this error showing what have i done wrong    Declunilearetant v.docx
why is this error showing what have i done wrong Declunilearetant v.docxmaximapikvu8
 
Why is this error showing NewAge2-java-17- error- cannot find symbol n.docx
Why is this error showing NewAge2-java-17- error- cannot find symbol n.docxWhy is this error showing NewAge2-java-17- error- cannot find symbol n.docx
Why is this error showing NewAge2-java-17- error- cannot find symbol n.docxmaximapikvu8
 
Why is it important to reduce disulfide linkages prior to SDS electrop.docx
Why is it important to reduce disulfide linkages prior to SDS electrop.docxWhy is it important to reduce disulfide linkages prior to SDS electrop.docx
Why is it important to reduce disulfide linkages prior to SDS electrop.docxmaximapikvu8
 
Why do statisticians prefer to select samples by a random process- Que.docx
Why do statisticians prefer to select samples by a random process- Que.docxWhy do statisticians prefer to select samples by a random process- Que.docx
Why do statisticians prefer to select samples by a random process- Que.docxmaximapikvu8
 
Why do employers ask for demographic information- (select all that app.docx
Why do employers ask for demographic information- (select all that app.docxWhy do employers ask for demographic information- (select all that app.docx
Why do employers ask for demographic information- (select all that app.docxmaximapikvu8
 
Why can bio-prospecting be controversial- Species are frequently drive.docx
Why can bio-prospecting be controversial- Species are frequently drive.docxWhy can bio-prospecting be controversial- Species are frequently drive.docx
Why can bio-prospecting be controversial- Species are frequently drive.docxmaximapikvu8
 
Why did Malthus's predictions was not realized for most of the develop.docx
Why did Malthus's predictions was not realized for most of the develop.docxWhy did Malthus's predictions was not realized for most of the develop.docx
Why did Malthus's predictions was not realized for most of the develop.docxmaximapikvu8
 
Why are accessory pigments important- A- They are a rich source of ele.docx
Why are accessory pigments important- A- They are a rich source of ele.docxWhy are accessory pigments important- A- They are a rich source of ele.docx
Why are accessory pigments important- A- They are a rich source of ele.docxmaximapikvu8
 
Which xml tag defines global parameters available to all servlets in t.docx
Which xml tag defines global parameters available to all servlets in t.docxWhich xml tag defines global parameters available to all servlets in t.docx
Which xml tag defines global parameters available to all servlets in t.docxmaximapikvu8
 
While using K-means clustering- we scale the variables before we do cl.docx
While using K-means clustering- we scale the variables before we do cl.docxWhile using K-means clustering- we scale the variables before we do cl.docx
While using K-means clustering- we scale the variables before we do cl.docxmaximapikvu8
 
Which statements about chromosomal organization are true and which are.docx
Which statements about chromosomal organization are true and which are.docxWhich statements about chromosomal organization are true and which are.docx
Which statements about chromosomal organization are true and which are.docxmaximapikvu8
 
Which statement below best compares the lithosphere to the crust accor.docx
Which statement below best compares the lithosphere to the crust accor.docxWhich statement below best compares the lithosphere to the crust accor.docx
Which statement below best compares the lithosphere to the crust accor.docxmaximapikvu8
 
Which statement about education as a demographic factor is accurate- M.docx
Which statement about education as a demographic factor is accurate- M.docxWhich statement about education as a demographic factor is accurate- M.docx
Which statement about education as a demographic factor is accurate- M.docxmaximapikvu8
 
Which pairing of microorganism and bioremediation application is NOT c.docx
Which pairing of microorganism and bioremediation application is NOT c.docxWhich pairing of microorganism and bioremediation application is NOT c.docx
Which pairing of microorganism and bioremediation application is NOT c.docxmaximapikvu8
 
Which scenario is most likely to maintain trait variation in a populat.docx
Which scenario is most likely to maintain trait variation in a populat.docxWhich scenario is most likely to maintain trait variation in a populat.docx
Which scenario is most likely to maintain trait variation in a populat.docxmaximapikvu8
 
Which research finding best indicates that a moderator variable was op.docx
Which research finding best indicates that a moderator variable was op.docxWhich research finding best indicates that a moderator variable was op.docx
Which research finding best indicates that a moderator variable was op.docxmaximapikvu8
 
Which organelles originated from the engulfment of ancestral prokaryti.docx
Which organelles originated from the engulfment of ancestral prokaryti.docxWhich organelles originated from the engulfment of ancestral prokaryti.docx
Which organelles originated from the engulfment of ancestral prokaryti.docxmaximapikvu8
 

More from maximapikvu8 (20)

Wings of birds and wings of insects are---It is a 12 letter word in a.docx
Wings of birds and wings of insects are---It is a 12 letter word in a.docxWings of birds and wings of insects are---It is a 12 letter word in a.docx
Wings of birds and wings of insects are---It is a 12 letter word in a.docx
 
Windows provides a very simple mechanism for sharing files among users.docx
Windows provides a very simple mechanism for sharing files among users.docxWindows provides a very simple mechanism for sharing files among users.docx
Windows provides a very simple mechanism for sharing files among users.docx
 
Why was Pericles an important figure- in the City of Athens- 2- Clearl.docx
Why was Pericles an important figure- in the City of Athens- 2- Clearl.docxWhy was Pericles an important figure- in the City of Athens- 2- Clearl.docx
Why was Pericles an important figure- in the City of Athens- 2- Clearl.docx
 
why is this error showing what have i done wrong Declunilearetant v.docx
why is this error showing what have i done wrong    Declunilearetant v.docxwhy is this error showing what have i done wrong    Declunilearetant v.docx
why is this error showing what have i done wrong Declunilearetant v.docx
 
Why is this error showing NewAge2-java-17- error- cannot find symbol n.docx
Why is this error showing NewAge2-java-17- error- cannot find symbol n.docxWhy is this error showing NewAge2-java-17- error- cannot find symbol n.docx
Why is this error showing NewAge2-java-17- error- cannot find symbol n.docx
 
Why is it important to reduce disulfide linkages prior to SDS electrop.docx
Why is it important to reduce disulfide linkages prior to SDS electrop.docxWhy is it important to reduce disulfide linkages prior to SDS electrop.docx
Why is it important to reduce disulfide linkages prior to SDS electrop.docx
 
Why do statisticians prefer to select samples by a random process- Que.docx
Why do statisticians prefer to select samples by a random process- Que.docxWhy do statisticians prefer to select samples by a random process- Que.docx
Why do statisticians prefer to select samples by a random process- Que.docx
 
Why do employers ask for demographic information- (select all that app.docx
Why do employers ask for demographic information- (select all that app.docxWhy do employers ask for demographic information- (select all that app.docx
Why do employers ask for demographic information- (select all that app.docx
 
Why can bio-prospecting be controversial- Species are frequently drive.docx
Why can bio-prospecting be controversial- Species are frequently drive.docxWhy can bio-prospecting be controversial- Species are frequently drive.docx
Why can bio-prospecting be controversial- Species are frequently drive.docx
 
Why did Malthus's predictions was not realized for most of the develop.docx
Why did Malthus's predictions was not realized for most of the develop.docxWhy did Malthus's predictions was not realized for most of the develop.docx
Why did Malthus's predictions was not realized for most of the develop.docx
 
Why are accessory pigments important- A- They are a rich source of ele.docx
Why are accessory pigments important- A- They are a rich source of ele.docxWhy are accessory pigments important- A- They are a rich source of ele.docx
Why are accessory pigments important- A- They are a rich source of ele.docx
 
Which xml tag defines global parameters available to all servlets in t.docx
Which xml tag defines global parameters available to all servlets in t.docxWhich xml tag defines global parameters available to all servlets in t.docx
Which xml tag defines global parameters available to all servlets in t.docx
 
While using K-means clustering- we scale the variables before we do cl.docx
While using K-means clustering- we scale the variables before we do cl.docxWhile using K-means clustering- we scale the variables before we do cl.docx
While using K-means clustering- we scale the variables before we do cl.docx
 
Which statements about chromosomal organization are true and which are.docx
Which statements about chromosomal organization are true and which are.docxWhich statements about chromosomal organization are true and which are.docx
Which statements about chromosomal organization are true and which are.docx
 
Which statement below best compares the lithosphere to the crust accor.docx
Which statement below best compares the lithosphere to the crust accor.docxWhich statement below best compares the lithosphere to the crust accor.docx
Which statement below best compares the lithosphere to the crust accor.docx
 
Which statement about education as a demographic factor is accurate- M.docx
Which statement about education as a demographic factor is accurate- M.docxWhich statement about education as a demographic factor is accurate- M.docx
Which statement about education as a demographic factor is accurate- M.docx
 
Which pairing of microorganism and bioremediation application is NOT c.docx
Which pairing of microorganism and bioremediation application is NOT c.docxWhich pairing of microorganism and bioremediation application is NOT c.docx
Which pairing of microorganism and bioremediation application is NOT c.docx
 
Which scenario is most likely to maintain trait variation in a populat.docx
Which scenario is most likely to maintain trait variation in a populat.docxWhich scenario is most likely to maintain trait variation in a populat.docx
Which scenario is most likely to maintain trait variation in a populat.docx
 
Which research finding best indicates that a moderator variable was op.docx
Which research finding best indicates that a moderator variable was op.docxWhich research finding best indicates that a moderator variable was op.docx
Which research finding best indicates that a moderator variable was op.docx
 
Which organelles originated from the engulfment of ancestral prokaryti.docx
Which organelles originated from the engulfment of ancestral prokaryti.docxWhich organelles originated from the engulfment of ancestral prokaryti.docx
Which organelles originated from the engulfment of ancestral prokaryti.docx
 

Recently uploaded

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 

Recently uploaded (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 

Why is this code not working (java) public static void main(Stri.docx

  • 1. Why is this code not working (java) public static void main(String[] args) { Scanner input = new Scanner (System.in); System.out.println("Would you like to add, subtract, multiply, or divide?"); String choice = input.next(); System.out.println("Pick an integer number:"); int n1 = input.nextInt(); System.out.println("Pick an integer number:"); int n2 = input.nextInt(); int r1 = Calculations.generateRandomNum(n1, n2); int r2 = Calculations.generateRandomNum(n1, n2); switch (choice){ case "add": System.out.println(r1 + "+" + r2 + "=" + Calculations.add(r1, r2)); break; case "subtract": System.out.println(r1 + "-" + r2 + "=" + Calculations.subtract(r1, r2)); break; case "multiply": System.out.println(r1 + "*" + r2 + "=" + Calculations.multiply(r1, r2)); break; case "divide": System.out.println(r1 + "/" + r2 + "=" + Calculations.divide(r1, r2)); break; default: System.out.println("Invalid"); break; } } }