1) When your project begins execution, you should read the input file line by line. Feel free to use the Scanner class.
Posted: Sun May 15, 2022 11:45 am
CVS FILE:
What do you mean you need more of an "idea/n" ?
1) When your project begins execution, you should read the input file line by line. Feel free to use the Scanner class. Each line represents a card and has a 1 in 6 chance of making it into your deck, otherwise just discard it. Java's Random class can help with this. After reading the input file, you should have a deck of Tarot cards. 2) Ask the user for a number between 1 and 7. Draw that many cards, this is their HAND. If the first card drawn is an odd number, or you are unable to draw that many cards, this is BAD LUCK. 3) Print out the final card drawn, this is the user's FORTUNE CARD. 4) Now, we want to predict if the user is going to have good luck today using the following algorithm, mean magic. a. Take the sum of each drawn card's id. b. If the user has BAD LUCK, then subtract 50 from the sum. If the result is greater than 100, the user is going to have a GOOD HAIR DAY C. i. Otherwise, they are going to have a BAD HAIR DAY Print a message depending on whether they will be having a GOOD or BAD HAIR DAY. d. first is Input: The input tarot.csv contains rows, with each row representing a card containing 2 values, an ID number, and the second is the name of the card. Output: Print the appropriate message predicting whether the user is going to have good hair today. For example: Hmm.. your card is Page of Swords... How lucky! Looks like you are going to have a good hair day! or Hmm.. your card is Four of Wands... You might want to wear a hat today For more information, please see Chapter 15-18 Concepts Covered: OOP, data structures, linked-lists, stacks, files, strings, algorithms, Java, Random, dark magic? Please reach out to me with any questions.
What do you mean you need more of an "idea/n" ?
1) When your project begins execution, you should read the input file line by line. Feel free to use the Scanner class. Each line represents a card and has a 1 in 6 chance of making it into your deck, otherwise just discard it. Java's Random class can help with this. After reading the input file, you should have a deck of Tarot cards. 2) Ask the user for a number between 1 and 7. Draw that many cards, this is their HAND. If the first card drawn is an odd number, or you are unable to draw that many cards, this is BAD LUCK. 3) Print out the final card drawn, this is the user's FORTUNE CARD. 4) Now, we want to predict if the user is going to have good luck today using the following algorithm, mean magic. a. Take the sum of each drawn card's id. b. If the user has BAD LUCK, then subtract 50 from the sum. If the result is greater than 100, the user is going to have a GOOD HAIR DAY C. i. Otherwise, they are going to have a BAD HAIR DAY Print a message depending on whether they will be having a GOOD or BAD HAIR DAY. d. first is Input: The input tarot.csv contains rows, with each row representing a card containing 2 values, an ID number, and the second is the name of the card. Output: Print the appropriate message predicting whether the user is going to have good hair today. For example: Hmm.. your card is Page of Swords... How lucky! Looks like you are going to have a good hair day! or Hmm.. your card is Four of Wands... You might want to wear a hat today For more information, please see Chapter 15-18 Concepts Covered: OOP, data structures, linked-lists, stacks, files, strings, algorithms, Java, Random, dark magic? Please reach out to me with any questions.