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 amount of data that can be stored on a disk depends in part on_____.
MariettaO [177]
To what it seems like, it’s d
8 0
3 years ago
Robert is leading a project online that includes students from different cultures. Two of the students spend most of the time li
enyata [817]

Answer:

A & C

Explanation:

8 0
3 years ago
Write 9 words but each word starting with a letter of computer? After your finished the first letter of each of your words shoul
oksian1 [2.3K]

Answer:

<h2>C- rippled</h2><h2>O- utstanding</h2><h2>M- agical</h2><h2>P- eace</h2><h2>U- npredictable</h2><h2>T- riumph</h2><h2>E - xcellent</h2><h2>R- obust</h2>

Explanation:

<h3><u>Acronym</u>- a word that composes of long words that start with its initial letter.</h3><h3>Example: OTG (on the go)</h3>

\tt{ \green{P} \orange{s} \red{y} \blue{x} \pink{c} \purple{h} \green{i} e}

7 0
3 years ago
Read 2 more answers
When a private network uses a single public ip address, and each outgoing tcp packet uses a different port to allow for proper t
m_a_m_a [10]
The networking technology in use is NAT.
8 0
3 years ago
Vocabulary and Bridge Information
motikmotik
Umm
This is to bunch of questions..
6 0
2 years ago
Other questions:
  • What is a geotag?
    10·1 answer
  • The ability to learn a new computer software program is to ____________ as knowledge of state capitals is to _____________.
    11·1 answer
  • True or false: Your digital footprint is all the information about you online that only you post. Group of answer choices
    12·2 answers
  • What is a parameter variable?
    8·1 answer
  • A byte is made up of 8 bits (binary digits). You have a programming language that uses one byte to represent characters and are
    5·1 answer
  • 6.5 Code Practice: Question 1 please help with code!!! Thank you
    12·1 answer
  • Which city is the largest within the Andean and midlatitude countries? A. Buenos Aires, Argentina B. La Paz, Bolivia C. Santiago
    11·2 answers
  • What is the full meaning of Internet and WiFi
    6·2 answers
  • ProgrammingAssignment3
    8·1 answer
  • How to create drop down list in excel with multiple selections.
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!