M6_nilai buff
m6 buff program
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Matkul; /** * * @author kumal */ public class M6_nilaiBuff { public static void main(String[] args) throws java.io.IOException { java.io.BufferedReader input = new java.io.BufferedReader(new java.io.InputStreamReader(System.in)); System.out.print("Masukkan nilai A : "); double A = Double.parseDouble(input.readLine()); System.out.print("Masukkan nilai B : "); double B = Double.parseDouble(input.readLine()); System.out.print("Masukkan nilai C : "); double C = Double.parseDouble(input.readLine()); double r = (A+B+C)/3; if (r>=60) { System.out.println(String.format("Nilai rata-rata : %.2f", r) + " :-)"); } else { System.out.printf("Nilai rata-rata : %.2f :-(\n", r); } } }