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

Add (total) all the number in the list (below) using a for loop, but skip over the number at index 3.

Computers and Technology
1 answer:
user100 [1]3 years ago
3 0

Answer:

The program in Python is as follows:

numbers = [10,20,30,40,50,60,100]

total = 0

for i in range(len(numbers)):

   if i != 3:

       total+=numbers[i]

print(total)

Explanation:

This initializes the list

numbers = [10,20,30,40,50,60,100]

Set total to 0

total = 0

This iterates through numbers

for i in range(len(numbers)):

This ensures that the index 3, are not added

<em>    if i != 3:</em>

<em>        total+=numbers[i]</em>

Print the calculated sum

print(total)

You might be interested in
What is the purpose of the fit to size feature in Word?
Olegator [25]

Answer : computer

Explanation:

please mark me as brilliant

3 0
2 years ago
An oligopoly is a unique market structure. Which of the following is NOT necessary to have a oligopolistic market structure?
Annette [7]
I would say A 
hope this helped ;)
sorry if im wrong 
7 0
3 years ago
Which are options for levels of junk e-mail protection in outlook 2010? Check all that apply.
Alexus [3.1K]
Im pretty sure it  
<span>No automatic filtering
Partial automatic filtering
</span><span>Safe lists only
</span><span>High

</span>
6 0
3 years ago
Read 2 more answers
Write a program, named sortlist, that reads three to four integers from the command line arguments and returns the sorted list o
yawa3891 [41]

Answer:

In C++:

void sortlist(char nums[],int charlent){    

   int Myarr[charlent];

const char s[4] = " ";  

char* tok;  

tok = strtok(nums, s);  

int i = 0;  

while (tok != 0) {  

 int y = atoi(tok);

 Myarr[i] = y;

 tok = strtok(0, s);  

 i++;

}  

int a;  

for (int i = 0; i < charlent; ++i) {

for (int j = i + 1; j < charlent; ++j) {

 if (Myarr[i] > Myarr[j]) {

  a =  Myarr[i];

  Myarr[i] = Myarr[j];

  Myarr[j] = a;

       }   }  }

 

for(int j = 0;j<charlent;j++){ printf(" %d",Myarr[j]); }  

}

Explanation:

This line defines the sortlist function. It receives chararray and its length as arguments

void sortlist(char nums[],int charlent){    

This declares an array

   int Myarr[len];

This declares a constant char s and also initializes it to space

const char s[4] = " ";  

This declares a token as a char pointer

char* tok;

This line gets the first token from the char

tok = strtok(nums, s);

This initializes variable i to 0

int i = 0;

The following while loop passes converts each token to integer and then passes the tokens to the array  

<em> while (tok != 0) {  </em>

<em>  int y = atoi(tok); </em><em>-> Convert token to integer</em><em> </em>

<em>  Myarr[i] = y; </em><em>-> Pass token to array</em><em> </em>

<em>  tok = strtok(0, s); </em><em>-> Read token</em><em> </em>

<em>  i++; </em>

<em> }  </em>

Next, is to sort the list.

int a;

This iterates through the list  

for (int i = 0; i < charlent; ++i) {

This iterates through every other elements of the list

for (int j = i + 1; j < charlent; ++j) {

This condition checks if the current element is greater than next element

 if (Myarr[i] > Myarr[j]) {

If true, swap both elements

<em>   a =  Myarr[i]; </em>

<em>   Myarr[i] = Myarr[j]; </em>

<em>   Myarr[j] = a; </em>

       }   }  }

The following iteration prints the sorted array

<em>for(int j = 0;j<charlent;j++){ printf(" %d",Myarr[j]); }  </em>

}

<em>See attachment for illustration of how to call the function from main</em>

Download cpp
7 0
3 years ago
A n n sss eeeee rrrr
Nadusha1986 [10]

Usability emphasizes utility over aesthetics because in order for something to be useful it has to have a designated purpose. While aesthetics are nice they are not usable so the answer is B

4 0
3 years ago
Other questions:
  • You've been hired as a consultant to help an online store owner. You need to complete the implementation of conversion tracking
    5·1 answer
  • 1.the following code example would print the data type of x, what data type would that be?
    12·1 answer
  • Read each statement below. If the statement describes a peer-to-peer network, put a P next to it. If the statement describes a s
    12·1 answer
  • The last time period the federal government of these United States ran a budget surplus was ________.
    9·1 answer
  • The ____ attribute can be used only with input boxes that store text. Group of answer choices type pattern required value
    9·1 answer
  • How did Bill Gates benefit from free enterprise? Need a paragraph please. Will give the branliest!!
    9·1 answer
  • ¿Por qué disminuyó el tamaño de la población de caribús? Usa la evidencia inicial para explicar por qué disminuyó el tamaño de l
    5·1 answer
  • Quick I need help ASAP
    7·2 answers
  • How did Matt Pyke and Karsten Schmidt create the advertisement for Audi? Multiple choice question. Filmed the car as wind tossed
    13·1 answer
  • Which of the following declares an abstract method in an abstract Java class?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!