CalculationsV3

CalculationsV3 - //System.out.println(); // Multiplication

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/** * The Calculations class performs addition, subtraction, multiplication, division, and modulus operations on integers and decimals. * * ?LVS 2007 * @author Bill Jord * @version 01/19/07 */ public class CalculationsV3 { public static void main(String[] args) { int iNum1 = 4; int iNum2 = 8; // Addition System.out.println("Addition"); System.out.print(iNum1 + " plus " + iNum2 + " = "); System.out.println(23.51 + 8.9325); //System.out.println(); // Subtraction System.out.println("Subtraction"); System.out.println(9 - 33); System.out.println(98.6 - 47.0038);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //System.out.println(); // Multiplication System.out.println("Multiplication"); System.out.println(15 * 3 * 201); System.out.println(3.14 * 5.0 * 5.0); //System.out.println(); // Division System.out.println("Division"); System.out.println(48 / 8); System.out.println(212.0 / 32.0); //System.out.println(); // Modulus operator System.out.println("Modulus"); System.out.println(23 & 15); System.out.println(3298.7 % 243.1); //System.out.println(); }//end of main method }//end of class...
View Full Document

This note was uploaded on 10/05/2010 for the course COMP 101 taught by Professor Staff during the Spring '08 term at UNC.

Ask a homework question - tutors are online