OOPs Programs-01
OOPs Programs-01
Enter no of bookings:
2
Enter the available tickets:
25
Enter the ticketid:
123
Enter the price:
100
Enter the no of tickets:
5
Available tickets: 25
Total amount:500
Total amount:200
int studentId
Assume most of the students are from “NIT” college. So user has
to give input whether the student is from NIT or not.
Sample Input 1:
12
John
Chennai
NO
SVS
Sample Output 1:
Student id:12
Student name:John
Address:Chennai
College name:SVS
Sample Input 2:
43
Enter Student's Name:
Tom
Coimbatore
Wrong Input
yes
Sample Output 2:
Student id:43
Student name:Tom
Address:Coimbatore
College name:NIT
accountId int
accountType String
balance int
The method public boolean withdraw(int) used to calculate the
current balance of the respective account. Before that it should
enough balance. If there is enough balance, deduct the amount
from the balance and print "Balance amount after withdraw: XXX"
and return true. If there is no enough balance, print "Sorry!!! No
enough balance" and return false.
Sample input 1:
100
Enter account type:
Savings
Enter balance:
10000
Enter amount to be withdrawn:
500
Sample Output 1:
Sample input 2:
Enter account id:
101
Enter account type:
Savings
Enter balance:
1000
Enter amount to be withdrawn:
1500
Sample Output 2:
Sample input 3:
100
Savings
Enter balance:
-100
Enter balance:
5000
int studentId
String name
int departmentId
String gender
String phone
String hostelName
int roomNumber
Make this class inherit the Student class, as it holds all the
properties of Student.
Use appropriate public getters and setters for both the classes.
In Main class get the input of the hosteller using the method :
Sample Input 1:
Sample Output 1:
Sample Input 2:
Enter the Details:
Student Id
2
Student Name
John Paul
Department Id
112
Gender
Male
Phone Number
9885526536
Hostel Name
YMBA
Room Number
5
Modify Room Number(Y/N)
N
Modify Phone Number(Y/N)
N
Sample Output 2:
The Student Details:
2 John Paul 112 Male 9885526536 YMBA 5
4.