My name is Lori and I am in beginning programming and need help with an assignment. The program is C++ and the problem is listed below. I have tried everything I can think of but the program run indefinitely. Please help!
Create a program that displays the registration information for programming seminars. The price per person depends on the number of people a company registers. (For example, if a company registers four people, then the amount owed by that company is $400.) The following chart shows the charges per registrant.
Code:
Number of registrants Charge per person ($) 1-3 150 4-9 100 10 or more 90
Here is my program (that does not work):
Code:
#include <iostream>
#include <iomanip>
using std::cout;
using std::cin;
using std::endl;
using std::fixed;
using std::setprecision;
int main()
{
//declare variables
char company = ' ';
int registrantCount = 0;
double chargePerson = 0.0;
double totalCharge = 0.0;
double averageCharge = 0.0;
double subcharge = 0.0;
//convert variable types
static_cast <double> (registrantCount);
cout << fixed << setprecision (2);
//enter input data
cout << "Enter company (S to stop): " << endl;
cin >> company;
//start loop
while (company != 'S' || company != 's')
{
cout << "Enter number of registrants: " << endl;
cin >> registrantCount;
cout << endl << endl;
if (registrantCount > 0 && registrantCount <=3)
subcharge = registrantCount * 150;
else if (registrantCount > 3 && registrantCount < 10)
subcharge = registrantCount * 100;
else if (registrantCount >= 10)
subcharge = registrantCount * 90;
else
cout << "Incorrect input" << endl;
//end ifs


