1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ipn [44]
3 years ago
7

An array of integers named parkingTickets has been declared and initialized to the number of parking tickets given out by the ci

ty police each day since the beginning of the current year. (Thus, the first element of the array contains the number of tickets given on January 1; the last element contains the number of tickets given today.) A variable named mostTickets has been declared, along with a variable k. Without using any additional variables, write some code that results in mostTickets containing the largest value found in parkingTickets.
Computers and Technology
1 answer:
Sedaia [141]3 years ago
6 0

Answer:

Following code will store the largest value in array parkingTickets in the variable mostTickets

mostTickets = parkingTickets[0];

for(int k = 0; k<parkingTickets.length; k++)

{

if(parkingTickets[i]>mostTickets)

{

 mostTickets = parkingTickets[i];

}

}

Explanation:

In the above code segment, initially the number of tickets at first index is assumed as largest value of tickets in array.

Then using a for loop each value in the array parkingTickets is compared with the current mostTickets value.

If the compared value in parkingTickets array is larger than the current mostTickets value. Then that value is assigned to mostTickets.

This process is repeated for all elements in array.

Thus after looping through each element of array the largest value in array will get stored in mostTickets variable.  

You might be interested in
The definition of an "analog device" is that it is a type of _____.
sveta [45]
ITS C hope it helps goo luck!
5 0
3 years ago
Imagine that you are preparing a multimedia presentation. What are the four things you need to consider when getting started?
Marrrta [24]

Explanation:

Consider the Content

Create an Outline

Develop Your Presentation

PRACTICE!!

8 0
3 years ago
Read 2 more answers
Approximately what percentage of the world population owns a smartphone?
Usimov [2.4K]
The number of smartphone users is forcast to grow from 2.1 billion in 2016 to around 2.5 billion in 2019, with smartphone penetration rates increasing as well.over 36% of the worlds population is projected to use a smartphone by 2018, thats up from about 10% in 2011
5 0
3 years ago
Producers must understand the marginal benefit of making an additional unit which shows the ...
yan [13]

Producers must understand the marginal benefit of making an additional unit which shows the possible gain. Marginal benefit is used in business and economics as a measurement of the change in benefits over the change in quantity. Possible gain is one example of benefit.  This measurement provides the relevant measurement of benefits at a specific level of production and consumption.

8 0
3 years ago
Read 2 more answers
¿que significa “TTAQMMQMPDATLSPLNDTMGCCLFEQMMPQTEIUMDR” ?
OlgaM077 [116]

Answer: what

Explanation:

5 0
2 years ago
Read 2 more answers
Other questions:
  • Write a program that determines the price of a movie ticket (similar to the one in the chapter). The program asks for the custom
    9·1 answer
  • What is industry 4.0 -automation revolution-, what is your opinion about the direction this revolution is taking the industry in
    8·1 answer
  • How can you autohide the taskbar in Windows 10?
    8·2 answers
  • Why do we allow electronic instruments to warm-up before use?
    11·1 answer
  • Three common risk factors for young drivers and how you plan to minimize these factors.
    13·1 answer
  • Given the three thread states: running, runnable (i.e., ready), and blocked (i.e., waiting), state which of the six possible thr
    13·1 answer
  • Computer can do work very___​
    7·2 answers
  • Leon needs to configure the days and times of his work week for his Outlook Calendar. Which option should he
    12·2 answers
  • Describe psychographic differences among the past five generations of Americans that you learned about in this course. What type
    5·1 answer
  • I am in class 7 should I go with java or python.​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!