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

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

Hi,

That's what I thought as well. Also, should he put the conditional
statements within or outside of the while loop?

Cheers,

Joseph 

 

From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Homme, James
Sent: Thursday, July 15, 2010 9:00 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: RE: Here is my modified program, thoughts? corrections?

 

Hi,

I can't figure this out. Maybe you need to have && in the statement that
talks about > 4 & < 9. But what's going on if it is either 4 or 9?

 

Jim

 

Jim Homme,

Usability Services,

Phone: 412-544-1810. Skype: jim.homme

Internal recipients,  Read my
<http://mysites.highmark.com/personal/lidikki/Blog/default.aspx>
accessibility blog. Discuss
<http://collaborate.highmark.com/COP/technical/accessibility/default.aspx>
accessibility here. Accessibility
<http://collaborate.highmark.com/COP/technical/accessibility/Accessibility%2
0Wiki/Forms/AllPages.aspx>  Wiki: Breaking news and accessibility advice

 

From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Jes
Sent: Thursday, July 15, 2010 11: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

 

  _____  

This e-mail and any attachments to it are confidential and are intended
solely for use of the individual or entity to whom they are addressed. If
you have received this e-mail in error, please notify the sender immediately
and then delete it. If you are not the intended recipient, you must not
keep, use, disclose, copy or distribute this e-mail without the author's
prior permission. The views expressed in this e-mail message do not
necessarily represent the views of Highmark Inc., its subsidiaries, or
affiliates.

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.441 / Virus Database: 271.1.1/3007 - Release Date: 07/15/10
11:09:00

Other related posts: