By GokiSoft.com| 10:08 05/10/2021|
C Sharp

Nhập và hiển thị thông tin sinh viên - Console trong C#

Thông tinh sinh viên gồm các thuộc tính sau : tên, mã sinh viên, tuổi, địa chỉ

Yêu cầu :

Thực hiện và in ra thông tin sinh viên trên

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

5

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

Đường Thanh Bình [T1907A]
Đường Thanh Bình

2020-05-15 13:58:44



using System;

namespace Student
{
    class Program
    {
        static void Main(string[] args)
        {
            int age;
            String name, address, studentId;
            Console.WriteLine("Enter student name:");
            name = Console.ReadLine();
            Console.WriteLine("Enter student student ID:");
            studentId = Console.ReadLine();
            Console.WriteLine("Enter student age:");
            age = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Enter student address:");
            address = Console.ReadLine();

            Console.WriteLine("Student Info: name:{0}, student ID:{1}, age:{2}, address:{3}", name, studentId, age, address);

        }
    }
}



Phạm Ngọc Minh [T1907A]
Phạm Ngọc Minh

2020-05-15 09:32:33



using System;

namespace database
{
    class Program
    {
        static void Main(string[] args)
        {
            string ten , Masv , Diachi;
            
            Console.WriteLine("Nhap ten SV :");
            ten = Console.ReadLine();
            Console.WriteLine("Nhap ma SV :");
            Masv = Console.ReadLine();
            Console.WriteLine("Nhap dia chi SV :");
            Diachi = Console.ReadLine();
            Console.WriteLine("Nhap tuoi SV :");
            int Tuoi = Convert.ToInt32(Console.ReadLine());
            Console.Write("Thong tin sinh vien la : Ten = {0} , Ma SV = {1}, DiaChi  = {2} , Tuoi = {3}",ten, Masv,Diachi,Tuoi);
        }
    }
}



Phan Bạch Tùng Dương [T1907A]
Phan Bạch Tùng Dương

2020-05-15 09:20:14



using System;

namespace Lession1
{
    class Program
    {
        static void Main(string[] args)
        {
            int age;
            String name, address, studentId;
            Console.WriteLine("Enter student name:");
            name = Console.ReadLine();
            Console.WriteLine("Enter student student ID:");
            studentId = Console.ReadLine();
            Console.WriteLine("Enter student age:");
            age = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Enter student address:");
            address = Console.ReadLine();

            Console.WriteLine("Student Info: name:{0}, student ID:{1}, age:{2}, address:{3}", name, studentId, age, address);
            
        }
    }
}



hoangduyminh [T1907A]
hoangduyminh

2020-05-15 09:10:05



using System;
using System.Text;

namespace Lession2
{
    class Program
    {
        static void Main(string[] args)
        {
           string ten,msv,diachi;
            int age;

            Console.WriteLine("Nhap vao ten sinh vien:");
            ten = Console.ReadLine();
            Console.WriteLine("Nhap vao ma sinh vien");
            msv = Console.ReadLine();
            Console.WriteLine("Nhap vao Dia Chi:");
            diachi = Console.ReadLine();
            Console.WriteLine("Nhap vao tuoi:");
            age = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Thong Tin Sinh Vien : Ten = {0} , Ma Sinh Vien = {1}, Dia Chi = {2}, Tuoi = {3}" + ten,msv,diachi,age);
        }

    }
}



Trần Mạnh Dũng [T1907A]
Trần Mạnh Dũng

2020-05-15 09:09:31



using System;

namespace nhapsinhvien
{
    class Program
    {
        static void Main(string[] args)
        {
            bool scan = true;
            while (scan)
            {
                Console.WriteLine("=========================");

                Console.WriteLine("Enter Full Name: ");
                String name = Console.ReadLine();
                Console.WriteLine("Enter ID: ");
                int id = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Enter Age: ");
                String age = Console.ReadLine();
                Console.WriteLine("Enter Address: ");
                String address = Console.ReadLine();

                Console.WriteLine("=========================");

                Console.WriteLine("Full name: "+ name);
                Console.WriteLine("ID: "+ id);
                Console.WriteLine("Age: "+ age);
                Console.WriteLine("Address: "+ address);
            }
         }

        
        
    }
}



Minh Nghia [T1907A]
Minh Nghia

2020-05-15 09:08:46



using System;

namespace Lession1
{
    class Information
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter User Name :");
            string userName = Console.ReadLine();

            Console.WriteLine("Enter Student code :");
            string studentCode = Console.ReadLine();

            Console.WriteLine("Enter Age :");
            int age = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Enter Address :");
            string address = Console.ReadLine();

            Console.WriteLine("\nUserName :" + userName + "\nStudent Code :" + studentCode + "\nAge :" + age + "\nAddress :" + address);
        }
    }
}



Phí Văn Long [T1907A]
Phí Văn Long

2020-05-15 09:06:50



using System;

namespace BT1
{
    class Program
    {
        static void Main(string[] args)
        {
            string Ten, MaSv, DiaChi;
            int tuoi;

            Console.WriteLine("Nhap ten sinh vien");
            Ten = Console.ReadLine();
            Console.WriteLine("Nhap ma sinh vien");
            MaSv = Console.ReadLine();
            Console.WriteLine("Nhap dia chi sinh vien");
            DiaChi = Console.ReadLine();
            Console.WriteLine("Nhap tuoi sinh vien");
            tuoi = Convert.ToInt32(Console.ReadLine());

            Console.Write("Thanh cong");
            Console.Write("Thong tin sinh vien la : Ten = {0} , Ma SV = {1}, DiaChi  = {2} , Tuoi = {3}",Ten,MaSv,DiaChi,tuoi);

        }

    }
}



Đỗ Văn Huấn [T1907A]
Đỗ Văn Huấn

2020-05-15 09:05:49



using System;

namespace vidu1
{
    public class InformationStudent
    {

        static void Main(string[] args)
        {
            Console.Write("Enter name: ");
            string name = Console.ReadLine(); 
            Console.Write("Enter id: ");
            string id = Console.ReadLine(); 
            Console.Write("Enter age: "); 
            int age = Convert.ToInt32(Console.ReadLine()); 
            Console.Write("Enter address: "); 
            string address = Console.ReadLine();

            Console.WriteLine("Student information just entered: ");
            Console.WriteLine("Name : {0}, age : {1}, id : {2}, address: {3}", name,age,id,address);
        }
    }
} 



Trương Công Vinh [T1907A]
Trương Công Vinh

2020-05-15 09:03:02



using System;

namespace sub1
{
    class Program
    {
        static void Main(string[] args)
        {

            String ten, maSV, diachi;
            int tuoi;
            Console.WriteLine("Hello World!");
            Console.WriteLine("Thong tin Sinh Vien .");
            Console.WriteLine("ten : ");
            ten = Console.ReadLine();
            Console.WriteLine("tuoi : ");
            tuoi = int.Parse(Console.ReadLine());
            Console.WriteLine("Ma sinh vien : ");
            maSV = Console.ReadLine();
            Console.WriteLine("Dia chi : ");
            diachi = Console.ReadLine();
            Console.Write("sv { ten :" + ten + " , tuoi :" + tuoi + ", ma sinh vien : " + maSV + ", dia chi :  " + diachi+"}");

        }
        
        
    }
    
}



thienphu [T1907A]
thienphu

2020-05-15 08:58:20



using System;
using System.Collections.Generic;
using System.Text;

namespace Lesson2
{
    class Student
    {
        string name, id,address;
        int age;

        public string Name { get; set; }
        public string Id { get; set; }
        public string Address { get; set; }
        public int Age { get; set; }
        public Student() { }
        public Student(string name, string id,int age,string address)
        {
            this.name = name;
            this.id = id;
            this.age = age;
            this.address = address;
        }

        public void input()
        {
            Console.WriteLine("Nhap name sv");
            Name = Console.ReadLine();
            Console.WriteLine("Nhap id sv ");
            Id = Console.ReadLine();
            Console.WriteLine("Nhap age sv ");
            Age = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Nhap address sv");
            Address = Console.ReadLine();
        }
        public override string ToString()
        {
            return "Name= " + Name + " || ID= " + Id + " || Age = " + Age + "  || Address = " + Address;
        }
        public void display()
        {
            Console.WriteLine(ToString());
        }
             


    }
}



using System;

namespace Lesson2
{
    class Program
    {
        static void Main(string[] args)
        {
            Student st = new Student();
            st.input();
            st.display();
        }
    }
}