Upcoming SlideShare
×

# Cois240 lesson01

• 227 views

Lesson 01 - Fundamentals

Lesson 01 - Fundamentals

• Comment goes here.
Are you sure you want to
Be the first to comment
Be the first to like this

Total Views
227
On Slideshare
0
From Embeds
0
Number of Embeds
2

Shares
1
0
Likes
0

No embeds

### Report content

No notes for slide

### Transcript

• 2. Review Topics• Back to Basics: Definitions• Programming Life-Cycle Phases• Memory and Data Organization• Machine Language vs. High Level Languages• Compilation and Execution Processes• Computer Components• Problem-Solving Techniques• C++ History Copyright © 2007 Angel G. Díaz. All rights reserved.
• 3. Back to Basics• Definitions: – Computer – Information System – Computer Programming – Logic – Algorithm – Programming Language Copyright © 2007 Angel G. Díaz. All rights reserved.
• 4. Programming Life Cycle Phases 1 Problem-Solving Phase – Analysis and Specification – General Solution ( Algorithm ) – Verify 2 Implementation Phase – Concrete Solution ( Program ) – Test 3 Maintenance Phase – Use – Maintain Copyright © 2007 Angel G. Díaz. All rights reserved.
• 5. Problem-Solving Phase: Case• ANALYZE the problem and SPECIFY what the solution must do• Develop a GENERAL SOLUTION (ALGORITHM) to solve the problem• VERIFY that your solution really solves the problem Copyright © 2007 Angel G. Díaz. All rights reserved.
• 6. Problem-Solving Phase (cont.)Problem Sample: A programmer needs an algorithm to determine an employee’s weekly wages.Wage Sample: In one week an employee works 52 hours at the hourly pay rate of \$10.00. Assume a 40.0 hour normal work week and an overtime pay rate factor of 1.5. What are the employee’s wages and how would the calculations be done by hand? Copyright © 2007 Angel G. Díaz. All rights reserved.
• 7. Problem-Solving Phase (cont.)Decisions: If hours are more than 40.0, then wages = (40.0 * payRate) + (hours - 40.0) * 1.5 *payRate otherwise, wages = hours * payRate Copyright © 2007 Angel G. Díaz. All rights reserved.
• 8. Problem-Solving Phase (cont.)Algorithm to Determine an Weekly Wages 1. Get the employee’s hourly payRate 2. Get the hours worked this week 3. Calculate this week’s regular wages 4. Calculate this week’s overtime wages (if any) 5. Add the regular wages to overtime wages (if any) to determine total wages for the week Copyright © 2007 Angel G. Díaz. All rights reserved.