Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

1. How do most insects respire ?

Answered: 1 week ago

Question

Who is known as the father of the indian constitution?

Answered: 1 week ago

Question

1.explain evaporation ?

Answered: 1 week ago

Question

Who was the first woman prime minister of india?

Answered: 1 week ago

Question

Explain the concept of going concern value in detail.

Answered: 1 week ago

Question

13-4 What are alternative methods for building information systems?

Answered: 1 week ago