Copyright © Jejak Obeng
Design by Dzignine
Rabu, 28 September 2011

JAVA - Nilai Raport


import java.util.Scanner;

public class nilai
{
public static void main(String [] args)
{
int n1, n2, n3, n4;

Scanner s = new Scanner(System.in);

System.out.print("Nilai Tugas : ");
n1 = s.nextInt();

System.out.print("Nilai UAS : ");
n2 = s.nextInt();

System.out.print("Nilai UTS : ");
n3 = s.nextInt();

System.out.print("Nilai Absen : ");
n4 = s.nextInt();

int x = 0;
nilai tot = new nilai();
x = tot.tambah(n1,n2,n3,n4);
System.out.println("Nilai Keseluruhan" + x);
if (x >= 65)
System.out.println("Anda lulus");
else
System.out.println("Anda tidak lulus");
}

private int tambah(int q, int w, int e, int r)
{
int hasil = 0;
hasil =
(q + w + e + r)/4;
return hasil;
}
}

0 komentar:

Posting Komentar