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
Dennis_Churaev [7]
4 years ago
11

Write a program which asks the user to enter N numbers. The program will print out their average. Try your program with the foll

owing numbers: 20.5, 19.7, 21.3, 18.6 and 22.1
Computers and Technology
1 answer:
Likurg_2 [28]4 years ago
7 0

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

int n;

double average,sum=0,x;

cout<<"enter the Value of N:";

// read the value of N

cin>>n;

cout<<"enter "<<n<<" Numbers:";

// read n Numbers

for(int a=0;a<n;a++)

{

   cin>>x;

   // calculate total sum of all numbers

   sum=sum+x;

}

// calculate average

average=sum/n;

// print average

cout<<"average of "<<n<<" Numbers is: "<<average<<endl;

return 0;

}

Explanation:

Read the total number from user i.e "n".Then read "n" numbers from user with for loop and sum them all.Find there average by dividing the sum with n.And print the average.

Output:

enter the Value of N:5

enter 5 Numbers:20.5 19.7 21.3 18.6 22.1

average of 5 Numbers is: 20.44

You might be interested in
If you'd like to queue multiple exports and keep working on a different project in Premiere Pro, what method should you use?
pogonyaev

Answer:

Export to Adobe Media Encoder CC only

Explanation:

5 0
3 years ago
What is white noise and how does it affect a signal? Provide a business process example that could be affected and what would yo
marin [14]

Answer: White noise is the merging of the audible signal of different frequencies varying from high to low into a single unit. The number of frequencies combined  in white noise more than 20,000. It helps in masking the other noise in the environment.

In accordance with the signal, white noise acts as a statistical mode which merges all the signal into one with same intensity which results in the power spectral density being persistent.

E.g.- Any business process of company that requires attention and speedy working such as creating report, presentation can get affected by the white noise in positive  or negative manner depending on the person.It might lead to increment or decrement in the cognitive performance of employees.

White noise can be remove by several software present in the market, removing it by the "Noise removal" option from the Effects menu in operating system, etc.  

5 0
3 years ago
Briefly explain how developers use a distributed version management system. You may assume that a master repository has been set
Akimi4 [234]

Answer:

Using version control tools like Git and Github.

Explanation:

Version control is a vital tool in programming in recent times. it helps to prevent loss of source codebase and creating unwanted folders for storing multiple codebases to prevent excess storage usage and time consumption.

Git and Github is a platform that handles version control and collaboration between co-workers. When a repository is created, its initial branch is called the master branch and when a staged code is committed, the commit is recorded. These records can be retrieved using the commit hash value and resetting the current unstaged file or code. A new branch can created to hold a different version of an application and merged later with the master branch.

4 0
3 years ago
A farmer sells tomatoes. For some reason, the farm obeys mechanical laws of fate.
Mars2501 [29]

Answer:

Here are the if/elif statements:

if tomatoes == 24:  #if farmer sells exactly two dozen tomatoes

   watermelons +=4  #farmer receives 4 watermelons

elif tomatoes >= 12:  #else farmer sells at least a dozen tomatoes

   watermelons +=2  #farmer receives 2 watermelons

else:

   tomatoes<12   #On the days that farmer sells less than a dozen tomatoes

   apples +=1  #farmer will get a single apple

Explanation:

You can test the working of these if elif statements by this program:

tomatoes = int(input("Enter the amount of tomatoes sold: "))  #prompts user to enter number of tomatoes

watermelons = 0  #initialize watermelons value to 1

apples = 0  #initialize apples value to 1

if tomatoes == 24:

   watermelons +=4

elif tomatoes >= 12:

   watermelons +=2

else:  

   tomatoes<12

   apples +=1

   

print("Number of watermelons recieved: ",watermelons)  #displays the received number of watermelons

print("Number of apples recieved: ",apples )  #displays the received number of apples

8 0
3 years ago
Which of these is an online presentation tool?
Marina86 [1]
Google slides is and online presentation tool
5 0
3 years ago
Read 2 more answers
Other questions:
  • Visual images taken directly from a source, such as pictures, charts, and graphs do not need a citation. true or false.
    8·1 answer
  • Digital Photography Help please
    9·2 answers
  • Suction cup-type headlamp aiming equipment may be used on:
    11·1 answer
  • Which property of a text element controls how the browser handles text that does not fit within the element box?
    13·1 answer
  • Layers allow you to work with one element of an image without disturbing the others true or false​
    15·1 answer
  • 22. The Disc Drive is also known as the:
    15·1 answer
  • What is the default return type of a method in Java language?
    9·2 answers
  • Write an algorithm to calculate the sum of integer ​
    7·1 answer
  • Jason is using his mother's computer. He plugs in his flash drive, but it does not appear in the explorer window. Suggest what J
    12·1 answer
  • Can somebody please help me with these few questions?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!