Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have to write a program that reads any number of integer values and determines the mean of positive values and mean of negative values.

I have to write a program that reads any number of integer values and determines the mean of positive values and mean of negative values. It must also display the positions of the following numbers:  From the first positive number read and,  the first negative number read. The stop condition is reading a 0

I've wrote that; but I'm missing some and Im not sure It is good,

float moyennepos, moyenneneg; int valeur, sommepos = 0, sommeneg = 0, cptpos = 0, cptneg = 0; const int nombrevaleur=0;

for (int i = 0; i < nombrevaleur; i++) { Console.Write("Donnez-moi votre valeur {0}: ", i + 1); valeur = int.Parse(Console.ReadLine());

if (valeur > 0) { sommepos = sommepos + valeur; cptpos++; } else if (valeur < 0) { sommeneg = sommeneg + valeur; cptneg++; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

More Books

Students also viewed these Databases questions

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago