debug this Java code This program demonstrates an array of String and integer objects. It should print
Fantastic news! We've Found the answer you've been seeking!
Question:
debug this Java code
![image](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/02/65bb7634cfc9e_30865bb76349fb14.jpg)
Transcribed Image Text:
This program demonstrates an array of String and integer objects. It should print out the days and the number of speeding tickets given in the last 4 days of April on Spriggs Road. It should print out the day with the least number of speeding tickets. You must use the findLowest () method within your solution to find the lowest day. This is what should display when the program runs as it should April 27 had 12 tickets. April 28 had 10 tickets. April 29 had 15 tickets. April 30 had 17 tickets. Lowest Day has 10 tickets. public class SpeedingTicketsDebug { public static void main(String[] args) { String[] days = { "April 27", "April 28", "April 29", "April 30"}; int[] tickets = {12, 10, 15, 1,7}; int lowest = 0.0; String lowest Day = for (int index = 0; index < tickets. length; index++) { System.out.printf( "%s had %, d tickets. \n", days [index], tickets [index]); lowest find Lowest (tickets); System.out.printf("Lowest Day has %, d tickets.\n", lowest); //end of main public static double find Lowest(String[] myDays, int[] myTickets) { my Lowest = myDays [0]; for (int index = 1; index < myTickets.length index++) { if (myTickets [index] > lowest) { my Lowest = myTickets [index]; } This program demonstrates an array of String and integer objects. It should print out the days and the number of speeding tickets given in the last 4 days of April on Spriggs Road. It should print out the day with the least number of speeding tickets. You must use the findLowest () method within your solution to find the lowest day. This is what should display when the program runs as it should April 27 had 12 tickets. April 28 had 10 tickets. April 29 had 15 tickets. April 30 had 17 tickets. Lowest Day has 10 tickets. public class SpeedingTicketsDebug { public static void main(String[] args) { String[] days = { "April 27", "April 28", "April 29", "April 30"}; int[] tickets = {12, 10, 15, 1,7}; int lowest = 0.0; String lowest Day = for (int index = 0; index < tickets. length; index++) { System.out.printf( "%s had %, d tickets. \n", days [index], tickets [index]); lowest find Lowest (tickets); System.out.printf("Lowest Day has %, d tickets.\n", lowest); //end of main public static double find Lowest(String[] myDays, int[] myTickets) { my Lowest = myDays [0]; for (int index = 1; index < myTickets.length index++) { if (myTickets [index] > lowest) { my Lowest = myTickets [index]; }
Expert Answer:
Answer rating: 100% (QA)
Heres the corrected Java code with explanations for the changes public class SpeedingTicketsDebug pu... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
calculate the mean (up to 2 decimal places) for the variable "Arrests".Arrests 12, 2 2 3 10 8 2 6 3 1 20
-
Predictive text entry systems are familiar on touch screens and mobile phones. This question asks you to consider how the same principles might be used in a programming editor for creating Java code....
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
Craig Industries was in the business of manufacturing charcoal. Craig, the corporation's president, contracted in the name of the corporation to sell the company's plants to Husky Industries. Craig...
-
Write interval notation for the graph. (a) (b) (c) 6 -5-4-3-21 02 3 456 -6 -5 -3-210 1 2 3 4 5 6 10 -9-876-54-3-21 0 2
-
If a McDonalds Big Mac sells for $4.00, how much will it cost in the currencies of (a) Brazil? (b) Japan? (c) Indonesia?
-
Sales Budget (Learning Objective 2)} In a series of Short Exercises, you will prepare parts of the master budget for Grippers, which sells its rock-climbing shoes worldwide. We will concentrate on...
-
Calculating Project NPV you have been hired as a consultant for Pristine Urban-Tech Zither, Inc. (PUTZ), manufacturers of fine zithers. The market for, zithers is growing quickly. The company bought...
-
Financial Statement Analysis, Eleventh EditionQuaker Oats Company Refer to the financial statements of Quaker Oats Company in Problem 9?6. Prepare a forecasted income statement for Year 12 using the...
-
What are the major causes of information risk? How can information risk be reduced?
-
@BC-3 rad/s 2 m 4 rad/s 5 rad/s 4 0.5 m Find acceleration of slider block C. Hint: use this equation O a. 5 m/s2 b. 9 m/s C. none of the mentioned d. 13 m/s ac = + OBCX FC/B-002BC C/B
-
Calculate the half-cell potential of Ni in 0.1M NiCl2. The half-cell is represented as: NiNi2+, Cl- (0.1M). Cation Anion Ag+ +77.1 Br -102.8 Al3+ -483.1 cl -131.1 Au+ +410.8 F -274.8 Ca2+ +555.1...
-
You are the senior manager in charge of innovation at your company. Over the past several years you company has done, only OKAY, in terms of developing a new-product development portfolio. After...
-
Create the database for your system and importing the data from your .csv file from Microsoft access
-
List the three main approaches to database programming. What are the advantages and disadvantages of each approach?
-
Explain why global production and supply chain management decisions are of central importance to many global companies.
-
Problem 4 (15 Points) During 2020, Masefield, Inc. had the following convertible securities outstanding: $200,000 of 6% convertible bonds. Each $1,000 bond is convertible into 30 shares of common...
-
Avatar Financials, Inc., located on Madison Avenue, New York City, is a company that provides financial advice to individuals and small- to mid-sized businesses. Its primary operations are in wealth...
-
What safeguards does C++ provide to keep you from exceeding the limits of an integer type?
-
What feature of the output method definitions allows you to concatenate output?
-
What class methods does the compiler generate automatically if you dont provide them explicitly? Describe how these implicitly generated functions behave.
-
How are coercive power and negative influence tactics related?
-
In what ways is organizational politics destructive?
-
When should different influence strategies be used?
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App