UrbanPro

Learn CodeIgniter from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Java programe in calculator.

Asked by Last Modified  

3 Answers

Learn CodeIgniter

Follow 0
Answer

Please enter your answer

Coaching

Is it Question? OR....
Comments

IT Professional Trainer with 15 years of experience in IT Industry

Calculator.java import java.util.Scanner; public class Calculator { public static void main(String args) { Scanner input = new Scanner(System.in); Maths Maths = new Maths(); double answer = 0; double inputA, inputB; char operator; boolean done = false; ...
read more
Calculator.java import java.util.Scanner; public class Calculator { public static void main(String[] args) { Scanner input = new Scanner(System.in); Maths Maths = new Maths(); double answer = 0; double inputA, inputB; char operator; boolean done = false; while (done == false) { System.out.print("Please enter your sum: "); inputA = input.nextDouble(); operator = input.next().charAt(0); inputB = input.nextDouble(); switch (operator) { case '+': answer = Maths.add(inputA, inputB); break; case '-': answer = Maths.subtract(inputA, inputB); break; case '*': answer = Maths.multiply(inputA, inputB); break; case '/': answer = Maths.divide(inputA, inputB); break; case '^': answer = Maths.power(inputA, inputB); break; } System.out.println(answer); } input.close(); } } Maths.java public class Maths { double add(double a, double b) { double answer = a+b; return answer; } double subtract(double a, double b) { double answer = a-b; return answer; } double multiply(double a, double b) { double answer = a*b; return answer; } double divide(double a, double b) { double answer = a/b; return answer; } double power(double a, double b){ double answer =a; for (int x=2; x<=b; x++){ answer *= a; } return answer; } } read less
Comments

Trainer

Do you need java calculator program?
Comments

View 1 more Answers

Related Questions

Hello everyone, I have done MBA. I want do career in IT field. Please suggest me best IT Course for get /entry for fresher.
Hello dear, MBA is done..what you wish to choose as career. kindly share details as in core interest. Regards
Priya

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Core PHP v/s PHP Frameworks
PHP Frameworks: Framework is a piece of software by which one can develop large enterprise, robust & secure software applications. Frameworks provide straight forward flow and strict guidelines by...

Recommended Articles

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Business Process outsourcing (BPO) services can be considered as a kind of outsourcing which involves subletting of specific functions associated with any business to a third party service provider. BPO is usually administered as a cost-saving procedure for functions which an organization needs but does not rely upon to...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Looking for CodeIgniter Training?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for CodeIgniter Classes?

The best tutors for CodeIgniter Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn CodeIgniter with the Best Tutors

The best Tutors for CodeIgniter Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more