John Delmark Aguilar
Would you like to react to this message? Create an account in a few clicks or log in to continue.
John Delmark Aguilar

Personal Forum
 
HomeSearchLatest imagesRegisterLog in

 

 Introduction to Java Programming [Power Point]

Go down 
AuthorMessage
dElmARk
Admin
Admin
dElmARk


Posts : 92
Join date : 09/04/2012

Introduction to Java Programming [Power Point] Empty
PostSubject: Introduction to Java Programming [Power Point]   Introduction to Java Programming [Power Point] Icon_minitimeSun Oct 21, 2012 5:31 pm



Introduction to Java Programming








Slide 34 Note:
Code:

import java.io.*;
import java.util.*;
class inputOutput{
    public static void main(String []args){
    BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
    Scanner scnr = new Scanner(System.in);
    // String input
    System.out.print("What is your name: ");
    String name1 = br.readLine();
    System.out.print("What is your name: ");
    String name2 = scnr.nextLine();
   
    // Int input
    System.out.print("What is your age: ");
    int age1 = Integer.parseInt(br.readLine());
    System.out.print("What is your age: ");
    int age2 = scnr.nextInt();

    // double input
    System.out.print("What is your Grade: ");
    double grade1 = Double.parseDouble(System.in());
    System.out.print("What is your Grade: ");
    double grade2 = scnr.nextDouble();

    System.out.println("Buffered Reader inputs.");
    System.out.println("Your name is " + name1);
    System.out.println("Your age is " + age1);
    System.out.println("Your grade is " + grade1);
    System.out.println("\nScanner inputs");
    System.out.println("Your name is " + name2);
    System.out.println("Your age is " + age2);
    System.out.println("Your grade is " + grade2);
    }
}

Back to top Go down
https://delmark.forumtl.com
 
Introduction to Java Programming [Power Point]
Back to top 
Page 1 of 1
 Similar topics
-
» Compiling Java Program
» Java Programming Index
» Java Comments
» Payroll Java
» Magic Square Java

Permissions in this forum:You cannot reply to topics in this forum
John Delmark Aguilar :: dElmARk Productions :: Java Programs :: Tutorials-
Jump to: