100% tevredenheidsgarantie Direct beschikbaar na je betaling Online lezen of als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

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

Beoordeling
-
Verkocht
3
Pagina's
87
Cijfer
A+
Geüpload op
08-08-2024
Geschreven in
2024/2025

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

Instelling
SolutionManual
Vak
SolutionManual

Voorbeeld van de inhoud

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

Geschreven voor

Instelling
SolutionManual
Vak
SolutionManual

Documentinformatie

Geüpload op
8 augustus 2024
Aantal pagina's
87
Geschreven in
2024/2025
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
StuviaGuides West Virgina University
Bekijk profiel
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
15921
Lid sinds
6 jaar
Aantal volgers
8356
Documenten
5629
Laatst verkocht
5 uur geleden
Accounting, Finance, Statistics, Computer Science, Nursing, Chemistry, Biology & More — A+ Test Banks, Study Guides & Solutions

As a Top 1st Seller on Stuvia and a nursing professional, my mission is to be your light in the dark during nursing school and beyond. I know how stressful exams and assignments can be, which is why I’ve created clear, reliable, and well-structured resources to help you succeed. I offer test banks, study guides, and solution manuals for all subjects — including specialized test banks and solution manuals for business books. My materials have already supported countless students in achieving higher grades, and I want them to be the guide that makes your academic journey easier too. I’m passionate, approachable, and always focused on quality — because I believe every student deserves the chance to excel.

Lees meer Lees minder
4.3

2265 beoordelingen

5
1552
4
301
3
180
2
72
1
160

Populaire documenten

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via Bancontact, iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo eenvoudig kan het zijn.”

Alisha Student

Veelgestelde vragen