2012420062, Yudha S.P, tugas 10 dan 11 semester 3

2012420062, Yudha S.P, tugas 10 dan 11 semester 3

import javax.swing.JOptionPane;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author -
 */
public class tugas1 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        String z= JOptionPane.showInputDialog(null, "Input Angka disertai koma");
        String []numpang=z.split(",");
        int k=0;
        double hasil=0;
        int index=0;
       
        while (k <numpang.length){
        hasil = hasil+Integer.parseInt(numpang[index]);
        k++;
        index++;
    }
        hasil=hasil/temp.length;
        System.out.println("Nilai Rata-Rata dari "+z+" adalah "+hasil);
        System.out.println("Kompleksitas Waktu dari "+z+" adalah "+numpang.length);
}
}







share this article to: Facebook Twitter Google+ Linkedin Technorati Digg
Posted by arek informatika, Published at 11.39 and have 0 komentar

Tidak ada komentar:

Posting Komentar