Please complete the following tasks: Write a class “Actor” that contains two attributes with the appropriate level of visibility explicitly defined. “Name” which is a String, Private, “NumberofAwards” which is an integer, private Write a default Constructor for this class that initializes the name to “Bob Smith” , and the number of awards to 0. Write an overload the constructor for this class that accepts actor’s name as a parameter Write accessor methods for each of the attributes. Write a method “winsAnOscar” that increases the number of awards by one and prints “The crowd applauds for !” Be sure to use accessors where appropriate. Make sure your header is complete, with the appropriate level of visibility and any required keywords.
Please complete the following tasks:
Write a class “Actor” that contains two attributes with the appropriate level of visibility explicitly defined.
“Name” which is a String, Private,
“NumberofAwards” which is an integer, private
Write a default Constructor for this class that initializes the name to “Bob Smith” , and the number of awards to 0.
Write an overload the constructor for this class that accepts actor’s name as a parameter
Write accessor methods for each of the attributes.
Write a method “winsAnOscar” that increases the number of awards by one and prints “The crowd applauds for <actor’s name>!” Be sure to use accessors where appropriate.
Make sure your header is complete, with the appropriate level of visibility and any required keywords.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images