Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 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 opboti3;
- import java.util.Scanner;
- /**
- *
- * @author PC25
- */
- public class ArrayDinamis {
- public static void main(String [] args){
- Scanner scanner = new Scanner (System.in);
- System.out.print("Masukan text = ");
- String input = scanner.nextLine();
- System.out.println("Inputan = "+input);
- System.out.print("Masukan Banyak Baris = ");
- String i = scanner.nextLine();
- System.out.print("Masukan Banyak kolom = ");
- String j = scanner.nextLine();
- int m = Integer.parseInt(i);
- int n = Integer.parseInt(j);
- int x,y;
- for(x=0;x<m;x++){
- for(y=0;y<n;y++){
- System.out.print("*");
- }
- System.out.println("");
- }
- System.out.print("Masukan banyak Angka : ");
- String l = scanner.nextLine();
- int q = Integer.parseInt(l);
- int total=0;
- for(int w=0;w<q;w++){
- System.out.print("Masukan Bilangan ke-"+(w+1)+" : ");
- String h = scanner.nextLine();
- int r = Integer.parseInt(h);
- total += r;
- }
- System.out.println("Hasil dari Penjumlahan "+q+" Bilangan adlah "+total);
- }
- }
Add Comment
Please, Sign In to add comment