By GokiSoft.com| 20:13 10/04/2024|
Java Basic

Java Basic- Nhập xuất java - Scanner trong java

Nhập thông tin sinh viên gồm các thuộc tính : Tên, tuổi, địa chỉ, email, số điện thoại. Và hiển thị thông tin ra màn hình sau khi nhập.

Phản hồi từ học viên

5

(Dựa trên đánh giá ngày hôm nay)

Đặng Trần Nhật Minh [T2008A]
Đặng Trần Nhật Minh

2021-01-22 09:30:42



/*
 * 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 javalesson2;

import java.util.Scanner;

/**
 *
 * @author W10-2004
 */
public class ex02 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        String fullName, email, phoneNum, address;
        int age;
        
        Scanner scan = new Scanner(System.in);
        
        System.out.println("Input Full Name: ");
        fullName = scan.nextLine();
        
        System.out.println("Input Age: ");
        age = Integer.parseInt(scan.nextLine());
        
        System.out.println("Input Address: ");
        address = scan.nextLine();
        
        System.out.println("Input Email: ");
        email = scan.nextLine();
        
        System.out.println("Input Phone Number: ");
        phoneNum = scan.nextLine();
        
        System.out.println("Full Name: " + fullName + "\nAge: " + age + "\nAddress: " + address +  "\nEmail: " + email + "\nPhone Number: " + phoneNum);
    }
    
}



Nguyễn Anh Vũ [T2008A]
Nguyễn Anh Vũ

2021-01-21 15:36:14



/*
 * 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 bt2;

/**
 *
 * @author Admin
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        String Name = "Nguyen Anh Vu";
        int Age = 18;
        String Address = "Ha Nam";
        String Email = "nguyenanhvu280402@gmail.com";
        String Phonenumber = "0964657860";
        //
        Scanner scan = new Scanner(System.in);
        System.out.println("Ten = ");
        Name = scan.nextLine();
        //
        System.out.println("Tuoi = ");
        Age = scan.nextInt();
        //
        System.out.println("Dia Chi = ");
        Address = scan.nextLine();
        //
        System.out.println("Email = ");
        Email = scan.nextLine();
        //
        System.out.println("SDT = ");
        Phonenumber = scan.nextLine();
       
        //HienThi
         System.out.println("Ten = " + Name);
         System.out.println("Tuoi = " + Age);
         System.out.println("Dia Chi = " + Address);
         System.out.println("Email = " + Email);
         System.out.println("SDT = " + Phonenumber);
    
    }
    
}




Đức Sơn [T2008A]
Đức Sơn

2021-01-21 13:28:30



/*
 * 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 nhapxuatdulieu;

/**
 *
 * @author ADMIN
 */
public class Nhapxuatdulieu {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        String Name;
        int age;
        String Address;
        String phone;
        
        Scanner scan = new Scanner(System.in);
        System.out.println("Nhap Name:");
        Name = scan.nextLine();
        System.out.println("Nhap age: ");
        age = scan.nextLine();
        
        System.out.println("Nhap Address: ");
        Address = scan.nextline();
        
        System.out.println("Nhap phone: ");
        phone = scan.nextline();
        
        System.out.println("Name :" + Name + "age :" + age + "Address :" + Address +"phone: " + phone);
        
        
        
    }
    
}



Do Trung Duc [T2008A]
Do Trung Duc

2021-01-21 04:03:48



/*
 * 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 gokisoft_lesson1;

import java.util.Scanner;

/**
 *
 * @author TrungDuc
 */
public class Nhapthongtinsinhvien {

    public static void main(String[] args) {
        String Name;
        int Age;
        String Address;
        String Phone;

        Scanner scan = new Scanner(System.in);
        System.out.println("Nhap Name: ");
        Name = scan.nextLine();

        System.out.println("Nhap Age: ");
        Age = Integer.parseInt(scan.nextLine());
//        Age = scan.nextInt();
        

        System.out.println("Nhap Address: ");
        Address = scan.nextLine();

        System.out.println("Nhap Phone: ");
        Phone = scan.nextLine();
        
        System.out.println("Name:" + Name + ",Age:" + Age + ",Address:" + Address +  ",Phone" + Phone );
    }
}



Do Trung Duc [T2008A]
Do Trung Duc

2021-01-21 04:03:36



/*
 * 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 gokisoft_lesson1;

import java.util.Scanner;

/**
 *
 * @author TrungDuc
 */
public class Nhapthongtinsinhvien {

    public static void main(String[] args) {
        String Name;
        int Age;
        String Address;
        String Phone;

        Scanner scan = new Scanner(System.in);
        System.out.println("Nhap Name: ");
        Name = scan.nextLine();

        System.out.println("Nhap Age: ");
        Age = Integer.parseInt(scan.nextLine());
//        Age = scan.nextInt();
        

        System.out.println("Nhap Address: ");
        Address = scan.nextLine();

        System.out.println("Nhap Phone: ");
        Phone = scan.nextLine();
        
        System.out.println("Name:" + Name + ",Age:" + Age + ",Address:" + Address +  ",Phone" + Phone );
    }
}



Trần Thị Khánh Huyền [T2008A]
Trần Thị Khánh Huyền

2021-01-21 00:58:29



/*
 * 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 nhapxuatdulieu;

import java.util.Scanner;
/**
 *
 * @author Admin
 */
public class NhapXuatDuLieu {

   
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
    Scanner scan = new Scanner(System.in);
    
    String name;
    System.out.println("Nhap ten: ");
    name = scan.nextLine();
    
    int age;
    System.out.println("Nhap tuoi: ");
    age = Integer.parseInt(scan.nextLine());
    
    String address;
    System.out.println("Nhap dia chi: ");
    address = scan.nextLine();
    
    String email;
    System.out.println("Nhap email: ");
    email = scan.nextLine();
    
    String phone;
    System.out.println("Nhap so dien thoai: ");
    phone = scan.nextLine();
    
    System.out.println("Ten la: "+name);
    System.out.println("Tuoi: "+age);
    System.out.println("Dia chi: "+address);
    System.out.println("Email: "+email);
    System.out.println("So dien thoai: "+phone);
    
    
    }
    
}



hainguyen [T2008A]
hainguyen

2021-01-20 10:06:11



/*
 * 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 t2008a_1;

import java.util.Scanner;

/**
 *
 * @author Admin
 */
public class T2008A_1 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner scan = new Scanner (System.in);
        int t, i;
        String m, n, p;
        
        System.out.println("Nhap Ten : ");
        m = scan.nextLine();
        System.out.println("Nhap Tuoi : ");
        t = scan.nextInt();
        System.out.println("Nhap Dia Chi : ");
        n = scan.nextLine();
        System.out.println("Nhap email : ");
        p = scan.nextLine();
        System.out.println("Nhap So Dien Thoai : ");
        i = scan.nextInt();
        
        System.out.println("m = " + m + ", t = " + t + ", n = " + n + ", p = " + p + ", i = " + i);
    }
    
}



nguyễn Sử [T2008A]
nguyễn Sử

2021-01-20 09:57:12



   public static void main(String[] args) {
        // TODO code application logic here
        Scanner scan = new Scanner(System.in);
        String ten;
        String diachi;
        String email;
        String tuoi;
        String sdt;
        
        System.out.println("nhap ten : ");
        ten = scan.nextLine();
        
        System.out.println("nhap tuoi: ");
        tuoi = scan.nextLine();
        
        System.out.println("nhap dia chi : ");
        diachi = scan.nextLine();
        
        System.out.println("nhap email : ");
        email = scan.nextLine();
        
        System.out.println("nhap sdt :  ");
        sdt = scan.nextLine();
        
        System.out.println("nhap ten = " + ten + ",nhap tuoi = " + tuoi + ",nhap dia chi = " + diachi + ", nhap email = " + email + ", nhap sdt = " + sdt);
       
    }

}



Trần Văn Lâm [T2008A]
Trần Văn Lâm

2021-01-20 09:33:28



   public static void main(String[] args) {
        // TODO code Sapplication logic here
        String Name ="Tran Van Lam";
        int  Age= 26;
        String Address="Ha Nam";
        String Email="lam@gmail.com";
        String NumberPhone="133232323";
        
        Scanner scan = new Scanner(System.in);
        System.out.println("Name =");
        Name = scan.nextLine();
        
        System.out.println("Age =");
        Age = scan.nextInt();
        
        System.out.println("Address =");
        Address = scan.nextLine();
        
        System.out.println("Email =");
        Email = scan.nextLine();
        
        System.out.println("NumberPhone =");
        NumberPhone = scan.nextLine();
        
        
        //Print
         System.out.println("Name =" + Name);
         System.out.println("Age =" + Age);
         System.out.println("Address =" + Address);
         System.out.println("Email =" + Email);
         System.out.println("NumberPhone =" + NumberPhone);
    
    }
    
}



vuong huu phu [T2008A]
vuong huu phu

2021-01-20 09:33:21



/*
 * 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 bai_1;

import java.util.Scanner;

/**
 *
 * @author Admin
 */
public class Bai_tap {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        String ten;
        String dia_chi;
        String email;
        int tuoi, sdt;
        Scanner scan = new Scanner(System.in);
        System.out.println("Nhap ten = ");
        ten = scan.nextLine();

        System.out.println("Nhap dia chi = ");
        dia_chi = scan.nextLine();

        System.out.println("Nhap tuoi = ");
        tuoi = Integer.parseInt(scan.nextLine());

        System.out.println("Nhap email = ");
        email = scan.nextLine();

        System.out.println("Nhap sdt = ");
        sdt = scan.nextInt();

        System.out.println("Ten : " + ten);
        System.out.println("dia chi : " + dia_chi);
        System.out.println("tuoi : " + tuoi);
        System.out.println("email : " + email);
        System.out.println("sdt : " + sdt);

    }
}