write my assignment 15706

Although this assignment is graded like any other assignment (pass/fail), you should prepare to do it like you would the mini-exam; that is, with time limits (45 minutes) and without looking at other materials. (You will have to time yourself, there won’t be a timer displayed.) This will be a good way for you to measure how prepared you are for the next mini-exam. You’ll be able to try and re-try this assignment as many times as you need to in order to prepare for the mini-exam.

Ask the users for numbers until the total of the numbers is greater than 30. Also, count how many numbers are even and how many are odd.

For example:

Please enter an integer: Total Please enter an integer: Total Please enter an integer: Total Please enter an integer: Total Please enter an integer: You had even numbers odd numbers.

I’ve only been able to get this far:

#include <iostream>

#include <string>

using namespace std;

int main() {

  int total, n, counter;

  cout << “Total is 0” << endl;

  cout << “Please enter an integer: “;

  cin >> n;

  cout << n << endl;

  while ( total <= 30){

   total = 0;

   total = total + n;

   cout << “Total is ” << total << endl;

}

 return 0;

}

Which is essentially nowhere. I need to understand how this problem is solved prior to my exam which will involve a similar problem.

 
"Not answered?"
Get the Answer