Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C++ Coding

Status
Not open for further replies.

assad12

Vendor
Feb 2, 2003
2
GB
Hi,

I have problems creating the following program,

Using selection criteria produce a program to output the following:

If vitamins sold <= 25 then cost is 0.05 pence per vitamin
If vitamins sold between 26 and 49 inclusive then cost is 0.04 pence per vitamin.
If vitamins sold >49 then cost is 0.03 pence per vitamin.

I need a program to test all the options.

Thankyou!!
 

if(numberSold>49)
cost = .03;
else if(numberSold>25)
cost = .04;
else
cost = .05;

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top