Pad Starting Out with Programming Logic and Design, 4th Edition game that gets t
ID: 3909637 • Letter: P
Question
Pad Starting Out with Programming Logic and Design, 4th Edition game that gets the user to enter the number of coins required to make exactly one dollar. The program Design a should ask the user to enter the number of pennies, nickels, dimes, and quarters. If the total value of the coins entered is equal to one dollar, the program should congratulate the user for winning the game. Otherwise, the program should display a message indicating whether the amount entered was more than or less than one dollar. 9. Shipping Charges The Fast Freight Shipping Company charges the following rates: Weight of Package 2 pounds or less Over 2 pounds but not more than 6 pounds Over 6 pounds but not more than 10 pounds Over 10 pounds Rate per Pound $1.10 $2.20 $3.70 $3.80 Design a program that asks the user to enter the weight of a package and then displays the shipping chargesExplanation / Answer
Change-Counting game. Pseudo Code
pennies = input number of pennies from user;
nickels = input number of nickels from user;
dimes = input number of dimes from user;
quarters = input number of quarters from user;
calculate dollars = (pennies * 0.001) + (nickels * 0.05) + (dimes * 0.10) + (quarters * 0.25);
check if(dollars == 1)
then print("Congratulations! you are the winner");
else
check if(dollars < 1)
then print("Amount is less than 1 dollar")
else
print("Amount is greater than 1 dollar")
end if
end if
Problem 9. Pseudo Code
weight = input weight of package from the user in pounds;
declare rate = 0;
check if(weight <= 2)
then rate = 1.10;
else if(weight > 2 and weight <= 6)
then rate = 2.20;
else if(weight > 6 and weight <= 10)
then rate = 3.70
else if(weight > 10)
then rate = 3.80
end if
calculate shippingCharges = weight * rate;
print("Shipping charges = ", shippingCharges );
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.