RE: Here is my modified program, thoughts? corrections?

  • From: "Joseph Lee" <joseph.lee22590@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Thu, 15 Jul 2010 08:54:00 -0700

Hi,

I think you've almost go it. The only thing that I can see at this point is
the "between 4 and 9" code.

Cheers,

Joseph

 

From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Jes
Sent: Thursday, July 15, 2010 8:32 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: Here is my modified program, thoughts? corrections?

 

***program:

//Ch7AppE04.cpp

 //Displays total price of registrations.

//Created/revised by <Jes Smith on July 15, 2010.

 

#include <iostream>

#include <iomanip>

 

using std::cout;

using std::cin;

using std::endl;

//using std::fixed;

//using std::setprecision;

//declare variables

float totalPrice = 0;

float averagePayment = 0; 

int regNumber = 0;

//regNumber, The number of registrants stored in this variable.

//totalPrice The total cost for the company.

//averagePayment The payment the registrant makes to the company for
attending the seminar.

 

int main()

{

cout << "Enter number of people who will be registered. \n Press enter after
each number.\n Enter a negative number to get the total price: " << endl;

cin >> regNumber;

 while (regNumber >= 0)

{

cout << "Enter your next entry. Enter negative number to get total price: "
<<endl;

cin >> regNumber;

} //endwhile

if (regNumber > 1 && regNumber < 3)

totalPrice = 150;

else if (regNumber > 4 < 9);

totalPrice = 100;

 if (regNumber >= 10)

 {

                totalPrice = 90;}

 

totalPrice = (regNumber + totalPrice);

cout << regNumber << endl;

cout << totalPrice << endl;

 

return 0;

} //end of main function

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.441 / Virus Database: 271.1.1/3005 - Release Date: 07/14/10
18:36:00

Other related posts: