Question
import java.util.Scanner; import java.util.*; public class Calculator1 { public static void main(String args[]) { System.out.println(Enter numbers); Scanner Reader = new Scanner(System.in); float num1 = Reader.nextFloat();
import java.util.Scanner; import java.util.*;
public class Calculator1 { public static void main(String args[]) { System.out.println("Enter numbers"); Scanner Reader = new Scanner(System.in); float num1 = Reader.nextFloat(); char Sign = Reader.next() .charAt(0); float num2 = Reader.nextFloat(); switch(Sign) { case '-' : { System.out.println(num1-num2); break; } case '+' : { System.out.println(num1+num2); break; } case '/' : { System.out.println(num1/num2); break; } case '*' : { System.out.println(num1*num2); break; } } } }
Is there a way to not use System.out.println when finding these math answers?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started