



|
|
P Dunn's Super CS1 Site
|
Programming Challenge Archive
General Problems Solving
Thinking
|
|
Text File --
Thinking
progchall1.txt
Description: Document to describe the problem solve pro+
cess for each
of the challenges under Prog Challenge 1
Item 1 - CoffeeBeans
There are 3 different types of coffee beans a person wo+
uld like to order.
Each type of bean has a different price and needs to be+
calculated. Also
what needs to be factored in is the sales tax percentag+
e and and the
shipping and handling price. Then figure out how much a+
person should
write the check for.
This problem will be solved using problem decomposition+
.
* Determine the total cost of Kona Beans
* Determine the total cost of Espresso Beans
* Determine the total cost of Colombian Beans
* Figure out the sales tax on the sale
* Figure out the shipping and handling cost
sub-problem 1: Determine the cost of the kona beans
- determine the total pounds of kona beans being purcha+
sed
- determine the cost per pound of kona beans
- multiply the total pounds by the cost per pound
sub-problem 2: Determine the cost of the Espresso Beans+
- determine the total pounds of espresso beans being pu+
rchased
- determine the cost per pound of espresso beans
- multiply the total pounds by the cost per pound
sub-problem 3: Determine the cost of the Colombian Bean+
s
- determine the total pounds of colombian beans being p+
urchased
- determine the cost per pound of colombian beans
- multiply the total pounds by the cost per pound
sub-problem 4: Determine the sales tax due
- total the cost of the three sub-problems and multiply+
by 7%
sub-problem 5: Determine the cost of shipping and handl+
ing
- determine the total weight of the products being purc+
hased
- determine the cost per pound of products being purcha+
sed
- multiply the total weight by the cost per pound
Item 2 - The Starting Five
In this problem we need to find the average height of t+
he new starting lineup.
To solve this we need to use Goal Directed Planning - t+
hus setting smaller goals, solutions,
to lesser problems and using them to solve the big prob+
lem.
1) Our goal is find the average height of the new start+
ing lineup.
2) To achieve this goal we need to find the average hei+
ght with the new 7 footer player.
3) Information we need to achieve this goal we get it:
a) Subgoal - Average height of the present players - +
given as 75.5 inches.
b) Subgoal - To get the present height of the starting +
five players:
The present average height is multiplied by the numb+
er of players which
gives us the total height of the present five.
c) Subgoal - To find the height of the starting four+
players.
Subtract the height of the 6 footer from the total heig+
ht of the five.
d) Subgoal - Find the total height of the starting five+
with the 7 footer added in.
4) Goal achieved by taking the new total height and div+
iding by 5 giving us the average height
of the new lineup
Item 3: Column of Cubes
In this problem a structure is constructed of 5 cubes i+
n a column and the interior faces are removed. We need to +
find the volume of the structure.
1) Goal - To find the volume of this structure.
2) To achieve this goal we need to find the length, wid+
th and height of this structure.
3) To do this:
a) Subgoal - Find the area of the structure which is gi+
ven - 587.785.
b) Subgoal - Find the area of one cube - 587.785 / 5 cu+
bes.
c) Subgoal - Find the side length of the structure - sq+
rt of the one cube - 29.39 feet = width too
since it's a cube.
d) Subgoal - Find the total height of the structure = 2+
9.39 * number of sides making up the height = 5.
4) Find the volume by calculating 29.39 * 29.39 * total+
height of the structure.
Item 4: Painted Disks
In this problem we are to find the total area of the di+
sks involved
are painted blue, red, yellow and what the total area o+
f all the disks
are.
We are going to solve this one with problem decompositi+
on.
Given: the first disk has a radius of 10.24 and a diame+
ter of 20.48
a)Sub-problem 1:
1) Find the total area of the first disk whose radius is+
10.24 (A=PI(R*R)).
2) Then find the area that is painted red - red=A-(A*+
.33).
3) Find the area that is painted blue - blue=A-(A*.66+
).
b)Sub-problem 2:
1) Find the radius of disk 2 which is twice the radiu+
s of the first disk by multiplying * 2 the first disk radi+
us of 10.24.
2) Find the total area of this disk by using the formula+
A=PI(R*R).
3) Find the area that is painted red - red=(A/2).
4) Find the area that is painted blue - blue=(A/2).
c)Sub-problem 3:
1) Find the radius of disk 3 by taking the average of+
the first disk radius + second disk radius / 2 - (disk3Ra+
dius = (firstDiskRadius + secondDiskRadius) / 2).
2) Find the total area of this disk by using the formula+
A=PI(R*R).
3) Find the area that is painted red - red=A-(A*(1/5)).
4) Find the area that is painted yellow - yellow=A-(A*(4+
/5(*.5))).
5) Find the area that is painted blue - blue=A-(A*(A*(4/+
5)(*.5))).
d)Solve
1) Add up the total blue area
2) Add up the total red area
3) Add up the total yellow area
4) Add up the total area
|
|
|