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
Travka [436]
2 years ago
13

Assume that ip has been declared to be a pointer to int and that enrollment has been declared to be an array of 20 elements . As

sume also that section has been declared to be an int and has been initialized to some value between 5 and 10.Write a statement that makes ip point to the element in the array indexed by section
Computers and Technology
1 answer:
Vitek1552 [10]2 years ago
5 0

Answer:

ip = enrollment + section;

Explanation:

The variable ip has been declared to be a pointer to int.

int * ip;

The variable enrollment has been declared as an array of 20 elements .

int enrollment[20];

The variable section has been declared as an int.

int section;

In order to make ip point to the element in the array indexed by section, we can use the following statement :

ip = enrollment + section;

This will make ip point to enrollment[section].

You might be interested in
TV show information can either keep track of the number of viewers per show or the name of a show. Information is kept in a file
Elza [17]

Answer:

See explaination for Program source code.

Explanation:

The program source code below.

#include <iostream>

#include <fstream>

#include <vector>

using namespace std;

class Show

{

private:

string title;

int viewers;

public:

Show()

{

this->title = "";

this->viewers = 0;

}

Show(string title, int viewers)

{

this->title = title;

this->viewers = viewers;

}

string getTitle(){ return this->title; }

int getViewers(){ return this->viewers; }

};

int main()

{

vector<Show> shows;

vector<string> titles;

vector<int> viewers;

ifstream inFile1("file1.txt");

ifstream inFile2("file2.txt");

string line1, line2;

if(!inFile1.is_open() || !inFile2.is_open())

{

cout << "Either of the files could not be found!\n";

exit(0);

}

getline(inFile1, line1);

if(line1.compare("Show") == 0)

{

while(getline(inFile1, line1))

{

titles.push_back(line1);

}

inFile1.close();

}

getline(inFile2, line2);

if(line2.compare("Viewer") == 0)

{

while(getline(inFile2, line2))

{

viewers.push_back(stod(line2));

}

inFile2.close();

}

for(int i = 0; i < titles.size(); i++)

{

shows.push_back(Show(titles[i], viewers[i]));

}

// display all the show details

cout << "\nALL SHOWS:\n----------\n";

for(Show show : shows)

{

cout << "Title: " << show.getTitle() << ", Number of viewers: " << show.getViewers() << endl;

}

cout << endl;

return 0;

}

See attachment for output

3 0
3 years ago
What allow you to write alphas on a computer keyboard
lions [1.4K]

Answer:

"To create any of these Greek letters using the Alt codes, simply press the "Alt" key while simultaneously typing the listed number. For example, to create the Greek letter Alpha (α), press the "Alt" key and type 224 using the keypad at the right side of your keyboard." - GOOGLE

5 0
2 years ago
How many cost units are spent in the entire process of performing 40 consecutive append operations on an empty array which start
Alexus [3.1K]

Answer:

Explanation:

260 cost units, Big O(n) complexity for a push

6 0
2 years ago
Brainliest forrrrrrr frrrrrew right herrreeee
nikdorinn [45]

Answer:

Hi!

Explanation:

Thank You So Much For The Points.

5 0
2 years ago
Explain the basic operations of a computer system​
Leona [35]

Answer:

Basically computer does 5 basic operations that are input, output, process,storing and controlling. Input is basically taking data from the user, processing is transferring that data into useful information, then that information needs to be stored and controlled and finally output is give to user.

5 0
2 years ago
Read 2 more answers
Other questions:
  • If you receive an increase in pay, how will that affect your payroll deductions?
    8·1 answer
  • Assume that a kernel is launched with 1000 thread blocks each of which has 512 threads. If a variable is declared as a shared me
    6·1 answer
  • What should be included as part of the approval process? in relation to computer forensics
    14·1 answer
  • What are the pros and cons of the internet’s ability to access information
    8·2 answers
  • Discuss the importance of employee security awareness training. What innovative ways should company’s implement security trainin
    14·1 answer
  • What kind of company would hire an Information Support and Service employee?
    7·1 answer
  • Your wireless network consists of multiple 802.11n access points that are configured as follows: SSID (hidden): CorpNet Security
    8·1 answer
  • with the current computer development, explain 5th areas where computer is applied for the social economic dwvelopment in societ
    11·1 answer
  • What is connected to the base unit in Desktop PC?
    14·1 answer
  • What do you think entertainment or gaming platforms will look like in the future?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!