Tuesday, 2 October 2012

perintah masukan bufferedreader (java)

 contoh perintah masukan bufferedreader

package perintah_masukan;

import java.io.*;



public class bufferedreader {
   
    public static void main(String[] args) throws IOException{

        {
        BufferedReader input = new BufferedReader
        (new InputStreamReader(System.in));
       System.out.print("Nama Peserta : ");
       String namapeserta = input.readLine();
       System.out.print("Nilai perlombaan1 : ");
     String nilai1 = input.readLine();
     int n1 = Integer.parseInt(nilai1);
     System.out.print("Nilai perlombaan2 : ");
     String nilai2 = input.readLine();
    int n2 = Integer.parseInt(nilai2);
     double rata = (n1*n2)/2;
     System.out.println("Nilai rata rata : "+rata);
      }

     }
}
Perhatian: Yuk Baca Artikel bagus di Nurul Musthofa

Artikel Terkait

No comments:

Post a Comment

 

Network

Pesan

Semoga situs ini bermanfaat