Question
The following flowchart presents an algorithm of a program that counts the number of positive and negative numbers entered by the user. The user will
The following flowchart presents an algorithm of a program that counts the number of positive and negative numbers entered by the user. The user will enter 30 numbers. Translate the flowchart into its corresponding C++ program using an appropriate loop statement.
Write your code in the incomplete program given below:
#include
using namespace std;
int main()
{
int count = 0; //The total count of numbers entered
int positive = 0; //The count of positive numbers int negative = 0; //The count of negative numbers int number; //The number entered
//Write your code here //... //... //...
return 0;
}
Start count = 0 positive= 0 negative = 0 False count 0 positive = positive + 1 False True negative = negative + 1 numberStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started