Assignment-1 Name of Student: Waghule Shubham Kalyan Batch: B3 Branch: Roll No.: 94 Problem Statement
Assignment-1 Name of Student: Waghule Shubham Kalyan Batch: B3 Branch: Roll No.: 94 Problem Statement
Assignment-1 Name of Student: Waghule Shubham Kalyan Batch: B3 Branch: Roll No.: 94 Problem Statement
Problem Statement
A VIT Melange committee is conducting auditions to admit interested
candidates. You need to implement a Participant class for the dance club
based on the class diagram and description given below.
C-Participants
counter: int
registrationId: String
name: String
contactNumber: long
branch: String
C
o Participant(name:String,contactNumber:long,branch:String)
o getRegistrationId(): String
o getCounter(): int
o setCounter(counter:int):void
o getName():String
o setName(name:String):void
o getContactNumber():long
o setContactNumber(contactNumber:long):void
o getBranch():String
o setBranch(branch:String):void
Method Description
Partcipant(String name, long contactNumber, String branch)
Initialize the name, contactNumber and branch instance variables
appropriately with the values passed to the constructor.
Generate the registrationId using the static variable counter.
The value of registrationId should start from 'D1001' and the
numerical part should be incremented by 1 for the subsequent
values.
Initialize the counter in static block.
Implement the appropriate getter and setter methods.
Test the functionalities using the provided Tester class. Create two or
more Participant objects and validate that the values of the member
variables are proper.
Sample Input and Output
For constructor
Input
For first Participant object
Parameters Values
name Rohit
contactNumber 1234567889
branch Computer
Parameters Values
name Sayli
contactNumber 1988612300
branch Mechanical
Expected Output
p.display();;
p1.display();
}
}
Results:
Actual Output