Write a Program that asks the user to input a positive integer. If the user inputs a negative number, program should output "ERROR" and ask for /the user's input again. If the user inputs the value of 0, the program says "NO AVERAGE". If the user inputs a -1, the program takes the sum and average of only the positive integers, then outputs "The average is _____ "
I dont understand what I'm doing wrong
//THIS IS WHAT I HAVE SO FAR
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
using namespace std;
int main()
{
int number;
double sum, average;
cout<<"Type Positive Integers: ";
cin>> number;
sum += number;
average = sum/=number;
while(number>=1){
cout<<"Type Positive Integers: ";
cin>>number;
if(number==0){
cout<<"NO AVERAGE: ";
}
if(number<=-2){
cout<<"ERROR!"<< "Enter Another Value: ";
cin>> number;
}
if(number== -1){
cout<<"The Average of the Positive Integers is :"<< average << endl;
}
}