100% tevredenheidsgarantie Direct beschikbaar na betaling Zowel online als in PDF Je zit nergens aan vast
logo-home
Solution Manual for An Introduction to Programming with C++ 8th Edition by Diane Zak €18,05   In winkelwagen

Tentamen (uitwerkingen)

Solution Manual for An Introduction to Programming with C++ 8th Edition by Diane Zak

 34 keer bekeken  1 keer verkocht
  • Vak
  • SolutionManual
  • Instelling
  • SolutionManual

Solution Manual for An Introduction to Programming with C++ 8th Edition by Diane Zak

Voorbeeld 4 van de 87  pagina's

  • 8 augustus 2024
  • 87
  • 2024/2025
  • Tentamen (uitwerkingen)
  • Vragen en antwoorden
  • SolutionManual
  • SolutionManual
avatar-seller
Solution Manual For
An Introduction to Programming with C++ 8th Edition by Diane Zak
Chapter 1-15

Chapter 1
An Introduction to Programming with C++: Eighth Edition
Chapter 1 Answers


Review Questions
1. d sorting
2. c sequence
3. d sequence
4. a an algorithm
5. b repetition
6. c selection
7. b selection
8. a repetition
9. c both repetition and selection
10. b selection

Exercises
1. The answer to this TRY THIS Exercise is located at the end of Chapter 1 in the book.
2. The answer to this TRY THIS Exercise is located at the end of Chapter 1 in the book.
3. repeat for (each customer buying a TV)
enter the original price of the TV
if (the customer is one of the first 10)
calculate the discount by multiplying the original price by 25%
else
calculate the discount by multiplying the original price by 15%
end if
calculate the total due by subtracting the discount from the original price
print a bill showing the original price, discount, and total due
end repeat
4.
1. repeat (4 times)
enter a number
calculate the sum by adding the number to the sum
end repeat
2. calculate the average by dividing the sum by 4
3. display the average
5.
repeat for (each component name on the list)
read the component name from the list
search for the component
if (the component was received)
cross the component name off the list
else
circle the component name on the list
end if

, end repeat

6. Version 1:
repeat for (each customer)
enter the number of tickets
if (the number of tickets is greater than 4)
display the message “You can purchase up to 4 tickets only.”
else
calculate the amount owed by multiplying the number of tickets by $35
display the amount owed
end if
end repeat

Version 2:
repeat for (each customer)
enter the number of tickets
if (the number of tickets is less than or equal to 4)
calculate the amount owed by multiplying the number of tickets by $35
display the amount owed
else
display the message “You can purchase up to 4 tickets only.”
end if
end repeat

7.
1. repeat (6 times)
if (the flower is red)
pick the flower with your right hand
else
pick the flower with your left hand
end if
walk forward one complete step
end repeat
2. walk forward one complete step

8.
repeat (5 times)
enter the employee’s name, hours worked, and pay rate
if (hours worked is less than or equal to 40)
calculate gross pay = hours worked times pay rate
else
calculate regular pay = pay rate times 40
calculate overtime hours = hours worked minus 40
calculate overtime pay = overtime hours * pay rate * 1.5
calculate gross pay = regular pay + overtime pay
end if
print the employee’s name and gross pay
end repeat

9. repeat (for each employee)

, enter the employee’s payment schedule and annual salary
if (the employee’s payment schedule is weekly)
calculate gross pay = annual salary / 52
else
calculate gross pay = annual salary / 26
end if
display the gross pay
end repeat

10.
1. multiply 7 by 5, giving a product of 35
2. divide 20 by 2, giving a quotient of 10
3. multiply 4 by 2, giving a product of 8
4. subtract the result of step 2 (10) from the result of step 1 (35), giving
a difference of 25
5. add the result of step 4 (25) to the result of step 3 (8), giving a sum of 33

11.
1. enter Store A’s price and Store B’s price
2. calculate the cost at Store A by dividing Store A’s price by 2 and then
adding the result to Store A’s price
3. calculate the cost at Store B by multiplying Store B’s price by 2
4. if (the cost at Store A is less than or equal to the cost at Store B)
display the message “Buy at store A”
else
display the message “Buy at store B”
end if

12.
1. repeat (3 times)
walk forward one complete step
end repeat
2. turn left 90 degrees
3. repeat (2 times)
walk forward one complete step
end repeat
4. turn right 90 degrees
5. repeat (3 times)
walk forward one complete step
end repeat
6. turn left 90 degrees
7. walk forward one complete step
8. turn right 90 degrees
9. repeat (4 times)
walk forward one complete step
end repeat
10. repeat (2 times)
turn right 90 degrees
end repeat
11. sit down

, 13.
1. walk into the maze
2. turn left 90 degrees
3. repeat until (you are directly in front of a wall)
walk forward one complete step
end repeat
4. turn right 90 degrees
5. repeat until (you are directly in front of a wall)
walk forward one complete step
end repeat
6. turn right 90 degrees
7. repeat until (you are directly in front of a wall)
walk forward one complete step
end repeat
8. turn left 90 degrees
9. repeat until (you are directly in front of a wall)
walk forward one complete step
end repeat
10. turn left 90 degrees
11. repeat until (you are directly in front of a wall)
walk forward one complete step
end repeat
12. turn right 90 degrees
13. repeat until (you are directly in front of a wall)
walk forward one complete step
end repeat
14. turn left 90 degrees
15. repeat until (you are directly in front of a wall)
walk forward one complete step
end repeat
16. turn right 90 degrees
17. repeat until (you are out of the maze)
walk forward one complete step
end repeat




An Introduction to Programming with C++: Eighth Edition
Chapter 2 Answers


Review Questions
11. b Analyze the problem
12. b output

Voordelen van het kopen van samenvattingen bij Stuvia op een rij:

√  	Verzekerd van kwaliteit door reviews

√ Verzekerd van kwaliteit door reviews

Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!

Snel en makkelijk kopen

Snel en makkelijk kopen

Je betaalt supersnel en eenmalig met iDeal, Bancontact of creditcard voor de samenvatting. Zonder lidmaatschap.

Focus op de essentie

Focus op de essentie

Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!

Veelgestelde vragen

Wat krijg ik als ik dit document koop?

Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.

Tevredenheidsgarantie: hoe werkt dat?

Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.

Van wie koop ik deze samenvatting?

Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper solutions. Stuvia faciliteert de betaling aan de verkoper.

Zit ik meteen vast aan een abonnement?

Nee, je koopt alleen deze samenvatting voor €18,05. Je zit daarna nergens aan vast.

Is Stuvia te vertrouwen?

4,6 sterren op Google & Trustpilot (+1000 reviews)

Afgelopen 30 dagen zijn er 75632 samenvattingen verkocht

Opgericht in 2010, al 14 jaar dé plek om samenvattingen te kopen

Start met verkopen
€18,05  1x  verkocht
  • (0)
  Kopen