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 set of instructions given to a computer is called _____________________.
adell [148]

Answer:  c) a program.

Explanation:

A computer, is a hardware device, that differs from those with dedicated hardware (like a TV set, a radio, or an old phone) , in that it can be used for different purposes, due to it's a programmable device.

The way in which the computer is instructed to do anything, is by means of a set of instructions to  be read and executed sequentially, which is called a program.

The set of the different programs stored in the computer is which is known as the computer software.

4 0
3 years ago
The classification of clouds is based on their _____.
goblinko [34]
Clouds might be ordered by shape and by height. Luke Howard, a British drug specialist was the first to portray cloud shapes utilizing Latin terms, for example, cirrus, cumulus or stratus. The division of mists into ten fundamental cloud structures or cloud genera depends on his productions.
5 0
3 years ago
Read 2 more answers
(Game Design) Game Freak, the creators of Pokemon, are an example of a(n):
bixtya [17]
D. Indie developer. Independent video game development, or indie game development, is the video game development process of creating indie games; these are video games, commonly created by individual or small teams of video game developers and usually without significant financial support of a video game publisher or other outside source.
7 0
3 years ago
You use a web browser to search for “winter sweaters” on your laptop. Later, you are playing a game on your phone and an ad show
melomori [17]

Answer:

C

data mining

Explanation:

they are seeing what you are interested in and creating personalized adds

8 0
3 years ago
Read 2 more answers
Design a class called NumDays. The class’s purpose is to store a value that represents a number of work hours and convert it to
stepladder [879]

Answer:

See explaination

Explanation:

#include <iostream>

using namespace std;

class NumDays{

int hours;

float day;

public:

NumDays()

{

hours=0;

day=0.0;

};

NumDays(int h)

{

hours=h;

day=float(h/8.0);

};

int getHour()

{

return hours;

}

float getDay()

{

return day;

}

NumDays operator +(NumDays obj)

{

int h=getHour()+obj.getHour();

NumDays temp(h);

return temp;

}

NumDays operator -(NumDays obj)

{

int h=getHour()-obj.getHour();

NumDays temp(h);

return temp;

}

const NumDays& operator++() //prefix

{

++hours;

day=float(hours/8.0);

return *this;

}

const NumDays& operator--() //prefix

{

--hours;

day=float(hours/8.0);

return *this;

}

const NumDays operator++(int) //postfix

{

NumDays temp(*this);

++hours;

day=float(hours/8.0);

return temp;

}

const NumDays operator--(int) //postfix

{

NumDays temp(*this);

--hours;

day=float(hours/8.0);

return temp;

}

};

int main()

{

NumDays obj(2),obj2(10),obj3,obj4;

obj3=obj2-obj;

cout<<"'obj3=obj2-obj'=> Day:"<<obj3.getDay()<<"##Hour:"<<obj3.getHour()<<"\n";

obj3=obj+obj2;

cout<<"'obj3=obj+obj2'=> Day:"<<obj3.getDay()<<"##Hour:"<<obj3.getHour()<<"\n";

obj4=obj3++;

cout<<"'obj4=obj3++' => Day:"<<obj4.getDay()<<"##Hour:"<<obj4.getHour()<<"\n";

obj4=++obj3;

cout<<"'obj4=++obj3' => Day:"<<obj4.getDay()<<"##Hour:"<<obj4.getHour()<<"\n";

obj4=obj3--;

cout<<"'obj4=obj3--' => Day:"<<obj4.getDay()<<"##Hour:"<<obj4.getHour()<<"\n";

obj4=--obj3;

cout<<"'obj4=--obj3' => Day:"<<obj4.getDay()<<"##Hour:"<<obj4.getHour()<<"\n";

};

3 0
2 years ago
Other questions:
  • Which internet technology allows businesses to make presentations and share visual aids such as charts and graphs ?
    7·2 answers
  • Can run mobile-style apps in the area known as the start screen, while running traditional software in the more familiar desktop
    6·1 answer
  • What is the boundary folding method?
    5·1 answer
  • Which of the following is the core of an operating system that maintains the computer’s clock, starts applications, and assigns
    5·1 answer
  • I wanna start answering questions for people, but I don't quite know how. Can you help me?​
    13·1 answer
  • You change a document that is saved on your computer by cutting text from the document what happens to the text when you preform
    5·1 answer
  • Describe the difference between the while loop and the do-while loop.
    7·1 answer
  • It is possible to change the shape of a text box.
    10·1 answer
  • Write the following program in C++ to print:
    15·1 answer
  • someone please please help with this we have to make a sketch of a hydraulic spreader or cutter I chose the spreader now we have
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!