Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package No4;
- public class KabKota {
- private String namaKabKota;
- private float jmlPenduduk;
- public void setNamaKabKota(String k){
- namaKabKota=k;
- }
- public void setJmlPenduduk(float p){
- jmlPenduduk=p;
- }
- public String getNamaKabKota(){
- return namaKabKota;
- }
- public float getJmlPenduduk(){
- return jmlPenduduk;
- }
- public void drawHistogram(){
- int n=Math.round(jmlPenduduk);
- for (int i = 0; i < n; i++) {
- System.out.print("*");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment