0% found this document useful (0 votes)
685 views

1 Solutions To Assigned Problems

This document contains solutions to exercises from Chapter 1 of the textbook "Programming Logic and Design, 6th Edition". The exercises involve matching definitions to terms, describing the steps to writing a computer program, matching shapes to programming concepts, drawing flowcharts and writing pseudocode to represent the logic of programs that perform basic calculations and request user input. The solutions provide the requested matches, descriptions, flowcharts and pseudocode to model the program logic for each exercise.

Uploaded by

AdewumiEzekiel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
685 views

1 Solutions To Assigned Problems

This document contains solutions to exercises from Chapter 1 of the textbook "Programming Logic and Design, 6th Edition". The exercises involve matching definitions to terms, describing the steps to writing a computer program, matching shapes to programming concepts, drawing flowcharts and writing pseudocode to represent the logic of programs that perform basic calculations and request user input. The solutions provide the requested matches, descriptions, flowcharts and pseudocode to model the program logic for each exercise.

Uploaded by

AdewumiEzekiel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Programming Logic and Design, 6e

Solutions 1-1

Programming Logic and Design, 6th Edition


Chapter 1
Exercises
1. Match the definition with the appropriate term.
1.
Computer system devices
a.
2. Another word for programs
b.
3. Language rules
c.
4. Order of instructions
d.
5. Language translator
e.

compiler
syntax
logic
hardware
software

Answer:
1.
2.
3.
4.
5.

Computer system equipment


Another word for programs
Language rules
Order of instructions
Language translator

d.
e.
b.
c.
a.

hardware
software
syntax
logic
compiler

5.
3.
4.
1.
2.

Language translator
Language rules
Order of instructions
Computer system equipment
Another word for programs

a.
b.
c.
d.
e.

compiler
syntax
logic
hardware
software

2. In your own words, describe the steps to writing a computer program.


Answer:
The programmer must understand the problem that the user is trying to solve. Next,
the programmer plans the logic, often using a flowchart or pseudocode. Then, the
program is coded in a language such as Visual Basic or Java and translated to
machine language using a compiler or interpreter. Finally, the program is put into
production and maintained over the ensuing months or years.
3. Match the term with the appropriate shape.
Answer:
1.
2.
3.

Input
Processing
Output

B.
A.
B.

Programming Logic and Design, 6e

4.
5.

Decision
Terminal

Solutions 1-2

D.
C.

4. Draw a flowchart or write pseudocode to represent the logic of a program that allows
the user to enter a value. The program multiplies the value by 10 and outputs the
result.
Answer:
Flowchart
Pseudocode
start
declare variables
double myNumber
double myAnswer
display Enter a number.
get myNumber
myAnswer = myNumber * 10
display Your number times 10 is , myAnswer
stop

5. Draw a flowchart or write pseudocode to represent the logic of a program that allows
the user to enter a value for the radius of a circle. The program calculates the diameter
by multiplying the radius by 2, and then calculates the circumference by multiplying
the diameter by 3.14. The program outputs both the diameter and the circumference.
Answer:
Flowchart
Pseudocode
start
declare variables
double radius
double diameter
double circumference
display Enter a radius.
input radius
diameter = radius * 2
circumference = diameter * 3.14
display The diameter is , diameter
display The circumference is , circumference
stop

Programming Logic and Design, 6e

Solutions 1-3

6. Draw a flowchart or write pseudocode to represent the logic of a program that allows
the user to enter two values. The program outputs the sum of the two values.
Answer:
Flowchart
Pseudocode
start
declare variables
double num1
double num2
double answer
display Enter a number
get num1
display Enter another number
get num2
answer = num1 + num2
display The sum of the numbers is , answer
stop

7. Draw a flowchart or write pseudocode to represent the logic of a program that allows
the user to enter three values. The values represent hourly pay rate, the number of
hours worked this pay period, and percentage of gross salary that is withheld. The
program multiplies the hourly pay rate by the number of hours worked, giving the
gross pay; then, it multiplies the gross pay by the withholding percentage, giving the
withholding amount. Finally, it subtracts the withholding amount from the gross pay,
giving the net pay after taxes. The program outputs the net pay.
Answer:
Flowchart
Pseudocode
start
declare variables
double hourlyRate
double numHours
double percentWithheld
double grossPay
double withholdAmt
double netPay
display Enter the hourly rate

Programming Logic and Design, 6e

get hourlyRate
display Enter the number of hours worked
get numHours
display Enter the percent withheld
get percentWithheld
grossPay = hourlyRate * numHours
withholdAmt = grossPay * percentWithheld
netPay = grossPay - withholdAmt
display The net pay is , netPay
stop

Solutions 1-4

You might also like