Implement the class Character  The role should be “primary” or “secondary” all other values are not acceptable. Consider capital and small letters variance.  The gender should be “m” or “M” for male or “f” or “F” for female.  The age should be a positive value.  The giveRaise method increase the salary of a character by a given percentage with a maximum salary of 10000.  The toString method returns a string that describes the character. For example: [Elisabeth Kane, female, 35, primary,4500$]

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Implement the class Character
 The role should be “primary” or “secondary” all other values are not acceptable. Consider
capital and small letters variance.
 The gender should be “m” or “M” for male or “f” or “F” for female.
 The age should be a positive value.
 The giveRaise method increase the salary of a character by a given percentage with a
maximum salary of 10000.
 The toString method returns a string that describes the character. For example:

[Elisabeth Kane, female, 35, primary,4500$]

2) Implement the class Play
 A Play can have at most 20 characters.
 The real number of characters is registered in nbOfCharacters and is updated automatically
when a new character is added.
 AddCharacter method adds a new character to the characters array and updates the
nbOfCharacters value.
 The attribute nbPlay keeps track of the number of Plays created.
 The toString method returns a string description of the play including name, genre and the
names of all the characters.
Example: [The Opera Crime,Drama,

Characters: Loulou Grill – Boby – Elisabeth Kane]

3) Write an application with a main method that allows you to:
a) Create a play with values given by the user.(name, genre).
b) Add 3 characters of your choice to this play.
c) Display a total number of characters in the play.
d) Display the number of primary characters and the number of secondary characters.
e) Display the total of all salaries of the play characters.
f) Give the second character in this play a raise of 25%.
g) Display all information about the play.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Methods of StringBuilder class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education