subject

For this project, you will need to build a Java class to hold a greeting card. The class must hold several strings: the name of the person getting the greeting card (recipient), the name of the person sending the greeting card (sender), the greeting card message and the occasion (Valentine's Day, Birthday, etc). For this project, you can make up your own greeting card message to store in an object of your greeting card class. Note: I do not award or deduct points for style, but to make grading easier on me, please to do use comments to explain your code. find explanatory comments distracting. If you need comments for your own use, save a copy for yourself, then remove the comments before uploading your work. User Interface Logic Main Class This class will be responsible for any and all user interaction. This means that if you want to get input from the user, or display output to the user, all of that code must be in the main class. This keeps all user interaction in one class, separate from the business logic of the program. By keeping your user interface logic in a separate class, it will make it SO much easier to reuse your business logic classes in other types of applications, like GUI applications, later on. Create a main method in its own class. The main method should create an object of the cardOrganizer class (defined below) and call its methods for testing purposes. Display the return values of all methods that return a value. Business Logic greetingCard Class private member data o String sender o String recipient o String message e String occasion public methods: o public greetingCard(String sender, String recipient, String message, String occasion): A constructor with parameters to set the instance variables. o public String toString0: This method should return a string that contains all of the private member data as a single string. Be kind to your client and make it readable. o An accessor (getter) method for each instance variable. CardOrganizer Class Create a separate class called cardOrganizer that has an array of greetingCard objects as a private instance member of the cardOrganizer class. The array of greetingCard objects should be max size 20. The cardOrganizer class must also have the methods listed below, but you can create more helper methods if needed. To perform a search, you can use a linear search (sequential search) or it could use the binary search algorithm &described in the modules. Note: This class has a toString method with the same signature as the greetingCard class toString method. It is very easy to mix these up. Be careful to call the correct toString method by using the appropriate object when calling it. o public bool addCard(String sender, String recipient, String message, String occasion) This method should add one card to the cardOrganizer object. To do this, create an object of the greetingCard class and fill it with data, then add that object to the array in the next available position in the array. You will need an instance variable to hold the count of every object that you put in the array to keep track of the next available position. Call this method multiple times to add more than one card to the organizer. Return true if the add succeeds and return false if there is no room in the array to add the card. public String findRecipient(String recipient) This method should search the array and return the String from the greetingCard class toString method for the first occurrence of the recipient in the array of greetingCards that matches the recipient parameter value o public void displayCards(String occasion)- -This method should display all greetingcards in the array if the card's occasion matches the occasion parameter value. o public String toString This method will return a string that holds the entire cardOrganizer array, but will only include the recipient and the occasion, not all instance variable values for its greetingCards. You can choose how the information is formatted in the string, but be kind to your client and make it readable. Paste the output of your program in the submission window and upload your .java file(s) to submit your work.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:30
Someone wishes to run the software on another computer system that runs an operating system that does not support the software what can he do
Answers: 3
question
Computers and Technology, 22.06.2019 10:00
When is an original work considered public domain? a. when posted via social media b. when it is posted on the internet c. when a copyright symbol is not included with the piece of work d. when explicit permission is given by the author / owner
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
Companies that implement and apply an information system effectively can create
Answers: 1
question
Computers and Technology, 24.06.2019 00:20
Describe a data structures that supports the stack push and pop operations and a third operation findmin, which returns the smallest element in the data structure, all in o(1) worst-case time.
Answers: 2
You know the right answer?
For this project, you will need to build a Java class to hold a greeting card. The class must hold s...
Questions
question
Mathematics, 23.03.2020 19:06
Questions on the website: 13722363