Programmers frequently need to debug code. Sometimes it's their own code, but often its code written...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Programmers frequently need to debug code. Sometimes it's their own code, but often its code written by other programmers. In this exercise you will be given an IntelliJ project containing a program with several bugs. Some are syntax errors and others are logic errors. You will debug the program and get it working correctly. The Intellij file contains a set of unit tests. Fortunately, there are no errors in the unit tests (though the tests may detect errors in other parts of the code). The Program The program is designed to quiz young students on arithmetic problems. It quizzes students on addition, subtraction, and multiplication problems using pairs of random operands that can range from one to twelve. The program will present the student with six arithmetic problems. For each problem, the student will type their answer (followed by the Enter key). The program will tell the student if they were correct or wrong. If the student was wrong, the program will provide the correct answer. After the student completes the six problems, the program will tell the student how many problems they answered correctly and how many problems they got wrong. If the student had no wrong answers, the program will tell them their results were "Excellent!". Sample Output *** Arithmetic Quiz Answer 6 Questions Compute 10-2 = 8 Correct! DTERM Compute 68 -2 Correct! x Compute 5 x 3 15 Correct! Compute 9 x 2 = 18 Correct! Compute 125 = 7 Correct! Compute 6 x 6-30 Wrong! The answer is 36 Your score: 5 Correct 1 Wrong Programmers frequently need to debug code. Sometimes it's their own code, but often its code written by other programmers. In this exercise you will be given an IntelliJ project containing a program with several bugs. Some are syntax errors and others are logic errors. You will debug the program and get it working correctly. The Intellij file contains a set of unit tests. Fortunately, there are no errors in the unit tests (though the tests may detect errors in other parts of the code). The Program The program is designed to quiz young students on arithmetic problems. It quizzes students on addition, subtraction, and multiplication problems using pairs of random operands that can range from one to twelve. The program will present the student with six arithmetic problems. For each problem, the student will type their answer (followed by the Enter key). The program will tell the student if they were correct or wrong. If the student was wrong, the program will provide the correct answer. After the student completes the six problems, the program will tell the student how many problems they answered correctly and how many problems they got wrong. If the student had no wrong answers, the program will tell them their results were "Excellent!". Sample Output *** Arithmetic Quiz Answer 6 Questions Compute 10-2 = 8 Correct! DTERM Compute 68 -2 Correct! x Compute 5 x 3 15 Correct! Compute 9 x 2 = 18 Correct! Compute 125 = 7 Correct! Compute 6 x 6-30 Wrong! The answer is 36 Your score: 5 Correct 1 Wrong
Expert Answer:
Answer rating: 100% (QA)
To debug the code we will need to fix syntax errors and logic errors Here is the corrected code java ... View the full answer
Related Book For
Probability And Statistics
ISBN: 9780321500465
4th Edition
Authors: Morris H. DeGroot, Mark J. Schervish
Posted Date:
Students also viewed these programming questions
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Assume you are given the following abbreviated financial statements: On the basis of this information, calculate as many liquidity, activity, leverage, profitability, and common stock measures as you...
-
aWhat sources of information on a business economic situation, other than financial statements, are available to the general public?
-
The heights of male students at a university have a nearly normal distribution with mean 70 inches and standard deviation 2.8 inches. If 5 male students are randomly selected to make up an intramural...
-
Assess the role of kinship in immigration and transmigration.
-
The stockholders' equity section on the balance sheet of Dillard's, a popular department store, is shown below. The company reported a net loss of $241,065,000 and declared and paid dividends of...
-
Consider the following account balances of Evan McGruder, Incorporated, as of December 31, Year 3 Accounts Payable Equipment Common Stock Income Tax Payable $ 118,020 Retained Earnings 421,900 Notes...
-
You are a Sales Executive at the Marriott Hotel in downtown Toronto who has just completed a training course in sales and negotiation Last week , you met with Erin Adkins of the North York YWCA , and...
-
The following figure represents a hospital facing both private and Medicare patients. Please use the graph to answer the following questions. Hospital Payment ($) Patients (Hospital Admissions) A....
-
1. The figure below shows Jenny's feasible frontier and indifference curves. Assume that her current allocation of time for study and leisure is represented by point C. Explain why Jenny's utility is...
-
2. The below graph shows the current equilibrium in the market for avocados in China and this market is assumed to be competitive. Now suppose that avocado growers in China experience harsh weather...
-
Solve Differential Equations 7. xydx + (x + y)dy = 0 ydx+(3x-xy+2)dy=0 8. 9. 10. 11. ydx xdy+ln xdx=0 - 1 y'+-y: X COS X X y' = e/x + y X 12. x1-y + yy'1-x =0
-
A pharmaceutical company believes a new drug will lower LDL cholesterol levels. A group of 40 people with high LDL cholesterol levels (above 240 mg/dL) are to be given the new drug for a trial...
-
Read the article Mobile Applications as Cloud Computing: Implementation and Challenge and write a paper on it
-
Solve each problem. Find the coordinates of the points of intersection of the line y = 2 and the circle with center at (4, 5) and radius 4.
-
Last year during the week of July 4th, Murrysville Regional Hospital reported that they treated 264 patients for fireworks-related injuries.
-
The number of stores a person visits on a shopping trip Name and define the four types of measurement levels used in statistics. determine whether the data are qualitative or quantitative.
-
During a recent year, the average U.S. diners spent a month on food prepared outside the home was \($144\) . What is meant by a biased sample? determine whether descriptive or inferential statistics...
Study smarter with the SolutionInn App