Do these problems, and in each case put the givens
in
variables, and put the answer in another variable. Then, print that
variable.
When you are done, go back and change the value of the given and rerun
to see
that your change took. You only need the skills on our skill page to do these.
- I have 30 people and 3 pieces of silverware each. How
many pieces of silverware do I need. Set
up a variable for people and number of Silverware per person. Create a
variable
that holds the total number of pieces of silverware. Print that
variable. Then,
change the 30 to 50 and see the new total.
- Put the first name Kris and last name Pepper together as
Kris Pepper. Change the first name variable to your first name and the
last
name variable to your last name and rerun it to see your name.
- I have a stuffed animal selling for $30.00. I sold 2. It
cost $25 to make each animal. Tell me my
total profit. Then, change the price to $40 and tell me my new total
profit.
- Take the last name Pepper, and tell me what the name
would be if the first letter were changed to L. Then, change the last
name to
your name and show the result.
- I travel 30 miles per hour for 5 hours. Tell me how
far I
traveled. Then, change to 50 miles per hour and print that result.
- I want a hat that costs $30. If I wait until it is on
a
10% sale, how much will it cost? Then change to a 20% sale and tell me
the sale
price.
- Both my dogs want to be walked. My little one should
be
walked twice as long as my big one. If I walk the little one 60
minutes, how
long will I be walking? Change to walking the little one three times as
long as
the big one (and get a sad big dog) to tell me how long I will be
walking now.
- My dogs eat alot. I need to buy enough for 2 weeks. The little
one eats 2 cups a day, and the big one eats 3 cups a day. How many cups
of dog food will I need? If a 1 pound = 2 cups, how many pounds
will I need? When you are done, change to my big one eating 4 cups each
day.
When done, work on problems 2 & 5 at the end
of chapter 1. Write down the
steps first. Use those step descriptions as comments in your code.