• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 4 fuera de 101 páginas
Examen

Solutions Manual: Conv C++ for Computer Science and Engineering (3rd Edition) - Vic Broquard - Graded A+ Compreh...

Document preview thumbnail
Vista previa 4 fuera de 101 páginas

### Complete Solutions Manual: Conv C++ for Computer Science and Engineering (3rd Edition) by Vic Broquard | **Format:** Instant PDF Download | **Pages:** 104 Pages Master complex textbook exercises and exam problems with the complete, official **Solutions Manual** for **Conv C++ for Computer Science and Engineering** (3rd Edition) by Vic Broquard. #### What is Included: - **100% Complete Worked Solutions:** Step-by-step mathematical derivations, conceptual reasoning, and formulas for all textbook exercises. - **All Chapter Coverage:** Detailed answers for all end-of-chapter problems, questions, and review sets. - **Homework & Exam Advantage:** Check your work, practice challenging problem sets, and prepare thoroughly for quizzes and exams. Essential resource for self-study and mastering course material. Instant download on Stuvia!

Vista previa del contenido

STUDY NOTES & REFERENCE GUIDE




Design and Stop Exercises Solutions 1

Design and Stop Exercises Solutions ·




to accompany the third edition of
··




C++ for Computer Science and Engineering
··




by Vic Broquard
···




© 2001, 2002, 2003 by Vic Broquard, All rights reserved ··




Published by Broquard eBooks
··




103 Timberlane
East Peoria, IL 61611




tronkev1 ‐ Stuvia | Page 1 of 101

, STUDY NOTES & REFERENCE GUIDE




Design and Stop Exercises Solutions 2

Chapter 1 — Design Exercises ···




1. How would you solve this problem? What is the answer? A bug wishes to climb to the top of a
··




12-foot tall telephone pole. During the day, it climbs 3 feet. However, while it sleeps at night, the
··




bug slides back down 2 feet. How many days does it take the bug to reach its objective, the top of
··




the pole?

Answer:
day Starts Day At
·
Height Made that Day
··




1 0 3
2 1 4
3 2 5
4 3 6
5 4 7
6 5 8
7 6 9
8 7 10
9 8 11
10 9 12 — done he’s at the top


2. Sketch a solution in pseudocode or English to solve this problem. A math teacher wishes to
have a program that displays the multiplication tables for her fourth graders. She wants the
program to accept any whole number (integer) from 1 to 9. The program then displays the
multiplication tables from 1 to that number. A sample run might be as follows. Note she enters
the underlined number 4.
Enter a number from 1 to 9: 4
1 x 1 = 1 x 1 = 1
1 x 2 = 2 x 1 = 2
1 x 3 = 3 x 1 = 3
1 x 4 = 4 x 1 = 4
2 x 2 = 2 x 2 = 4
2 x 3 = 3 x 2 = 6
2 x 4 = 4 x 2 = 8
3 x 3 = 3 x 3 = 9
3 x 4 = 4 x 3 = 12
4 x 4 = 4 x 4 = 16

A Solution:
display “Enter a number from 1 to 9: “
input endnumber
let startnumber = 1
do the following while startnumber is less than or equal to endnumber let
currentnumber = startnumber




tronkev1 ‐ Stuvia | Page 2 of 101

, STUDY NOTES & REFERENCE GUIDE




Design and Stop Exercises Solutions 3

do the following while currentnumber is less than or equal to endnumber
display startnumber, ‘x’, currentnumber, ‘=’, currentnumber, ‘x’,
startnumber, ‘=’ currentnumber times startnumber
add 1 to currentnumber
end do
add one to startnumber
end do

main storage: startnumber endnumber currentnumber


3. Sketch a solution in pseudocode or English to solve this problem. A manager of some carpet
store wishes a program that calculates the square footage of carpet a customer requires and
determines his cost for installation based on the square footage. The program first asks him to
enter the length and width of the room. It then displays the square-footage. His installation cost is
found by multiplying the square footage by 7.5%. A test run might be:
Enter the length and width of the carpet: 10 20
The square footage is 200 and the service charge is $15.00

solution:
display “Enter the length and width of the carpet: “
input length and width
sqFootage = length times width
serviceCharge = sqFootage times .075 display
“The square footage is “, sqFootage,
“ and the service charge is $”, serviceCharge

main storage: length width sqFootage serviceCharge




tronkev1 ‐ Stuvia | Page 3 of 101

, STUDY NOTES & REFERENCE GUIDE




Design and Stop Exercises Solutions 4

Chapter 1 — Stop! Do These Exercises Before Programming
Correct the errors in the following programs. If you are having trouble determining what is
wrong, you can always make a test program, enter this coding and see what the compiler
indicates is wrong.

1. Why does this program not compile? Show what must be done to fix it?
int main () {
cout << "Hi there!\n";
return 0;
}
#include <iostream>
#include <iomanip>

solution: header includes must come first and needs the using namespace statement
#include <iostream>
#include <iomanip>
using namespace std;
int main () {
cout << "Hi there!\n";
return 0;
}


2. Why does this program not compile? Show what must be done to fix it?
#include <iostream>
#include <iomanip>
Int Main () {
Cout << "Great day outside!!\n";
return 0;
}

solution: you must watch the case of items and using namespace
#include <iostream>
#include <iomanip>
using namespace std;
int main () {
cout << "Great day outside!!\n";
return 0;
}


3. Why does this program not compile? Show what must be done to fix it?
#include <iostream>
#include <iomanip>




tronkev1 ‐ Stuvia | Page 4 of 101

Información del documento

Subido en
28 de septiembre de 2026
Número de páginas
101
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$28.98

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Vendido
0
Seguidores
0
Artículos
91
Última venta
-



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes