Computer problems,Computer help
*AX SOFT>>>Programming & Design

Help with C++ please! my program is not working why? please help me! To start with, i get alot errors...?


this is the set of number that i am supposed to check it with: 3 registrants by the first company, 12 by the second one 9 for the third one.
#include <iostream>

using std::cout;
using std::cin;
using std::endl;
int main()
{
//declare variables
int registrants = 0;
double fee = 0.0;
int totalPeople = 0;
double totalCharge = 0.0;
double average = 0.0;

//get input from the user
cout << "Enter number of registrants (Enter 0 to stop the program): ";
cin >> registrants;

//get the registration information for programming seminars
while (registrants != 0)
{
if (registrants >= 1 && registrants <= 3)
cout << "Enter number of registrants: " << fee = 150 << endl;
else if (registrants >= 4 && registrants <= 9)
cout <<"Enter number of registrants: " << fee = 150 << endl;
else
cout <<"Enter number of registrants: " << fee = 150 << endl;
} //end ifs

this is the rest of my code:
//display output
cout <<"Total people: ";
cin >> totalPeople;
totalPeople = registrants;

cout <<"Total Charge: ";
cin >> totalCharge;
totalCharge = registrants * fee;

cout <<"Average: ";
cin >>average;
average = totalCharge / registrants;

return 0;
} //end of main function

I can't quite understand your assignment.

It sounds to me like what you are supposed to do is collect the number of registrants for an unknown number of companies, calculate each company's cost, and output the amount for each company, plus a running total of all costs.

#include <iostream>
using namespace std;

int main () {
int registrants = 1;
double fee = 150.00;
double subtotal;
double total;
int i = 1;

while (registrants > 0) {
cout << "Enter total number of registrants for company " << i << " (enter 0 to end program) << endl;
cin >> registrants;

if(registrants > 0) {
subtotal = registrants * fee;
total += subtotal;

cout << "Total for company " << i << ": " << subtotal << endl;
i++;
}
}

cout << "Grand total for all companies: " << total << endl;

return true;
}

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • I'd like to add to my tech related blog. What articles and tutorials etc would you like me to write about?

    Isn't it great how no one bothers writing a serious answer? I thought it was a good question actually. Maybe our blogs could complement each other? Cross linking, commenting on each other'...

  • I want a topsite script for my website. I was wondering if anybody could recommend a good free one?

    Hi there, Aardvark has a nice free topsites script, however I don't about integrating it into your wordpress theme. It does have fully customizable skins so I would think it wouldn't b...

  • Website Layouts?

    Well, I think I stumbled upon your question because it had the word "WordPress" in it... but you might like this site anyway. It has some pretty impressive "skins" not just for ...

  • Fast html question?

    Hi there, Okay you have an issue you need to fix first... You have the top table which holds the 3 boxes across the top. Then you close that table. However, the very next bit of code is <t...

  • How do I make banners?

    You can make the image in any image manipulation tool. I like photoshop, you can use illustrator, paint, gimp whatever. Then you post it on your site, below list the html code so that people can pa...

  • Any Database Specialist here?

    DB Analyst or what ever the title is will preside over *Database security--securing access to certain people or certain data *Database health--Making sure the server stays patched, and that ...

  • Step by step instructions for website?

    You find a host - a place to put your site. A site is usually more than one page. A page is a file. Download XAMPP and run the site on your own computer, until you have something you'd ...

  • How do i turn javascript on ?

    Find the "Internet Options" option in the menubar of your browser (it's probably located in the Tools menu). Click on the "Security" tab. Make sure the "Internet"...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster