Assignment: Hallmark has asked you to implement a system for them so that a user
ID: 3650211 • Letter: A
Question
Assignment: Hallmark has asked you to implement a system for them so that a user can choose from a list of available cards. There are 9 cards to choose from: Christmas, Valentine's, Birthday, Get well soon, Anniversary, New baby, Thank you, Congratulations, and blank. Your program asks the user who the card is for and who it is from. If it is a birthday card, it also asks how old the recipient is. If it is a blank card it asks what personal message the sender would like to include. If it is a Valentine's day card it personalizes the card by adding XOs to the end of the card (hugs and kisses) based on the length of the recipient's name. Create the cards by extending an abstract class Card and using an abstract method called makeCard that is defined for each card.Here is what I have so far:
import java.util.*;
import java.io.*;
abstract class Card
{
static Scanner input = new Scanner(System.in);
public static void main(String[] args)
{
// Declares the strings for the first names of both the sender and reciever
// Declares the strings for age and personal message to be used in the birthday and blank cards
String forfirstname, forlastname, fromfirstname, fromlastname, age, message;
char choice;
// Initializes the name of the reciever
System.out.println("Please enter the first name of the person you wish to send the card to:");
forfirstname = input.next();
System.out.println("Please enter the last name of the person you wish to send the card to:");
forlastname = input.next();
// Initializes the name of the sender
System.out.println("Please enter the first name of the person who's sending the card:");
fromfirstname = input.next();
System.out.println("Please enter the last name of the person who's sending the card:");
fromlastname = input.next();
System.out.flush();
// Prints out a menu which allows the user to choose what type of card he wants to create
System.out.println("Please choose a card option from the menu below:");
System.out.println("Press 'A' for Christmas");
System.out.println("Press 'B' for Valentines");
System.out.println("Press 'C' for Birthday");
System.out.println("Press 'D' for Get Well Soon");
System.out.println("Press 'E' for Anniversary");
System.out.println("Press 'F' for New Baby");
System.out.println("Press 'G' for Thank You");
System.out.println("Press 'H' for Congratulations");
System.out.println("Press 'I' for Blank (Custom)");
choice = input.next().charAt(0);
}
}
I need help in determining my next step. I know I have to include the abstract method get card but I'm not exactly sure how I should go about doing that. Should I make a list of if statements relating to each menu choice then have an abstract method leading to each card creation class or am I creating more steps than I actually need? Any help would be great.
Explanation / Answer
Q?
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.