1 - Introduction to Computers and Programming Prof. I. K....

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Computers and Programming Prof. I. K. Lundqvist Recitation 1 Some suggestions … Problem solving example) If-then-else statements Yesterdays PRS question (robot) / Truth table Binary, Hex, ASCII String manipulation Sept 11 2003 – Feldman Case Study Format (the bank Little/Big Endian
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Case Study Format (p19) 1) Problem Specification amount of money (positive integer only) in a bank account. than zero) to be withdrawn. in the account, by more than $50, the program is to display a message that the transaction is refused, and the equal to the amount in the account, the transaction is in the account, by up to $50, the program is to accept the transaction and display the new balance, with a warning that the account is overdrawn. 1. Problem specification 2. Analysis 3. Design 4. Test plan 5. Implementation 6. Testing A program is required which will ask the user for the It will then ask for the amount of money (integers greater If the amount to be withdrawn is greater than the amount unchanged balance is displayed. If the amount of money to be withdrawn is less than or accepted and the new balance in the account is displayed. If the amount to be withdrawn is greater than the amount
Background image of page 2
100 Enter the withdrawal 50 Accepted . Balance is 50 76 Enter the withdrawal 150 Refused ! Balance is 76 50 Enter the withdrawal 75 Overdraft ! Balance is -25 Determine what you are asked to do: 1. Interact with user via text interface Enter balance of the account Enter balance of the account Enter balance of the account 2) Analysis • Determine what you are asked to do: 2. Act differently depending on balance in account after withdrawn: Balance after Action withdrawal >= 0 Accept withdrawal >= -50 and < 0 Overdraft < -50 Refuse withdrawal
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/28/2012 for the course AERO 16.01 taught by Professor Markdrela during the Fall '05 term at MIT.

Page1 / 12

1 - Introduction to Computers and Programming Prof. I. K....

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online