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
-
content area top Part 1 Absolute Systems allocates manufacturing overhead based on machine hours. Each connector should require 13 machine hours. According to the static budget, Absolute expected to...
-
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...
-
Xenakis, a young Greek person, arrives on the first day of summer in Byblos, a Phoenician port city. His parents, respectable rich merchants in Athens, have sent him on a world journey to discover...
-
Padillio Company had the following transactions involving notes payable. July 1, 2014 Borrows $60,000 from Fourth National Bank by signing a 9-month, 8% note. Nov. 1, 2014 Borrows $50,000 from...
-
What are the two basic requirements to support the declaration of a cash dividend? What are the effects of a cash dividend on assets and shareholders equity?
-
1. What is the chief characteristic of first principles, both of demonstration and of practical reason? 2. What is the difference between something being self-evident in itself and self-evident to...
-
Please solve both of the questions. You don't need to include detailed steps and explanations just upload the correct answer to fill the boxes. [-/4 Points] DETAILS Find the derivative of the...
-
Write a paper about Fire disaster management policies
-
What is the main function of a flywheel?
-
Define coefficient of fluctuation of energy and coefficient fluctuation of speed.
-
What is a compound pendulum?
-
Define the following terms and briefly indicate their importance to planning an audit engagement: audit risk, inherent risk, control risk, environment risk, and detection risk.
-
Write the relationship between coefficient of fluctuation of speed, maximum fluctuation of energy and kinetic energy of flywheel.
-
Kathy Perry opens a web consulting business called Perry Consulting and completes the following transactions in March. Using the following transactions, record journal entries, create financial...
-
Use the formula to determine the value of the indicated variable for the values given. Use a calculator when one is needed. When necessary, use the key on your calculator and round answers to the...
-
Three spanning trees of Graph \(K\), which include edges \(m n\) and \(o q\), but do not include no. Use the figure shown to draw three possible spanning trees that fit the given description. b C d e...
-
Graph 18 Use Kruskal's Algorithm to find a minimum spanning tree of the given graph. Graph it and calculate its weight. 9.3 a 1.5 13.3 5.2 8.7 Graph 17 2.0 50' 100 110 250 300 90 75 225 210 425 Graph...
-
The Prepaid Insurance account began the year with a balance of $460. During the year, insurance in the amount of $1,040 was purchased. At the end of the year (December 31), the amount of insurance...
Study smarter with the SolutionInn App