Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java For this project, you will need to build one custom class that can be used to display as many holiday greeting cards as needed,

java

For this project, you will need to build one custom class that can be used to display as many holiday greeting cards as needed, for any holiday. Build one class and make many instances of that class--one for each greeting card.

Deliverables:

The class must hold a greeting card number and several strings: the name of the person getting the greeting card, the name of the person sending the greeting card, the greeting card message and the occasion (Valentine's Day, Birthday, etc).

Do not create a class for each holiday. The idea is to create one class that will work for any holiday.

Your class must be separate from the class that holds the main method and must include:

Instance Field: You must have at least one instance field. All instance fields must be explicitly marked private. (5 points)

Static Field: You must have a static field to count the number of greeting card objects that are created. Use constructors to set the value of this field and another method to return the count.

Constructors: Your class must have a constructor without parameters and another constructor that accepts parameters to set at least one instance field. Both constructors must update the static field that holds the count of all greeting cards.

Accessor method: Your class must have one or more mutator (setter) methods with parameters to set private fields (2 points).

Mutator method: Your class must have one or more accessor (getter) methods to return private fields (3 points).

Instance Method: You will need an instance method to display the greeting card with all of its data elements. (5 points)

You must have a separate class to hold the Main method. The main method should create an instance of your greeting card class for a holiday greeting card (you choose the holiday) that uses one of the constructors and methods. Then, create another instance of the greeting card class for another holiday card (different holiday) that uses the other constructor (not previously used) as well as its methods.

For this project, you can make up your own greeting card message to send to a method of your greeting card class, or click on the above image for some ideas.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions