Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hey, I really need help learning about how to code this one. I sent this in yesterday, but I got no response, I was missing

Hey, I really need help learning about how to code this one. I sent this in yesterday, but I got no response, I was missing some information, and my question was gonna get canceled anyway so here I go again.

This is all one question (im pretty sure you cant do one part without knowing about the other) so I apologize in advance for all this mess to explain.

One of the parts says that you have to create questions from a textbook, but I just found a txt file with coding questions...so I'm just going to ask you to explain the coding using those questions and answers (at the bottom).

image text in transcribedimage text in transcribedimage text in transcribed
This project includes many of the concepts we have learned: objectoriented programming, inheritance, exception handling, and using existing classes such as String, ArrayList, and File. Tip: All. of the concepts and classes needed in this project have example programs in the class hook and in the slides that allow you to quickly nd out how these classes can be used. For example, the File class is prmented in Chapter 12. Trainer. java Write a program 'I'rainer.java that allows you to import a question bank in form of a text le and to train to answer the questions in the question hank correctly. Emctionalityi Part 1 Once started the trainer displays a question. The user needs to answer it and hit enter. The program gives feedback if the answer is correct or not. Each question is displayed once, the order is random and changes when repeated. When all the questions have been displayed once, the program tells the user how many questions have been asked and how many have been answered oorreotly. Implementation: Part 1 Follow the steps below for your implementation: o The question bank is a text file that follows the format in the example question bank QuestionBanl-r.txt. You can assume that this format is correctly followed. o Create a class called \"Entry". Each entry of your question bani: will he an object of type Entry. o Entry should have the following data elds: q for the question. a for the answer. further fields that you can determine, and appropriate methods. It should furthermore have a constructor that takm two Strings as parameters: q and a (question and answer). :- Overwrite the toStringU method of Entry to print out the question and answer of the entry. Q: How do you call a general binary relationship that describes an activity between two classes? A: association Q: What do you use to match, replace, or split strings by specifying a pattern? A: a regular expression Q: True or false (T/F)? An abstract class can be used as a data type. A: T Q: When the return type of a method is an array, it actually returns? : a reference to the array Q: What is the keyword for declaring an exception? : throws your class. . Use the File and Scanner classes to read your file. Test if it works by reading and printing each line of your file. Make sure to use a local path, so that your program will work on other machines as well. Test it by moving your java file and question bank into a different folder. . Parse your question bank and create an array of Entry objects as necessary using the ArrayList class. . With all the main components in place, implement the functionality of your trainer as described in the Functionality section above. . Use exception handling where necessary. . Create methods or further classes as appropriate. . Your program still needs to work if questions are added to or deleted from the question bank. Did you get everything to work until here? Well done! Now to make our trainer even more awesome, we are going to add further functionality. Functionality: Part 2 In this part, we want to be able to have multiple question bank files - one for each chapter - in a folder. The program needs to load all text files in this folder and to create a larger list of entries. The user can choose to either go through the questions of only a specific chapter or through all questions. Implementation: Part 2 Create a subclass of Entry, called Chapter. In addition to the functionality of Entry, it has a data field called ch that indicates the chapter. Create at least 5 questions and answers for at least 3 chapters of the book. Implement the functionality described above. You might need to create new methods or to overwrite existing methods

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

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions