| |||||||||||||||
|
|
![]() CHAPTER 4 EXERCISE ANSWERS 1. A. Control will be transferred to line 90 Statement numbers may be repeated in line number specifications in ON-GOTO statements. 2. ON A/10 GOTO 60, 80, 80, 150, 150, 180 In this example the value of the variable is divided by a- specified number to get the integer value. 3. A. An entry other than a 1 or 2 would cause lines 70 and 80 to be executed. B. The line numbers of the statements that would be executed following line number 50 are 60, 90, 100, 130, 140, 170, and the program will stop at 180 and wait for a response. C. The purpose of statements 170-190 is to control the loop. Statement 190 tests the value of the string variable, Q$; if it is equal to Y (more input), then control is transferred back to statement number 10 to request and process the next input. If Q$ is equal to N (no more input) execution of the program is terminated by statement number 200. 4. This is one way the program could be written to solve the problem.
ENTER BEGINNING BALANCE ? YOUR BEGINNING BALANCE IS $2450.25 CHECKS/
BALANCE
YOUR FINAL BALANCE IS $2472.75 |
|
Privacy Statement - Press Release - Copyright Information. - Contact Us - Support Integrated Publishing |