Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Apply the naming conventions for variables, methods, classes, and packages: - variable names start with a lowercase character - classes start with an uppercase character
Apply the naming conventions for variables, methods, classes, and packages:
- variable names start with a lowercase character
- classes start with an uppercase character
- packages use only lowercase characters
- methods start with a lowercase character
Exercise 1:
Write the Java application that creates a Java console application to keep records of singers and displays stored record. Follow the following instructions to develop the application:
Create the class named Singers with the following specifications:
- 5 instance variables that would store the following singer data (Use recommended variable naming conventions and appropriate data type for each instance variable):
- Singer's id
- Singer's name
- Singer's address
- Date of birth
- Number of albums published
- Two constructors that would allow you to construct Singer object with no arguments and 5 arguments.
- Create Setters and getters for all the instance variables of class Singer. Make sure to have several setters that would allow you to set the values of individual instance variables of the singer object. Also create one setter that would allow you to set all the values of the instance variables at once. Create several getters that would allow you to get the current individual values of each instance variables of the Singer object.
- Create the driver class that would create 1 Singer (singer1) object with the help of the no argument constructor. Display the default values of the instance variables of this object singer1.
- Set the values of each instance variables with the help of the setter that sets all the values. Display the values.
- Now change the value of each instance variable using setter for each instance variable. Display current value of each after the changes are done. Use getters for each to accomplish this.
Step by Step Solution
★★★★★
3.44 Rating (157 Votes )
There are 3 Steps involved in it
Step: 1
Heres the Java application with the corrected naming conventions Singerjava java package singerRecords Use lowercase for packages public class Singer private int id private String name private String ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started