Ex_2CH_7 - x = Console.nextInt(); System.out.println();

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

View Full Document Right Arrow Icon
import java.util.Scanner; import java.lang.*; import java.io.*; import java.text.*; import java.math.*; import java.text.DecimalFormat; import java.lang.String; i public class Ex_2CH_7 { public static void main(String[] args) { int num; double dec; } // Scanner static Scanner Console = new Scanner(System.in); public static int one(int x, int y) { int sum; System.out.println(" Please enter a value for x. ");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: x = Console.nextInt(); System.out.println(); System.out.println(" Please enter a value for y. "); y = Console.nextInt(); if (x>y) System.out.println(" The sum of x is " + x); System.out.println(" The sum of y is " + y); else sum = (x-2)* y; } public static double two(int x, double a) { int first; double z; d } }...
View Full Document

This note was uploaded on 06/17/2011 for the course COMP 2302 taught by Professor Staff during the Spring '11 term at Kennesaw.

Ask a homework question - tutors are online