Project Name: Flashcards Project Description: In this project, you will be building an application that allows users to

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Project Name: Flashcards Project Description: In this project, you will be building an application that allows users to

Post by answerhappygod »

Project Name Flashcards Project Description In This Project You Will Be Building An Application That Allows Users To 1
Project Name Flashcards Project Description In This Project You Will Be Building An Application That Allows Users To 1 (45.85 KiB) Viewed 51 times
public class Flashcards {
private static String[] questions;
private static String[] answers;
/**
* Adds a flashcard to the game.
* @param question The quuestion.
* @param answer The answer.
* @return True if the question/answer was added, False otherwise.
*/
public static boolean addFlashcard(String question, String answer) {
boolean result = true;
// TODO: Your code goes here.
return result;
}
/**
* Determines if the selected answer matches the answer paired with
* the question.
* @param question The index returned by the pickQuestion() function.
* @param answer The answer supplied by the user.
* @return True if the supplied answer is the same as the answer paired
* with the question. False otherwise.
*/
public static boolean verifyAnswer(int question, String answer) {
boolean result = true;
// TODO: Your code goes here.
return result;
}
/**
* Randomly picks a question from the questions avaiable in the
* questions array.
* @return An index in the range [0, questions.length - 1].
*/
public static int pickQuestion() {
int result = 0;
// TODO: Your code goes here.
return result;
}
/**
* Implements the main and secondary loops that allow the user to
* play the game.
*/
public static void start() {
}
/**
* Runs your implementation so it can be tested/graded.
* DO NOT MODIFY THIS CODE.
* @param args Arguments passed in from a CLI or app runner.
*/
public static void main(String[] args) {
}
}
Project Name Flashcards Project Description In This Project You Will Be Building An Application That Allows Users To 2
Project Name Flashcards Project Description In This Project You Will Be Building An Application That Allows Users To 2 (45.85 KiB) Viewed 51 times
Project Name Flashcards Project Description In This Project You Will Be Building An Application That Allows Users To 3
Project Name Flashcards Project Description In This Project You Will Be Building An Application That Allows Users To 3 (47.8 KiB) Viewed 51 times
Project Name Flashcards Project Description In This Project You Will Be Building An Application That Allows Users To 4
Project Name Flashcards Project Description In This Project You Will Be Building An Application That Allows Users To 4 (40.53 KiB) Viewed 51 times
Project Name: Flashcards Project Description: In this project, you will be building an application that allows users to load in several flashcards then quiz themselves on them. For something like this, we would keep our flashcards in a file like a text file or database, but you guys do not know how to do that, so we are just going to give the user the option of manually adding flashcards to the application a Your application should continually prompt a user to enter a flashcard, practice, print their questions and answers, or exit the application. If a user chooses to enter a flashcard, the application should first prompt the user to enter a question. It should then prompt them to enter an answer. If a user chooses to practice, the application should repeatedly pick a random flashcard then prompt the user for the answer. The application should check their answer and inform them if they get it correct or incorrect. It should then prompt the user to either continue practice or to exit practice. If the user chooses to exit practice, the application should retum to the previous menu where you prompted the user to enter a flashcard, practice, or exit. If the use chooses to print their questions and answers, it should print cach question-and-answer pair on its own line. If the user chooses to exit the application, the application should inform them of the number of questions they answered correctly and the number of questions they answered incorrectly. Hints • If it is not clear, your application will need to use two loops. The main loopis sed to run the program and prompts the user to enter a flashcard, practice, or exit the application The secondary loop runs the practice session and prompts the user to continue practice or exit practice. . I suggest limiting the user to entering a certain number of questions and answers Computer memory is not limited and nor is the patience of someone entering these questions and answers into your program, • Store your questions and answers in two separate arrays. When a user enters a question answer pair, add the question to the end of the question array and add the answer to the end of the answer array. You need to maintain a counter that keeps track of the

number of question/answer pairs answered. This way, when you add a questionanswer you can do something like question(totalQuestions) – question;" and "answers totalQuestions] = answer, and totalQuestions++ • When you randomly pick a question, generate it in the range [0, totalQuestions). This can be done using 'int question = (int)(Math.random() * totalQuestions): Project Requirements: To receive full credit for this project, your project must satisfy the following requirements: 1. Your project shall have a main loop that prompts the user to enter a flashcard, practice their flashcards, print their questions and answers, and exit the application 2. Your project shall enter a secondary loop when the user chooses to practice their flashcards. This second loop shall continually prompt the user to continue practicing or return to the main menu 3. Your project shall implement the prior two requirements in the start() function 4. Your project shall display a question and take an answer from the user cach time the user chooses to continue practicing. 5. Your project shall tell the user whether they answered a question correctly or incorrectly. 6. Your project shall keep a running total of the number of questions answered correctly and the number of questions answered incorrectly. 7. Your project shall prompt the user to enter a question and answer if they choose to enter a flashcard from the main loop 8. Your project shall keep track of the questions and answers entered by the user. 9. Your project shall allow the user to exit the main loop 10. Your project shall allow the user to exit the secondary loop. 11. Your project shall inform the user that they cannot enter any more flashcards if there is no more room for them in your application 12. Your project shall print the questions and answers, cach as pairs on their own line when the user chooses to print them from the main loop Learning Objectives: A student that successfully enters this project shall be able to

• Display familiarity with loops and nested loops by being able to successfully declare and utilize them • Display familiarity with functions by being able to identify code that would be suitable for a function and extracting this code into a function. • Display familiarity with working with arrays and parallel arrays by being able to leverage them as a storage space for user data • Display familiarity with string functions such as equals by being able to successfully apply them to solve a problem • Display familiarity with various data types by leveraging them in the implementation of a Java program • Display familiarity with conditional logic and control structures by leveraging them in the implementation of a Java program Project Structure The following list outlines the functions that you need to provide and implement. It is up to you to define how they interact. At a minimum, you must implement these functions: public static boolean addFlashcard(String question, String answer): This function should add a question/answer pair to the question/answer arrays. It should return false if there is no more room in the question answer arrays (hortal Questions - questions_length) or the question is empty or null or the answer is empty or null. Otherwise, it should return true. public static boolean verifyAnswer(int question): This function should verify the answer given by the user for the indicated question. If the user provided answer matches the questions answer, return true. Otherwise, you should return false. public static int pickQuestion(): This function should pick a question at random and return it's index in the question array. This let's you easily look up the question and it's corresponding answer. public static void starto: This function should implement the looping mechanisms described in this document that lets the user play the game
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply