Project1 Exercise Overview Implement a Java program that creates math flashcards for elementary grade students. User will enter his/her name, the type (+, -, *, /), the range of the factors to be used...

There are total of 3 coding projects and but are all related. Please answer all the questions that are marked red.




Project1 Exercise Overview Implement a Java program that creates math flashcards for elementary grade students. User will enter his/her name, the type (+, -, *, /), the range of the factors to be used in the problems, and the number of problems to work. The system will provide problems, evaluate user responses to the problems, score the problems, and provide statistics about the session at the end. Functional Requirements · User enters name at the beginning of a session. · System covers four math operations – addition, subtraction, multiplication, and division – with the user choosing which of the four operations to do in the session. Only 1 type of problem can be done in each session. · User will enter additional session parameters from prompts – number of problems to work and the range of values desired in the problems, e.g., addition with factors ranging from 0 to 12. · System will present problems to the user. · User will respond to problems with an answer and the system will provide immediate feedback for each problem, correct or incorrect. · System will provide summary statistics for the session once all problems are completed, including user name, date and time, operation chosen for the problems, range selected for the problems, number of problems, number of problems correct, percentage score, duration of the session. Technical Requirements The system should include the following Java components: · Name of your source code main class as follows: YourName_Project1.java · Methods to prompt the user and to get values for input variables, e.g., user name, number of problems, range of values, etc. · Switch statement for selecting the math operation to perform (cases). · Loop to create the selected number of problems for the session, · Method to get the factors for the problems. · Math.random() used in the creation of the problems. · System.currentTimeMillis() used to record the start time, end time, and calculate the duration of the session in seconds. · java.time.LocalTime.now() method to display date and time of session. Example output (from the Eclipse console) Enter your name: Hello Enter "A" for Addition, "S" for Subtraction, "M" for Multiplication, "D" for Division: M Enter the number of problems you wish to work: 3 What are the low and high numbers you want in your problems? Enter the low value for your problems: 0 Enter the high value for your problems: 10 10 * 0 = 0 Correct 2 * 3 = 5 Incorrect 8 * 9 = 72 Correct Session Summary 3 problems, 2 correct Score is 67, Time is 11 seconds Session for Hello was Multiplication on 2020-08-24 at 00:09:40.401 Hints. · To create your problems, code the addition case first. Then replicate and edit it for the others. · For the subtraction case, get the factors in the range, add them together so the sum becomes the minuend, one of the factors is the subtrahend, and the other factor is the difference. · For multiplication, get the factors in the range, similar to how you did the addition case. · For the division case, get the factors in the range, multiply them as you would in a multiplication problem. The product becomes the dividend, one of the factors becomes the divisor, and the other factor is the quotient. Analysis. Describe the problem including input, processing, primary calculations, and output in your own words. (5 pts) Design. Describe the major steps for solving the problem. (5 pts) Coding. Copy and paste source code and a sample output from your program in the space below. (20 pts) Testing. Describe how you tested this program. (5 pts) Project2 Exercise Overview Starting with the FlashCards system you developed in Project 1, refactor your code to enhance the user experience and to use objects and classes. All functional requirements in Project 1 remain, except where enhancing the system replaces specific functions. Overview from Project 1. Implement a Java program that creates math flashcards for elementary grade students. User will enter his/her name, the type (+, -, *, /), the range of the factors to be used in the problems, and the number of problems to work. The system will provide problems, evaluate user responses to the problems, score the problems, and provide statistics about the session at the end. Functional Requirements · The console entry point for the user inputs is on the same line as the prompt. (new) · User enters name at the beginning of a session. · System covers four math operations – addition, subtraction, multiplication, and division – with the user choosing which of the four operations to do in the session. Only 1 type of problem can be done in each session. · System should accept the following characters as inputs in both upper- and lower-case: ‘A’ for addition, ‘S’ for subtraction, ‘M’ for multiplication, and ‘D’ for division. (new) · User enters additional session parameters from prompts – number of problems to work and the range of values desired in the problems. · System presents problems to the user. · Entry point for the user response is after the equal sign and a space (‘ = ’). (new) · In the ‘Division’ case, division by zero is not allowed. System provides a different factor(s) when the situation occurs. (specified but not truly new) · User responds to problems with an answer and the system will provide immediate feedback for each problem, ‘correct’ or ‘incorrect.’ · System provides summary statistics for the session once all problems are completed. Specifically provide the following 3 types of finishing data (see sample output): · Quick Summary: number of problems, number of problems correct, score as indicated by a percentage of problems correct, and the amount of time in seconds required to complete the problems. · A complete, space and comma-delimited, unlabeled record of the session – user name, operation type, range of factors, date and time of the session (at end), number of problems, number of problems correct, score shown as the number of correct problems out of the total problems, and the time in seconds spent working on the problems. (new) · A list of the problems in the session, including user responses and an indicator of correct/incorrect (see sample output). (new) Technical Requirements The system should include the following Java components (most of these are new so ‘new’ is not specified for each): · Name of your source code main class as follows: YourName_Project1.java · At least 2 object classes (Session and Problems) and one driver class · No methods in the driver class · All user inputs prompted and captured in the driver class · No user inputs prompted and captured in the object classes · All data variables in the object classes have a visibility of private · Update and access to the data variables in the object classes accomplished via setter and getter methods (this is required because the data variables are not visible) · Switch statement for selecting the math operation to perform (cases) catches both upper- and lower-case characters · Loop to create the selected number of problems for the session · Use of the Random class for the creation of the problems · A String array used to record the problems; use a loop to display the string variables at the end of the session · System.currentTimeMillis() used to record the start time, end time, and calculate the duration of the session in seconds (be sure to divide milliseconds by 1000!) · Start time recorded immediately before the problems begin (not at the beginning of the session when user-inputs are captured) · End time recorded immediately after the problems for the session are completed · Use the LocalDateTime class and the DateTimeFormatter class to display date and time of session. Example output (from the Eclipse console) Enter your name: Hello Choose the type of problems you wish to work. Enter 'A' for Addition, 'S' for Subtraction, 'M' for Multiplication, or 'D' for Division: d Enter the number of problems you wish to work: 5 Enter the lowest value for the range of factors in your problems: 0 Enter the highest value for the range of factors in your problems: 10 16 / 8 = 2 correct 90 / 10 = 9 correct 50 / 10 = 5 correct 0 / 9 = 0 correct 0 / 10 = 1 incorrect Session Summary 5 problems, 4 correct, score is 80, time is 20 sec Session: Hello, Division, 0, 10, 2020-09-15, 22:32:53, 5, 4, 80, 20 16 / 8 = 2 A: 2 correct 90 / 10 = 9 A: 9 correct 50 / 10 = 5 A: 5 correct 0 / 9 = 0 A: 0 correct 0 / 10 = 1 A: 0 incorrect Hints. · To create your problems, code the addition case first. Then replicate and edit it for the others. Reasonably try to minimize the unique code in case. · For the subtraction case, get the factors in the range, add them together so the sum becomes the minuend, one of the factors is the subtrahend, and the other factor is the difference. · For multiplication, get the factors in the range, similar to getting the sum for the addition case. · For the division case, get the factors in the range, multiply them as you would in a multiplication problem. The product becomes the dividend, one of the factors becomes the divisor, and the other factor is the quotient. · To start, spend time thinking about the design before you start coding. · Create the two object classes with their logical data variables. · Determine which data variables are in the Session class and which are in the Problems class. Designate the data variables in these object classes private at the beginning of your coding process. · Outline the flow of your driver class. · Create a stub for the methods you expect to use, realizing these are only a draft and are likely to change as you proceed with coding. · Begin to develop the flow in the driver class, starting with the prompting for the user-inputs. · Write the object class methods as you need them in driver class. Analysis. Describe any analysis that is required for solving the problem, including a discussion of key elements and complex statements or logic of the system. (5 pts) Design. Describe the major steps for solving the problem (developing the code). A high-level outline of the classes and the variables
Oct 20, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here