100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

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

Rating
-
Sold
2
Pages
87
Grade
A+
Uploaded on
08-08-2024
Written in
2024/2025

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

Institution
SolutionManual
Course
SolutionManual











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
SolutionManual
Course
SolutionManual

Document information

Uploaded on
August 8, 2024
Number of pages
87
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

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

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
StuviaGuides West Virgina University
View profile
Follow You need to be logged in order to follow users or courses
Sold
15137
Member since
6 year
Number of followers
8355
Documents
5312
Last sold
6 hours ago
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.

Read more Read less
4.3

2129 reviews

5
1468
4
281
3
167
2
69
1
144

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions