I am trying to write a program in Visual C++ 2008 Express Edition that accepts sales amounts input from the keyboard and counts the sales that are at or above the target amount or below the target amount. I am getting an error when trying to debug. I have to set a target amount. This is what I have:
#include <iostream>
using namespace std;
const float targetAmount = 45.00;
const int sentinel = 0;
int main()
{
int salesAtOrAboveTA, salesBelowTA, Count; // Declare variables as integer
float salesAmount; // Declare variable as float
salesAmount = 0; // Initialize loop variable
Count = 0;
cin >> salesAmount;
while (salesAmount != sentinel)
{
Count++;
cin >> salesAmount;
}
if (salesAmount >= targetAmount)
{
cout << "Number of sales at or above target: " << salesAtOrAboveTA << endl;
}
else
cout << "Number of sales below target: " << salesBelowTA << endl;