Java Assignment, The problem I am having is that I can’t get themenu to return after each user selection. The only time it doesthat is when a user makes an invalid choice. That part workscorrectly. It also needs to close if the person makes threeincorrect selections in a row.
import java.util.Random;
import java.util.Scanner;
public class CalculatorWithMethods {
// scanner object creation
static Scanner input = new Scanner(System.in);
boolean mainloop = true;
public static void main(String[] args) {
//Declaring variables
double res;
int choice = (int) getMenuOption();
switch (choice) {
case 1:
{
//calling the method to get the operands
double operand1 = getOperand(“What is the first number?”);
double operand2 = getOperand(“What is the second number?”);
res =
PayPal Gateway not configured
PayPal Gateway not configured