Java Programming Essay

1318 Words Nov 8th, 2012 6 Pages
Activity 1: Numbers

I. Problem
Create an application that will input a start value and end value. The application will start value all the members from the start to end value and all the odd and even.

II. Analysis
Input Variable Data Type Description SV Integer Starting Value EV Integer End Value

Output Variable NOS Integer Numbers OD Integer Odd numbers EV Integer Even numbers

III. Output Layout

IV. Codes import java.util.Scanner; public class EvenOdd
{
public static void main (String[]args) { int a; int b; Scanner in = new Scanner (System.in); System.out.print ("Starting Value: ");
…show more content…
Output Layout

IV. Codes import java.util.*; public class Transaction
{
static Scanner console = new Scanner(System.in); public static void main(String[] args) { int pa ,pb , pc, pd, pe, tno, q, ap, C; int a, b, c, d, e ; String ic; a = 200; b = 500; c = 800; d = 1200; e = 2000; tno = 1001; System.out.println("Code Description Item Price"); System.out.println("A 2g 200"); System.out.println("B 4g 500"); System.out.println("C 8g 800"); System.out.println("D 16g 1200"); System.out.println("E 32g 2000"); System.out.println("Transaction No. " + tno); System.out.print("Item Code: "); ic = console.next();

if (ic.equals("a")||ic.equals("A")) { System.out.print("Quantity: "); q = console.nextInt(); pa = (a * q);

System.out.println("Transaction: " + tno); System.out.println("No. of Items Purchased: " + q); System.out.println("Total Amount Purchased: " + pa); System.out.println("Vat 12%: " + (pa * .12)); System.out.print("Amount Paid: " ); ap = console.nextInt(); c = ap - pa; System.out.println("Change: " + c); System.out.print("Item Code: "); ic =

Related Documents

300M /1000M LCD Collier de dressage Electrique Chock Télécommande Anti-aboiement | Rampage: Devastación (2018) 4K UHD Audio Dual... | Amazon Echo