2 Task BTask B builds upon the code from Task A. Submit the source code as arithmetic2.cpp.1. Enter the number of questions to answer. Ensure that the input is a positive integer. Continueprompting users with “The number of questions cannot be zero or negative. Re-enter: ” and acceptinput from users until a positive integer is provided.2. Utilize the code from Task A to generate questions involving addition (+), subtraction (-), multipli-cation (*), division (/), and remainder (%), with operands restricted to single-digit integers.3. Calculate and print the correctness percentage.4. If the percentage is 90 or higher, print ’A’; if it’s 80 or higher, print ’B’; if it’s 70 or higher, print ’C’;if it’s 60 or higher, print ’D’; otherwise, print ’F’.Here is a sample run: Enter the total number of questions to ask: -2The number of questions cannot be zero or negative. Re-enter: -1The number of questions cannot be zero or negative. Re-enter: 32(1) what is 1 / 2? 0true(2) what is 8 - 0? 8true(3) what is 5 - 5? 1falsepercentage correct: 66.6667%letter grade: D Here is another sample run: 1 Enter the total number of questions to ask: -12 The number of questions cannot be zero or negative. Re-enter: -23 The number of questions cannot be zero or negative. Re-enter: -34 The number of questions cannot be zero or negative. Re-enter: 556 (1) what is 4 - 0? 47 true89 (2) what is 2 / 3? 0.666710 false1112 (3) what is 9 * 7? 6313 true1415 (4) what is 7 - 7? 016 true1718 (5) what is 5 * 4? 2019 true2021 percentage correct: 80%22 letter grade: B Warning: To pass gradescope, the prompts must be exact matches.The prompt for percentage must be percentage correct: followed by a percentage number, ended with%.The prompt for letter grade must be letter grade: .3 Task CRead a csv (Command-Separated Values) file containing arithmetic expressions and their correspondinganswers, generate questions and answer them, calculate and report the correct rate. Based on the correctpercentage, print the corresponding letter grade.For example, consider the following CSV file. Each row contains items separated by commas, wherethe first item represents an arithmetic expression, and the second item is the corresponding answer for3that expression. 1 (3 + 2) % 2,12 3 + 2 % 2,33 1 + 3 % 2,24 1 + 4 % 2,15 1 + 4 / 2,36 1 / 2 * 3,07 1.0 / 2 * 3,1.58 1 / 2 * 3.0,09 1 / 2.0 * 3,1.5 A sample run of the code is as follows. 1 (1) what is (3 + 2) % 2? 12 true34 (2) what is 3 + 2 % 2? 35 true67 (3) what is 1 + 3 % 2? 28 true910 (4) what is 1 + 4 % 2? 111 true1213 (5) what is 1 + 4 / 2? 314 true1516 (6) what is 1 / 2 * 3? 017 true1819 (7) what is 1.0 / 2 * 3? 1.520 true2122 (8) what is 1 / 2 * 3.0? 023 true2425 (9) what is 1 / 2.0 * 3? 1.526 true2728 percentage correct: 100%29 letter grade: A
Question
2 Task BTask B builds upon the code from Task A. Submit the source code as arithmetic2.cpp.1. Enter the number of questions to answer. Ensure that the input is a positive integer. Continueprompting users with “The number of questions cannot be zero or negative. Re-enter: ” and acceptinput from users until a positive integer is provided.2. Utilize the code from Task A to generate questions involving addition (+), subtraction (-), multipli-cation (*), division (/), and remainder (%), with operands restricted to single-digit integers.3. Calculate and print the correctness percentage.4. If the percentage is 90 or higher, print ’A’; if it’s 80 or higher, print ’B’; if it’s 70 or higher, print ’C’;if it’s 60 or higher, print ’D’; otherwise, print ’F’.Here is a sample run: Enter the total number of questions to ask: -2The number of questions cannot be zero or negative. Re-enter: -1The number of questions cannot be zero or negative. Re-enter: 32(1) what is 1 / 2? 0true(2) what is 8 - 0? 8true(3) what is 5 - 5? 1falsepercentage correct: 66.6667%letter grade: D Here is another sample run: 1 Enter the total number of questions to ask: -12 The number of questions cannot be zero or negative. Re-enter: -23 The number of questions cannot be zero or negative. Re-enter: -34 The number of questions cannot be zero or negative. Re-enter: 556 (1) what is 4 - 0? 47 true89 (2) what is 2 / 3? 0.666710 false1112 (3) what is 9 * 7? 6313 true1415 (4) what is 7 - 7? 016 true1718 (5) what is 5 * 4? 2019 true2021 percentage correct: 80%22 letter grade: B Warning: To pass gradescope, the prompts must be exact matches.The prompt for percentage must be percentage correct: followed by a percentage number, ended with%.The prompt for letter grade must be letter grade: .3 Task CRead a csv (Command-Separated Values) file containing arithmetic expressions and their correspondinganswers, generate questions and answer them, calculate and report the correct rate. Based on the correctpercentage, print the corresponding letter grade.For example, consider the following CSV file. Each row contains items separated by commas, wherethe first item represents an arithmetic expression, and the second item is the corresponding answer for3that expression. 1 (3 + 2) % 2,12 3 + 2 % 2,33 1 + 3 % 2,24 1 + 4 % 2,15 1 + 4 / 2,36 1 / 2 * 3,07 1.0 / 2 * 3,1.58 1 / 2 * 3.0,09 1 / 2.0 * 3,1.5 A sample run of the code is as follows. 1 (1) what is (3 + 2) % 2? 12 true34 (2) what is 3 + 2 % 2? 35 true67 (3) what is 1 + 3 % 2? 28 true910 (4) what is 1 + 4 % 2? 111 true1213 (5) what is 1 + 4 / 2? 314 true1516 (6) what is 1 / 2 * 3? 017 true1819 (7) what is 1.0 / 2 * 3? 1.520 true2122 (8) what is 1 / 2 * 3.0? 023 true2425 (9) what is 1 / 2.0 * 3? 1.526 true2728 percentage correct: 100%29 letter grade: A
Solution
This task seems to be a programming assignment in C++. It involves creating a program that generates arithmetic questions for the user to answer. The program should keep track of the number of correct answers and calculate a percentage based on this. It should also assign a letter grade based on the percentage of correct answers. The program should also be able to read a CSV file containing arithmetic expressions and their corresponding answers, generate questions from this, and calculate the percentage of correct answers.
Similar Questions
Task B builds upon the code from Task A. Submit the source code as arithmetic2.cpp.1. Enter the number of questions to answer. Ensure that the input is a positive integer. Continueprompting users with “The number of questions cannot be zero or negative. Re-enter: ” and acceptinput from users until a positive integer is provided.2. Utilize the code from Task A to generate questions involving addition (+), subtraction (-), multipli-cation (*), division (/), and remainder (%), with operands restricted to single-digit integers.3. Calculate and print the correctness percentage.4. If the percentage is 90 or higher, print ’A’; if it’s 80 or higher, print ’B’; if it’s 70 or higher, print ’C’;if it’s 60 or higher, print ’D’; otherwise, print ’F’
Enter the number of questions to answer. Ensure that the input is a positive integer. Continueprompting users with “The number of questions cannot be zero or negative. Re-enter: ” and acceptinput from users until a positive integer is provided.2. Utilize the code from Task A to generate questions involving addition (+), subtraction (-), multipli-cation (*), division (/), and remainder (%), with operands restricted to single-digit integers.3. Calculate and print the correctness percentage.4. If the percentage is 90 or higher, print ’A’; if it’s 80 or higher, print ’B’; if it’s 70 or higher, print ’C’;if it’s 60 or higher, print ’D’; otherwise, print ’F’.
17. If there are only addition and subtraction, work from left to right.Group of answer choicesTrueFalse Flag question: Question 18Question 181 pts18. Any whole number has a denominator of 1.Group of answer choicesTrueFalse Flag question: Question 19Question 191 pts19. The sum of 4 ¾ and ½ is 4 ¼.Group of answer choicesTrueFalse Flag question: Question 20Question 201 pts20. 5/6 – 1/6 = 4/6 or 2/3Group of answer choicesTrueFalse
Write the following ratios in simplest form:Question 1Workboarda. 0.7 to 0.9 = SUBMIT (ATTEMPT 1 OF 2)Question 2Workboardb. 0.3 : 2.1 = SUBMIT (ATTEMPT 1 OF 2)Question 3Workboardc. 0.25 : 1.5 =
Problem StatementPriya is fascinated by maths and wants to calculate the value for the given expression: ++a * ++b / a. The program takes these 2 values as input, calculates the expression, and displays the result.Can you help her by writing a program?Input format :The first line consists of a integer value a, representing the first value.The second line consists of a integer value b, representing the second valueOutput format :The output displays a result as integer.Refer to the sample output for the formatting specifications.Code constraints :In the given scenario, the test cases fall under the following constraints:1<=a<=10001<=b<=1000Sample test cases :Input 1 :44Output 1 :5Input 2 :105Output 2 :6Input 3 :120500Output 3 :501
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.