JAVA Day1 AN
JAVA Day1 AN
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
Students
Department
sno: sno:
sname: attendense:
class: getattendance()
getvalue()
Exam
calattendance()
bool eligible()
QP CODE: S508AN08 Time: 3 Hours
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
2. Define class MyDate with members: day, month, and year. Define default and
parameterized constructors. Accept values from the command line and create a date
object. Throw user-defined exceptions – “InvalidDayException” or
“InvalidMonthException” if the day and month are invalid. If the date is valid, display
the message “Valid date”.
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a program using Swing to accept values in two textboxes then find the largest
number and display the result in the third text box.
2. Create a package named music and define a class Song inside it. The Song class should
have instance variables title, artist, and duration, and methods play() to play the song,
and displayDetails() to display the song's details. Create another class Music in a
different package and use the Song class to play a song and display its details.
QP CODE: S508AN10 Time: 3 Hours
Max Marks: 80 (Q1: 25 marks, Q2: 35 marks, Record: 10 marks, Viva: 10 Marks)
1. Write a swing program to accept a value in a textbox then find the area of a circle and
display the result in the second textbox. (hint : A = πr2 )