question archive Create class Student with the private attributes int studentId String studentName, studentAddress, collegeName
Subject:Computer SciencePrice:4.87 Bought7
Create class Student with the private attributes int studentId String studentName, studentAddress, collegeName.
Include appropriate getter methods.
Assume most of the students are from "NIT" college. So user has to give input whether the student is from NIT or not.
Based on the above assumptions write the necessary constructors in the Student class.
Write a class StudentMain with the main method and test the application.
Sample Input 1:
Enter Student's Id:
12
Enter Student's Name:
John
Enter Student's address:
Chennai
Whether the student is from NIT(Yes/No):
NO
Enter the college name:
SVS
Sample Output 1:
Student id:12
Student name:John
Address:Chennai
College name:SVS
Sample Input 2:
Enter Student's Id:
43
Enter Student's Name:
Tom
Enter Student's address:
Coimbatore
Whether the student is from NIT(Yes/No):
y
Wrong Input
Whether the student is from NIT(Yes/No):
yes
Sample Output 2:
Student id:43
Student name:Tom
Address:Coimbatore
College name:NIT
Purchased 7 times