Problem with Output C++

Hello, I am a first year student studying programming with C++. As this is my first project, I will need some help or advice please.

I am using Microsoft Visual C++ 2010, and my error is in the output. No matter what way I word it, or even if I put in a double 0.2, the value for the netProfit always seems to never be correct. It should multiply the 0.2 and the grossProfit together but it only seems to subtract it rather than multiply. This is extremely frustrating and I would greatly appreciate any help. The following is my program:

/* ========================================================================== */

#include <iostream>
#include <iomanip>
#include <string>
using namespace std;

/* ========================================================================== */
int main()
{
// named (symbolic) constants
const double ADULT_PRICE = 8.50; // adult ticket price
const double CHILD_PRICE = 4.75; // child ticket price
const double KEPT_PERCENT = 0.2; // percentage kept by theater

// variables
string movieName; // name of the movie
double netProfit; // theater's net profit
double grossProfit; // theater's gross profit
double distributorAmt; // amount paid to distributor
int adultTickets; // number of adult tickets sold
int childTickets; // number of child tickets sold

// print overall program output heading
cout << "*****************************:" << endl;
cout << "Box Office Receipts Calculator:" << endl;
cout << "******************************:" << endl << endl;

// get the name of the movie from the user
cout << "Enter the name of the movie: ";
getline(cin, movieName);

// get the number of adult tickets sold.
cout << "Enter the number of adult tickets sold: ";
cin >> adultTickets;

// get the number of child tickets sold
cout << "Enter the number of child tickets sold: ";
cin >> childTickets;

// calculate gross profit
grossProfit = (adultTickets * ADULT_PRICE) + (childTickets * CHILD_PRICE);

// calculate the net profit
netProfit = grossProfit * 0.2;

// calculate the distributor's portion
distributorAmt = grossProfit - netProfit;

// display final results
cout << "\nRevenue Report\n";
cout << "Movie Name: " << "\"" << movieName << "\"" << endl << endl;
cout << "Adult Tickets Sold: " << setw(8) << adultTickets << endl;
cout << "Child Tickets Sold: " << setw(8) << childTickets << endl;
cout << fixed << showpoint << setprecision(2);
cout << "Gross Box Office Profit: $" << setw(8) << grossProfit << endl;
cout << "Net Box Office Profit: $" << setw(8) << netProfit << endl;
cout << "Amount Paid to Distributor: $" << setw(8) << distributorAmt
<< endl;

// print closing message
cout << "***************************************************" << endl
<< endl;
cout << "Thanks for Using the Box Office Receipts Calculator" << endl;
cout << "***************************************************" << endl
<< endl;

system("pause");
}

/* ========================================================================== */
/* END OF PROGRAM */
/* ========================================================================== */


Also, the grossProfit displays a wrong profit number which is .25 off the real value
Topic archived. No new replies allowed.