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
Rufina [12.5K]
2 years ago
5

Write a program that: Takes the list lotsOfNumbers and uses a loop to find the sum of all of the odd numbers in the list (hint:

use Mod). Displays the sum.
Computers and Technology
1 answer:
Alika [10]2 years ago
5 0

Answer:

Following are the code to this question:

#include <iostream>//defining header file

using namespace std;

int main()//defining main method

{

int x[]={2,3,4,6,7,8,9,1,11,12};//defining 1-D array and assign value

int i,sum=0;//defining integer variable

for(i=0;i<10;i++)//defining loop for count value

{

   if(x[i]%2==1)//defining if block to check odd value

   {

       sum=sum+x[i];//add value in sum variable

   }

}

cout<<sum;//print sum

return 0;

}

Output:

31

Explanation:

In the above-given program, an integer array "x" is declared that holds some integer values, and in the next line two integer variable "i and sum" is defined which is used to calculate the value.

In the next line, a for loop is declared, that counts all array value, and it uses the if block to check the odd value and add all the value into the sum variable.

You might be interested in
Tor F: Deleting cell data is the same as clearing the contents of a cell.
Valentin [98]

Answer:

no it is not

Explanation:

it's not because of the cells in side the chip for the data that comes from the cell phone

4 0
3 years ago
How do you create a table in an existing database on Microsoft Access?
earnstyle [38]
Hello! In order to make a table in an existing database, first, you need to open the database you want to open, and then on the create tab, go on the tables group and click table. A table will be inserted into the database and you will be able to see it in datasheet view. That will help you make the table and be able to edit as needed.

8 0
3 years ago
Read 2 more answers
I really need the answer now!!
guajiro [1.7K]

Answer:

3. B.

4. B.

5. B.

6. C.

7. D.

8. C.

9. C.

10. D.

Explanation:

I hope I helped you.

4 0
2 years ago
The third assignment involves writing a Python program to compute the cost of carpeting a room. Your program should prompt the u
mojhsa [17]

Answer:

# price of the carpet per square foot for each quality.

carpet_prices=[1,2,4]

def cal_cost(width,height,choice):

 return width*height*carpet_prices[choice-1]  

width=int(input("Enter Width : "))

height=int(input("Enter Height : "))

print("---Select Carpet Quality---")

print("1. Standard Quality")

print("2. Primium Quality")

print("3. Premium Plus Quality")

choice=int(input("Enter your choice : "))

print(f"Carpeting cost = {cal_cost(width,height,choice)}")

Explanation:

The cal_cost function is used to return the cost of carpeting. The function accepts three arguments, width, height, and the choice of carpet quality.

The program gets the values of the width, height and choice, calls the cal_cost function, and prints out the string format of the total carpeting cost.

3 0
2 years ago
Applying patches is much easier today because of the advent of:
Nadusha1986 [10]

Answer:

A. The internet.

Explanation:

Patches can be defined as software updates released by developers to add new features, upgrade software, install new drivers and fix notable functionality issues (software bugs) associated with an installed software application. These software patches are usually made available on the software developer's website and other third-party platforms for download by the end users.

Hence, through the availability of a network connection (internet), patches are uploaded to the cloud or file server by the software manufacturer or developer for continuous and easy access (download) to all interested users. Thus, applying patches is much easier today because of the advent of the internet.

6 0
2 years ago
Other questions:
  • What coding scheme is used by most microcomputers?
    11·1 answer
  • Which Of the following components leads to slow computer performance when it becomes outdated
    12·2 answers
  • You can add envelopes to existing documents. <br> a. True <br> b. False
    10·1 answer
  • Which practice represents the trait of effective communication?
    6·2 answers
  • If you've been a victim of identity theft, what should you do after contacting the company that reported the suspicious charge a
    9·1 answer
  • Just forgot where she saved a certain file on her computer therefore she searched for all files with jpg file extension which ty
    13·2 answers
  • FREE 25 POINTS
    5·2 answers
  • Write a program second.cpp that takes in a sequence of integers, and prints the second largest number and the second smallest nu
    7·1 answer
  • which of the following are good ways for virtual team members to get to know one another? (choose every correct answer.)
    15·1 answer
  • After data is collected, how is it analyzed?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!