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
explain how electrically neutral objects can become electrically charged even though charge cannot be created or destroyed
GaryK [48]

Answer:

The object gains or loses electrons to become charged. Both are a movement of electrons from the negative to the positive charge. A circuit has a continuous current provided by a voltage source.

Explanation:

7 0
3 years ago
Noah is loading the ark and the last animal on board is a stubborn 1500-kg elephant who refuses to budge. Noah and his family pu
Oxana [17]

The coefficient of sliding friction is 0.514

Explanation:

We start by writing the equations of motion of the elephant along the two directions, parallel and perpendicular, to the incline.

Along the parallel direction we have:

F- mg sin \theta - \mu_k R = ma (1)

where :

F = 10,000 N is the force applied by Noah

mg sin \theta is the component of the weight parallel to the incline, where:

m is the mass

g = 9.8 m/s^2 the acceleration of gravity

\theta=10^{\circ}  is the angle of incline

\mu_k R is the force of friction, where:

\mu_k is the coefficient of friction

R is the normal reaction  

and a is the acceleration

Perpendicular direction:

R-mg cos \theta =0 (2)

where mg cos \theta is the component of the weight perpendicular to the incline

From (2) we find

R=mg cos \theta

And substituting into (1)

F-mg sin \theta - \mu_k mg cos \theta = ma

We know that the elephant moves at constant speed, so the acceleration is zero:

a = 0

So the equation becomes

F-mg sin \theta - \mu_k mg cos \theta=0

And we can re-arrange it to find the coefficient of friction:

F-mg sin \theta - \mu_k mg cos \theta=0\\\mu_k = \frac{F-m g sin \theta}{mg cos \theta}=\frac{10000-(1500)(9.8)(sin 10)}{(1500)(9.8)(cos 10)}=0.514

Learn more about friction and inclined planes:

brainly.com/question/5884009

#LearnwithBrainly

4 0
3 years ago
Mars can have bigger mountains than the Earth because it has a smaller mass and surface gravity.
Katarina [22]

Answer:

True

Explanation:

5 0
3 years ago
Read 2 more answers
Light travels approximately 982,080,000 ft/s, and one year has approximately 32,000,000 seconds. A light year is the distance li
Anastasy [175]

Answer: 3.142656 × 10^16 feet

Explanation: Given that the

Speed = 982,080,000 ft/s, and

Time = 32,000,000 seconds

The formula for speed is:

Speed = distance/ time

Make distance the subject of formula

Since the time is second in one year and speed is ft/s, substitute both into the formula

Distance = speed × time

distance = 982,080,000 × 32,000,000

Distance = 3.142656 × 10^16 feet.

The distance of one light year in feet is 3.142656 × 10^16

8 0
3 years ago
Enter a one- or two-word answer that correctly completes the following statement.
Romashka [77]
<span>In my view it looks like this: If the constant force is applied for a fixed interval of time , then the time and velocity of the particle will increase by an amount at.</span>
7 0
3 years ago
Other questions:
  • Final naïve case: If the highest-pitch string on the piano is made of spring steel (density = 7800 kg/m3) with a diameter of 1/3
    6·1 answer
  • A uniform electric field of magnitude 110 kV/m is directed upward in a region of space. A uniform magnetic field of magnitude 0.
    5·2 answers
  • Clouds dump around 100 billion gallons of water on rainforests each year. How much rain is evaporated from the rivers, lakes and
    9·2 answers
  • What two things do i need to know to find velocity
    15·2 answers
  • what is the force that acts in an upward direction, against the force of gravity, so it makes an object feel lighter?
    13·1 answer
  • Brittney is on the starting line to run a track race. The distance around the track is 400m. She starts the race and runs 400m
    14·2 answers
  • Match the element with its description.
    5·2 answers
  • Expalin how waves energy and matter are related
    13·1 answer
  • Sally and Sam are in a spaceship that comes to within 16,000 km of the asteroid Ceres. Determine the force Sally experiences, in
    9·1 answer
  • Ewww you might use this element to kiss someone
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!