whats wrong with my code

Discussion in 'Software' started by erdy_rezki, Apr 20, 2012.

  1. erdy_rezki

    erdy_rezki Private E-2

    import java.io.*;
    public class Contohif {
    public static void main (String[]args) {
    BufferedReader input = newBufferedReader (new InputStreamReader)(System.in));
    try {
    System.out.print("Nilai ujian Anda: ");
    String at = input.readLine();
    int nilaiUjian = Integer.valueOf(st).intValue();
    char hurufMutu;

    if (nilaiUjian >= 80)
    {
    hurufMutu = 'A';
    }
    else
    if (nilaiUjian >= 65)
    {
    hurufMutu = 'B';
    }
    else
    if (nilaiUjian >= 55)
    {
    hurufMutu = 'C';
    }
    else
    if (nilaiUjian >= 45)
    {
    hurufMutu = 'D';
    }
    else {
    hurufMutu = 'E';
    }
    System.out.println("Huruf Mutu" + hurufMutu);
    }
    catch (Exception.e)
    {
    }
    }
    }
     
  2. PC-XT

    PC-XT Master Sergeant

    A parser would show you that line 4 has an extra closing paren. Did your compiler not give you an error message?
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds