Sabtu, 12 Maret 2011

Program Java 1

import java.util.*;


class biodata
{
public static void main(String[]args)
{
Scanner ta = new Scanner(System.in);
Scanner vi = new Scanner(System.in);
String nama, kelas;

System.out.print("Masukkan Nama Anda      : ");
nama = ta.next();
System.out.print("Masukkan Kelas Anda     : ");
kelas = ta.next();
System.out.print("Masukkan NPM Anda       : ");
int npm = ta.nextInt();
System.out.print("Masukkan Nilai UTS Anda : ");
float uts = vi.nextFloat();
System.out.print("Masukkan Nilai UAS Anda : ");
float uas = vi.nextFloat();

float total = (uts*70/100)+(uas*30/100);

System.out.println("_______________________________");
System.out.println("| Nama       : "+nama);
System.out.println("| Kelas      : "+kelas);
System.out.println("| NPM        : "+npm);
System.out.println("| Total Nilai: "+total);
System.out.println("_______________________________");
                
}
}

Tidak ada komentar:

Posting Komentar