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
I really want to know the best way to deal as much heart as possible plz tell me
Natasha2012 [34]

Answer:

Set aside time every day for doing something that feels positive, whether that’s journaling, meeting up with a close friend, or watching a show that makes you laugh. Scheduling in moments that bring you joy is vital for healing a broken heart. It’s important to talk about your feelings with others and not numb yourself out.

Explanation:

7 0
2 years ago
Read 2 more answers
Easy coding question, please help.
borishaifa [10]

Answers:

What is the index of the last element in the array? stArr1.length()-1

This prints the names in order. How would I print every other value? Change line 4 to: index = index +2

Change line 7 to: i < names.length

5 0
3 years ago
Bill Schultz works at a high power investment firm in Los Angeles. Bill is responsible for promoting the firm's vision and creat
Anna35 [415]

Answer:a

Explanation:

4 0
3 years ago
What does c++ programming mean?
cestrela7 [59]

Answer:

It's an internal joke to say the language is basically C with some extra stuff (like classes)

the "++" is short for

C += 1 or

C = C + 1 which is a common calculation among programmers so they named it C++ to be a more commercial and attractive name than "C with classes"

Explanation:

8 0
3 years ago
Which of the following networks had these two goals: a) allowing scientists to work together on scientific projects; and, b) fun
mrs_skeptik [129]

Answer:

ARPANET

Explanation:

It was the ARPANET sponsored by the US Department of Defense to enable scientists collaborate on research.

5 0
3 years ago
Read 2 more answers
Other questions:
  • What was the second phone?
    14·1 answer
  • Help me Please?!! I will put you as brainliest.<br>I hope I spelled that right.
    5·2 answers
  • Write a statement that toggles the value of the bool variable onoffswitch. that is, if onoffswitch is false , its value is chang
    10·1 answer
  • To use the AutoCalculate area, select the range of cells containing the numbers for a calculation you want to verify and then pr
    7·1 answer
  • In C++ Please :
    6·1 answer
  • What do flowcharts communicate to programmers ?
    10·1 answer
  • Whois the person start programming​
    13·1 answer
  • Write a short note on Computer<br>impact on<br> our society?​
    7·2 answers
  • Describe the job of an Architect.
    5·2 answers
  • Which feature helps an edit-test-bug cycle work faster in the python programming language?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!