Write a program to add of doubles in java, JAVA Programming

Assignment Help:

Write a program to add of doubles in java?

Doubles are treated much the similar way, but now you obtain to use decimal points in the numbers. This is a same program which does addition and subtraction on doubles.

class AddDoubles {
   public static void main (String args[]) {
     double x = 7.5;
    double y = 5.4; 
     System.out.println("x is " + x);
    System.out.println("y is " + y);
      double z = x + y;
    System.out.println("x + y is " + z);
        z = x - y;
    System.out.println("x - y is " + z);
   }
  } 

Here's the result:

% javac AddDoubles.java
% java AddDoubles
x is 7.5
y is 5.4
x + y is 12.9
x - y is 2.0999999999999996

Related Discussions:- Write a program to add of doubles in java

Develop a java - jnlp application, Need Java/JNLP Application - GUI and Bac...

Need Java/JNLP Application - GUI and Backend Projects Project Description: I am looking for assistance in making changes to a complex java application. System launches fro

What is the purpose to use the enableevents method, What is the purpose to ...

What is the purpose to use the enableEvents() method?

A simple desktop software, A simple Desktop Software Project Description...

A simple Desktop Software Project Description: We want a tool that could convert Flash Games into HTML5 Files. These are not tedious games, very simple game. I have attached

We require responsible and serious programmer, We require responsible and s...

We require responsible and serious programmer Project Description: Big Data and On-line tools Website Liferay - JAVA - Portlets - JSP and JSF Skills required: J2EE,

What is a packet in the network environment, What is a packet within the ne...

What is a packet within the network environment? What kind of information does it contain? A packet is the shortest unit of data transmitted over a computer network. It's a mes

Describe the benefits of threads, Question 1: a) What is an "Operating...

Question 1: a) What is an "Operating System"? b) Describe the four main computer system components. c) Describe and compare "Parallel Systems" and "Distributed Systems

Write an application for a video store, Do you provides a Complete source C...

Do you provides a Complete source Codes for this application: " a. Write an application for a video store. Place the names of 10 of your favorite movies in a combo box. Let the use

Develop a school java project, Develop a School java project Project Des...

Develop a School java project Project Description: Programming java, threads. Not so hard but requires knowledgeSkills required: Java

Differentiation jdk 1.02 event model and event delegation, Differentiation ...

Differentiation the JDK 1.02 event model and the event-delegation model introduced with JDK 1.1?

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd