I am pretty new to this


 
Thread Tools Search this Thread
Top Forums Programming I am pretty new to this
# 1  
Old 02-14-2006
I am pretty new to this

Ok, so I need to make a program using PICO. Here is the assignment, if anyone knows how to do this please show me. Thanks.

Acme Paints, a well-respected local paint store, is having their big End-Of-Winter Paint Sale. They have way too much red, green, yellow, and blue paint on hand in their showroom and they need to get rid of their old stock in order to make room for the new colors which will be arriving any day.

In order to sell as much of their paint as possible, Acme Paints is advertising some special sale prices. Their paints are available in gallon-size, quart-size, and pint-size containers, and the more you buy, the more you save. Each pint-size container of paint (regardless of the color) costs $5. However, if a customer buys at least a quart of paint (in any combination of quart-size or pint-size containers, and in any combination of colors), he or she would pay only $9 for each quart. Similarly, if a customer buys at least a gallon of paint (in any combination of gallon-size, quart-size, or pint-size containers, and in any combination of colors), he or she would pay only $17 for each gallon.

For example, suppose a customer buys the following colors and containers of paints:

Red: 1 gallon, 2 quarts, and 1 pint
Green: 2 gallons, 1 quarts, and 1 pint
Yellow: 1 gallons, 2 quarts, and 0 pint
Blue: 0 gallons, 1 quart, and 1 pint

At first glance it might seem that the customer has bought a total of 4 gallons, 6 quarts, and 3 pints of paint altogether. However, note that since 2 pints make a quart, a better way to write the total would be as 4 gallons, 7 quarts, and 1 pint. Also, note that since 4 quarts make a gallon, the final total would best be written as 5 gallons, 3 quarts, and 1 pint. Therefore the final cost would be:

5 gallons * $17 per gallon
+ 3 quarts * $ 9 per quart
+ 1 pint * $ 5 per pint

or $117.

Obviously, this is way beyond the ability of the checkout person at Acme Paints, who never did like higher math. So the manager of Acme Paints has hired you, a famous local computer programmer, to write a computer program to help out the store and make the sale a success.

Design, write, and execute a C++ language program that uses the above rules to assist in a paint sale. Your program should first ask the user how many containers of each size and each color of paint are being sold. It should then display a summary of the sale, first listing the number of containers being sold of each size and of each color of paint, and then listing the total number of containers being sold of each size for all colors of paint together. Finally, it should display the total cost of the sale.


The manager of Acme Paints has provided you with a mock-up below of how your program should look when executed.

Good luck!

Acme Paint Pricing Program, version 1.0
(c) (your name), 2006

Enter the number of gallon containers of red paint sold: 1
Enter the number of quart containers of red paint sold: 2
Enter the number of pint containers of red paint sold: 1

Enter the number of gallon containers of green paint sold: 2
Enter the number of quart containers of green paint sold: 1
Enter the number of pint containers of green paint sold: 1

Enter the number of gallon containers of yellow paint sold: 1
Enter the number of quart containers of yellow paint sold: 2
Enter the number of pint containers of yellow paint sold: 0

Enter the number of gallon containers of blue paint sold: 0
Enter the number of quart containers of blue paint sold: 1
Enter the number of pint containers of blue paint sold: 1

Amount of red paint sold: 1 gallon(s), 2 quart(s), and 1 pint(s)
Amount of green paint sold: 2 gallon(s), 1 quart(s), and 1 pint(s)
Amount of yellow paint sold: 1 gallon(s), 2 quart(s), and 0 pint(s)
Amount of blue paint sold: 0 gallon(s), 1 quart(s), and 1 pint(s)

Total amount of paint sold: 5 gallon(s), 3 quart(s), and 1 pint(s)

Total cost: $117

Finishing Acme Paint Pricing Program, version 1.0
# 2  
Old 02-14-2006
Do you also want fries with that?

Please (re)read the rules of these forums and in particular:

(6) Do not post classroom or homework problems.


If you have a specific question you're having problem with, pls repost it.

Thread closed.

Last edited by vgersh99; 02-14-2006 at 08:15 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. What is on Your Mind?

Pretty kool datacentre

Hi All, Just seen this news article on the BBC website. Microsoft sinks data centre off Orkney - BBC News Instead of investing in new cooler processor technology they decide to warm the ocean with the old. Okay, it's just an experiment. Interesting? (2 Replies)
Discussion started by: hicksd8
2 Replies

2. UNIX for Dummies Questions & Answers

Xmllint pretty print, batch files

I have about 20 xml files I want to use xmllint to pretty print: xmllint --format file01.xml > pretty_file01.xml xmllint --format file02.xml > pretty_file02.xml etc Is there a way I can just use "xmllint --format" on all the current xml files so I don't have to run this command 20 times?? :( (5 Replies)
Discussion started by: pxalpine
5 Replies

3. UNIX and Linux Applications

Organize (pretty) code

I'm looking for terminal programs, which organize and pretty code like HTML or JavaScript. Thanks! ---------- Post updated at 07:01 AM ---------- Previous update was at 01:49 AM ---------- Found this Online javascript beautifier (1 Reply)
Discussion started by: borobudur
1 Replies

4. Shell Programming and Scripting

Regarding passwd command - Pretty urgent

Can any one please help me for the following :mad: i'm searching for an alternative command in linux for passwd -as (which is in solaris) but in linux there is an option "-S" which gives the status of only one user for listing all the user i cudn't find any alternative this "passwd -as" in... (0 Replies)
Discussion started by: sabee.prakash
0 Replies

5. UNIX for Dummies Questions & Answers

My output doesn't match anything...and the program is pretty simple

This is what I have: #include <stdio.h> int main (void) { int integerVar; int floatingVar; int doubleVar; int charVar; integerVar = 100; floatingVar = 331.79; doubleVar = 8.44e+11; charVar = 'W'; _Bool boolVar; boolVar = 0; ... (3 Replies)
Discussion started by: pwanda
3 Replies

6. UNIX for Dummies Questions & Answers

HELP ASAP.. pretty simple..

Hey guys.... couple questions... I am working a problem set and can't answer this: 1) Suppose you are in a directory that contains a file called "foo." You want to create a new file called "bar" that contains the sorted contents of "foo" in the parent directory of the one you're in. How... (8 Replies)
Discussion started by: ugakid
8 Replies

7. UNIX for Dummies Questions & Answers

all the pretty scripts gone...gone...

I managed to delete my first shell script which was a menu that called functions. I made it all real nice and it ran like a winner. I was so pleased with it I wanted to print it out and look it over, over lunch. Well, lets just say Im better at scripting than just regular commands coz I deleted... (2 Replies)
Discussion started by: michelle
2 Replies

8. AIX

pretty good aix doc if you are unfamilar with it

http://homepage.virgin.net/johnc.king/files/aixdoc/aixdoc.pdf this is taken from http://watkiss.members.easyspace.com/computers/unix/aix/aixdoc.html it is 372 pages long. (0 Replies)
Discussion started by: Optimus_P
0 Replies
Login or Register to Ask a Question