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
nalin [4]
3 years ago
15

Suppose that a is declared as an int a[99]. Give the contents of the array after the following two statements are executed: for

(i = 0; i <99 ; i++) a[i] = a[a[i]];
Computers and Technology
1 answer:
mr_godi [17]3 years ago
5 0

Answer:

Each array position holds the position from which the information is going to be retrieved. After the code is run, each position will have the information retrieved from that position.

Explanation:

The best way to solve this problem is working as if we had a very small array. Then we can generalize for the large array.

For example

int a[3];

a[0] = 1; a[1] = 2; a[2] = 0;

for(i = 0; i < 3; i++)

a[i] = a[a[i]];

When i = 0, we have:

a[i] = a[a[i]] = a[a[0]] = a[1] = 2;

When i = 1, we have

a[i] = a[a[i]] = a[a[1]] = a[2] = 0;

When i = 2, we have

a[i] = a[a[i]] = a[a[2]] = a[0] = 1;

Basically, in our small example, each array position holds the index from which we are going to retrieve the information. The same is going to happen in the array of length 99. After the code is run, each position will have the information retrieved from that position

You might be interested in
Is ryan patrick cullen gay
pshichka [43]

who is that? ..........

6 0
3 years ago
Read 2 more answers
In this lab, you complete a prewritten Python program for a carpenter who creates personalized house signs. The program is suppo
ivolga24 [154]

Using the computer language in python to write a function code that personalized house signs

<h3>Writting the code in python:</h3>

<em>#Assign varibles</em>

<em>charge = 0.00</em>

<em>numChars = 8</em>

<em>color = "gold"</em>

<em>woodType = "oak"</em>

<em />

<em>#Checking for number of characters</em>

<em>if numChars > 5:</em>

<em>charge = 35 + (numChars-5)*4</em>

<em>elif numChars > 0:</em>

<em>charge = 35</em>

<em />

<em>#Checking wood type</em>

<em>if woodType == "oak":</em>

<em>charge += 20</em>

<em />

<em>#Checking for color</em>

<em>if color == "gold":</em>

<em>charge += 15</em>

<em />

<em>#Print output</em>

<em>print("The charge for this sign is $"+str(charge)+".")</em>

See more about python at brainly.com/question/13437928

#SPJ1

5 0
1 year ago
Choose the appropriate software category for each specific application shown.
Tom [10]
Python is the correct answer
7 0
1 year ago
Can someone tell me how this is a SyntaxError! (Python3)
Basile [38]

Answer:

The expression on line 9 required 2 brackets

Explanation:

Given

The attached code

Required

Why syntax error.

The error points to line 10, but the error is actually from line 9

To get an integer input, the syntax is:

variable-name = int(input("Prompt"))

From the attached code, the line 9 is:

amount = int(input("Enter cheese order weight: ")

By comparing the syntax to the actual code on line 9, only 1 of the brackets is closed.

<em>This, in Python 3 is a sytax error</em>

6 0
3 years ago
You are configuring a wireless network with two wireless access points. Both access points connect to the same wired network. Yo
krok68 [10]

Answer:

have the same SSID but different channels

Explanation:

Based on the information provided within the question it can be said that the best option to accomplish this would be to have the same SSID but different channels. This would maintain the users connected to the same network name (SSID) but still be able to roam and jump from one access point to the other.

7 0
2 years ago
Read 2 more answers
Other questions:
  • David would like to send a letter to more than one hundred people. He would like the letter to have names and addresses inserted
    7·1 answer
  • A windows computer is shared between several users, each with his own local user account. Each user has his own dedicated, uniqu
    9·1 answer
  • You select a database or change to a different database with the ____ function.
    10·1 answer
  • Name three types of data stored on a computer’s hard disk
    11·1 answer
  • Write a program that prompts the user to enter the year and the first three letters of a month name (with the first letter in up
    8·1 answer
  • __________ is a protocol used by e-mail clients to download e-mails to your computer.
    14·1 answer
  • Write a program that first reads in the name of an input file, followed by two strings representing the lower and upper bounds o
    8·1 answer
  • What component uses thermal paste to attach the heat sink?
    13·1 answer
  • By convention only, either the first usable address or the last usable address in a network is assigned to the router (gateway)
    11·1 answer
  • Difference between a port and a connector
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!