0% found this document useful (0 votes)
10 views

Input Data Mahasiswa

The document contains code for a Java program that takes user input for a student's name, age, GPA, and address and then prints it out.

Uploaded by

Januar M Rudal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Input Data Mahasiswa

The document contains code for a Java program that takes user input for a student's name, age, GPA, and address and then prints it out.

Uploaded by

Januar M Rudal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import java.util.

Scanner;
import java.util.Locale;

class BelajarJava {
public static void main(String args[]){

String nama;
int umur;
double ipk;
String alamat;

Scanner input = new Scanner(System.in).useLocale(Locale.US);

System.out.println("## Biodata Mahasiswa ##");


System.out.println("=======================");
System.out.println();

System.out.print("Nama: ");
nama = input.nextLine();

System.out.print("Umur: ");
umur = input.nextInt();

System.out.print("IPK: ");
ipk = input.nextDouble();
input.nextLine();

System.out.print("Alamat: ");
alamat = input.nextLine();

System.out.println("=======================");
System.out.println();

System.out.print(nama + " berusia "+ umur + " tahun, ");


System.out.print("memiliki IPK " + ipk);
System.out.print(" dan beralamat di " + alamat);

}
}

You might also like