Week 4 Homework

Week 4 Homework - Week 4: Homework 1. C 2. B 3. B 4. D 5. A...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Week 4: Homework 1. C 2. B 3. B 4. D 5. A 6. C 7. B 8. C 9. D 10. B 11. D 12. A 13. B 14. C 15. A Algorithm Workbench 1. If x>100 then y=20 z=40 3. If a<10 then 0=b else 99=b 5. If amount1>10 then i f amount 2<100 then D isplay "the greater amount " E ndif Endif 7. I f speed >= 24 and speed <= 56 then D isplay “Speed is normal” E lse D isplay "Speed is abnormal” E ndif 9. Select month Case 1: D isplay “January has 31 days” Case 2: D isplay “Februrary has 28 days” Case 3: D isplay “March has 31 days” Default: D isplay “Er ror: Invalid selection” End Select P rogramming Exercise #5 Display "Enter Color 1" Input Color_1 Display "Enter Color 2" Input Color_2 Select Color_1 and Color_2 Case: "Blue" AND "Yellow" D isplay "Blue and Yellow gives you Green" Case: “Red “ AND “Yellow” D isplay “Red and Yellow gives you Orange” Case: “Red” AND “Blue” D isplay “Red and Blue gives you Purple” Default D isplay “Er ror: Colors don’t mix” E nd Select #6 Select books Display “Enter the amount of books purchased” Input number of books Case: 0 books D isplay “0 books earns 0 points” Case: 1 book D isplay “1 book earns 5 points” Case : 2 books D isplay “2 books earns 15 points” Case: 3 books D isplay “3 books earns 30 points” Case: 4 books D isplay “ 4 books earns 60 points” End select #7 Select quantity D isplay “Enter number of packages” Case: 10 AND 19 packages D isplay “Receive 20% discount” Case: 20 AND 49 packages D isplay “Receive 30% discount” Case 50 AND 99 packages D isplay “Receive 40% discount” Case: 100 OR more packages D isplay “Receive 50% discount” End Select #9 Select weight D isplay “Enter weight of packages” Case: 2 lbs OR less D isplay “$1.10 per lb” Case: Over 2 lbs <=6lbs D isplay “$2.20 per lb” Case: Over 6lbs <=10kbs D isplay “$3.70 per lb” Case: 10lbs or more D isplay “$3.80 per lb” End Select ...
View Full Document

Page1 / 4

Week 4 Homework - Week 4: Homework 1. C 2. B 3. B 4. D 5. A...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online