Premium Essay

Chapter 3 Programming Logic and Design Tony Gadis Partial

In:

Submitted By JakeAustin12
Words 645
Pages 3
Assignment #3 – Chapter #3
Wharton Class Due: Tuesday, September 16th @ 8:45am
FBTC Class Due: Wednesday, September 17th @ 10:15am

M/C Questions 1 – 15, pp. 113-4 (30 pts. total – 2 pts. ea.) 1. c
2. a
3. d
4. b
5. c
6.a
7.a
8. b
9. c
10. a
11. b
12. c
13. a
14. d
15. b

T/F Questions 1 – 12, p.115 (12 pts. total – 1 pt. ea.) 1. f
2. t
3. t
4. f
5. t
6. f
7. f
8. t
9. t
10.f
11. t
12. f Algorithm Workbench #1 - #7, pp.115-6 – Write pseudocode (not Java) (21 pts. total)
1. Module Main()
Declare userNum as Integer
Display "Enter a number" input userNum call TimesTen(userNum)
Display userNum
End

Function TimesTen(integer userNum) userNum = (userNum * 10) return userNum
End Function

Algorithm Workbench #1 - #7, pp. 115-6 (continued) – Write pseudocode (not Java)

2. def main(): showvalue() def showvalue(): print '12'

main()

3.
The value stored in ‘a’ will be: 3
The value stored in ‘b’ will be: 2
The value stored in ‘c’ will be: 1
4. Declare Integer age
Declare Real income
Declare String name

Call Module1 (agem Real_Income, Name)

5.

6.

7.

Debugging Exercises, p.117 (3 pts. Ea. / 12 pts. Total )

1.

2.

3.

4.

Programming Exercises, (#1 - p.117) (10 points total)
#1. Kilometer Converter
Design a modular program that asks the user to enter a distance in kilometers, and the converts that distance to miles. The conversion formula is as follows:
Miles = Kilometers * 0.6214
Additional Instructions:
1. Design using pseudocode.
2. Use the following module names: getKilometers – read kilometers from user keyboard input and store in ‘kilometers’ variable showMiles – accepts ‘kilometers’ variable as input argument and displays the equivalent value in miles
Module main () Declare

Similar Documents