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
Keith_Richards [23]
3 years ago
9

Write a program that calculates the average of n integers. the program should prompt the user to enter the value for n and then

afterward must enter all n numbers. if the user enters a nonpositive value for n, then an exception should be thrown (and caught) with the message "n must be positive." if there is any exception as the user is entering the n numbers, an error message should be displayed, and the user prompted to enter the number again.
Physics
1 answer:
ikadub [295]3 years ago
8 0

#include<studio.h>

int main( )

{

int n;

int a,b,c,d,x,y;

int avarage;

printf("enter value of n:\n");

scanf("%d",&n);

printf("enter value of a:\n,b:\n,c:\n,d:\n,x:\n,y:\n);

scan f("%d\%d\n%d\n%d\n%d\n%d\n",&a,b,c,d,x,y);

sum=(a+b+c+d+x+y);

avarage=(sum/n);

print f("%d",avarage);

if

{

n=positive interger

}

else

{

printf ("n must be positive");

}

return 0;

}

You might be interested in
The photo shows a pencil in water. As light passes from water into glass, it changes direction causing you to see a distorted vi
masha68 [24]
The answer is C. <span>Light travels at different speeds in water and in glass.</span>
7 0
3 years ago
How long would it take to travel 10 light years at the speed of light?
Vladimir79 [104]

A light year is the DISTANCE light travels through vacuum in 1 year.

If light is traveling through vacuum, then it's traveling at the speed of light in vacuum. If a student at home at the beginning of the trip is holding the clock, then ...

Traveling 1 light year takes 1 year.

Traveling 2 light years takes 2 years.

Traveling 3 light years takes 3 years.

Traveling 10 light years takes 10 years.

If the light is traveling through some other substance, or if the clock is traveling along with the light, then these numbers all change.

YOU cannot travel at the speed of light. We have to just leave it at that

6 0
3 years ago
someone help pls. Two students, Mia and Peter, leave school to meet at the local coffee shop. Peter decides to jog to the coffee
cluponka [151]

Answer:

1) The distance further it takes Peter to arrive at the Coffee shop than Mia is 1.24 km

2) Mia's average speed is 6.00 km/hour

Peter's average speed is 8.48 km/hour

4) Mia's average velocity = Peter's average velocity = 6.00 km/hour

Explanation:

The given information from the diagram are;

The distance Peter jogs from school to the flower shop = 2.00 km

The distance Peter jogs from the Flower shop to the Coffee shop = 2.24 km.

The distance Mia walks from school directly to the Coffee shop = 3.00 km

The time it takes both Peter and Mia to arrive at the coffee shop = 30 minutes = 0.5 hour

1) The total distance Peter travels from school to the Coffee shop = 2.00 km + 2.24 km = 4.24 km

The distance Mia travels from school to the Coffee shop = 3.00 km

The distance further it takes Peter to arrive at the Coffee shop than Mia = 4.24 km - 3.00 km = 1.24 km

The distance further it takes Peter to arrive at the Coffee shop than Mia = 1.24 km

2) Average \ speed = \dfrac{Total \ distance \ traveled}{Total \ time \ taken \  in \ the \ journey}

Therefore, \ Mia's \ average \ speed = \dfrac{3.00 \ km}{0.5 \ hour}= 6.00 \ km/hour

Mia's average speed = 6.00 km/hour

Peter's \ average \ speed = \dfrac{4.24 \ km}{0.5 \ hour}= 8.48 \ km/hour

Peter's average speed = 8.48 km/hour

4) Average \ velocicty = \dfrac{Displacement }{Time  \ taken}

The displacement from the School to the Coffee shop is 3.00 km for both Mia and Peter

The time it takes both Peter and Mia to arrive at the Coffee shop from the school is 30 minutes = 0.5 hour

Therefore, \ Mia's \ average \ velocity = \dfrac{3.00 \ km}{0.5 \ hour}= 6.00 \ km/hour

Mia's average velocity = 6.00 km/hour

Peter's \ average \ velocity = \dfrac{3.00 \ km}{0.5 \ hour}= 6.00 \ km/hour

Therefore, Peter's average velocity is also = 6.00 km/hour

6 0
3 years ago
The Doppler Effect is used at baseball games to measure ___________. @3.2.P.B5 @1
Bogdan [553]

Answer:

Explanation:

A

Those devices the hold up while the pitcher is pitching measures speed. It has nothing to do with weather and temperature.

3 0
3 years ago
Read 2 more answers
When a net force of 17.0 newtons is applied to a dictionary placed on a frictionless table, it accelerates by 3.75 meters/second
4vir4ik [10]
Force = (mass) x (acceleration)    (Newton's second law of motion)

Divide both sides of the equation by 'acceleration', and you have

Mass = (force) / (acceleration)

Mass = 17 newtons / 3.75 meters per second-sqrd = 4.533 kilograms (rounded)
8 0
3 years ago
Other questions:
  • The Lyman series comprises a set of spectral lines. All of these lines involve a hydrogen atom whose electron undergoes a change
    9·1 answer
  • you push your little sister on a swing and in 1.6 minutes you make 52 pushes what is the frequency of your swing? answer in unit
    9·1 answer
  • A sinusoidal wave travels along a string. The time for a particular point to move from maximum displacement to zero is 0.13 s. W
    13·1 answer
  • When testing an PNP transistor with an ohmmeter, what are the high or low resistance values expected for a good transistor?
    7·1 answer
  • Steve walks from his house 5 km South then turns east and walks 2 km. Then he walks 9 km North to his older sister's house. She
    5·1 answer
  • What happens when ice melts, according to the kinetic theory?
    11·1 answer
  • How is air temperature related to high and low pressure air
    7·1 answer
  • Which of the following is a correct<br> definition of the word "contingencies"?
    8·1 answer
  • A pendulum completes 2 oscillation in 5s.
    8·1 answer
  • What speed should a satellite of mass 4,900 kg moving around
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!