# can anyone help point me in the right direction with this?

• 10-09-2001
ii3ejoe
can anyone help point me in the right direction with this?
Milt Walker, the chief of advertising for the Isabella Potato Industry, wants you to write a program to compute an itemized bill and total costs of his "This Spud's for You!" ad campaign. The standard black and white full-page ads have base prices as follows:

Drillers' News (code N) \$ 400

Playperson (code P) \$2000

Outdoors (code O) \$ 900

Independent News (code I) \$1200

Each ad is allowed 15 lines of print with a rate of \$20.00 for each line in excess of 15 lines. Each ad is either black and white (code B) and subject to the base prices, or is in color (code C) and subject to the following rates:

Three color (code T) 40 percent increase over base

Full color (code F) 60 percent increase over base

Write a program to input Milt's choice of magazine (N, P, O, I), the number of lines of print (integer), and either black and white (B) or color(C) with a choice of three colors (T) or full color (F). Output should include an appropriate title, all the information and costs used to compute the price of an ad, and the total price of the ad

The following data should be used to test this program:

N10N

N5B

P20CF

I10CT

O15B

N16CF

M15B

P0CT

we are just now doing IF statements an Switch statements.....so it has to use them somehow.......he said he wants it to beable to take "N10N" for example all at once an output the proper info? but when i try to ask him he just says read the book? i have tried its no help
• 10-09-2001
cody
Well, you could read in the data like "N10N" as an array of chars (either from the command line or at runtime from the console), then step through it char by char and analyse each char.

Each char represents certain costs as you have described above, so all you have to do is calculate these costs according to the char. Since there are also numbers involved you should maybe look for a way to convert a "10" (string) into a numeric 10 value...

Give it a try.
enjoy!
cody
• 10-09-2001
ii3ejoe
does it matter which i put first?
say after i put the cout an cin statements to prompt the user to enter for example like u said "N10N" , i used switch for the Mag codes.........right after it i was thinking of putting some ifs like maybe " if (line<=15) linefee=\$25.00; elseif (line>15) linefee==(extralinefee*(lines-15)+\$25.00);" but so far we have used ifs very little think this would work? i know we can put any C++ statement in a if statement coorrrect?:confused: