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
Tresset [83]
3 years ago
14

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 ndays has been declared and initialized to hold the size of the array. (Thus, if today were January 18, ndays would have the value 18; if today were February 3, ndays would have the value 34.) In addition, a variable named mostTickets has been declared, along with a variable k. Without using any additional variables, and without changing the values of ndays or the elements of the parkingTickets array, write some code that results in mostTickets containing the largest value found in parkingTickets.
Computers and Technology
1 answer:
WINSTONCH [101]3 years ago
3 0

An array of integers named parkingTickets has been declared and initialized to the number of parking tickets given out by the city police each day since the beginning of the current year.

Explanation:

  • A variable named ndays has been declared and initialized to hold the size of the array.
  • 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.
  • If today were January 18, ndays would have the value 18; if today were February 3, ndays would have the value 34

mostTickets=0;

for (k=0; k< ndays; k++)

{

if (parkingTickets[k]>mostTickets) mostTickets=parkingTickets[k];

}

You might be interested in
If you and another person want to encrypt messages, what should you provide that person with?
qaws [65]

The encrypt key or encrypt passphrase

3 0
3 years ago
Supervisor: You will need to consolidate your trouble tickets
liubo4ka [24]
Wheres the rest???????????????????
7 0
3 years ago
When is it appropriate to utilize the nat network connection type?
lbvjy [14]
Whenever the VM does not need to be access at a known address by other network nodes.
6 0
3 years ago
How do I cancel my membership or Subscription on here
timurjin [86]

Answer:

You don't

Explanation:

7 0
3 years ago
What behaviors are most common in a successful entrepreneurship
Kryger [21]
1. Proper planning
2. Honesty
3. Being reasonable in pricing
4. Knowledge of what you’re offering
5. Being kind/good to your clients
8 0
3 years ago
Other questions:
  • Descending selection sort with output during execution
    6·1 answer
  • The concept of ____ refers to the idea that the internet is designed for all content to be treated equally.
    12·1 answer
  • How can I use the internet/social media to protect my identity?
    14·1 answer
  • Which of the following would most likely be responsible for configuring firewalls and IDPSs, implementing security software, and
    8·2 answers
  • What is IaaS? For this service model, what are the resources the cloud vendor will provide/manage and what are the resources the
    15·1 answer
  • Want to.learn about computers​
    9·1 answer
  • The individual accountable for ensuring the day-to-day operation of the InfoSec program, accomplishing the objectives identified
    7·1 answer
  • Remember partially filled arrays where the number of elements stored in the array can be less than its capacity (the maximum num
    14·1 answer
  • The___ allows you quickly access features such as formatting, charting, tables, and totals
    11·1 answer
  • Language modeling incorporates rules of __. Select all that apply.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!