/* * Intro to Programming CSE 1310 * University of Texas at Arlington */ package code31aug17; import java.util.Scanner; /** * * @author jcmtiernan */ public class Code31Aug17 { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner input = new Scanner(System.in); int a = 0, b = 0, c = 0, d = 0; int resultI = 0; double resultD = 0; a = 17; b = 5; c = 19; d = 3; resultD = (a*b)/d; System.out.println("a = "+a+" b = "+b+" c = "+c+" d = "+d); System.out.println(" The fractions are "+a+"/"+b+" and "+b+"/"+d); System.out.println("resultD is (a*b)/d with value "+resultD); resultI = (a*b)%d; System.out.println("resultI is (a*b)%d with value "+resultI); resultD = (a*b)/(double)d; System.out.println("resultD is (a*b)/(double)d with value "+resultD); System.out.print("Please enter an integer: "); a = input.nextInt(); System.out.println("\nNew a value is "+a/2); } }