CS 2073 Computer Programming w/Eng. Applications Ch 1. Turgay Korkmaz Office: SB 4.01.13 Phone: (210) 458-7346 Fax: (210) 458-4437 e-mail: firstname.lastname@example.org web: www.cs.utsa.edu/~korkmaz. Lecture++; . Ch1: Engineering Problem Solving. Read Section 1.1 from the textbook
Computer Programming w/Eng. Applications
Office: SB 4.01.13
Phone: (210) 458-7346
Fax: (210) 458-4437
Computer: a machine that is designed to perform operations (set of instructions called program) to achieve a specific task (e.g., 3+4)
Hardware: computer equipment (e.g., keyboard, mouse, terminal, hard disk, printer)
Software: programs that describe the steps we want the computer to perform.
In this sense, do you think we are like a computer?
Yes + we have intelligence
(x2, y2)Example 1
1. Problem statement
Compute the straight line
distance between two points in a plane
2. Input/output description
Point 1 (x1, y1)
Distance between two points (distance)
Point 2 (x2, y2)
3. Hand example
side1 = 4 - 1 = 3
side2 = 7 - 5 = 2
4. Algorithm development and coding
a. Generalize the hand solution and list/outline the necessary operations step-by-step
b. Convert the above outlined solution to a program using any language you want (see next slide for C imp.)
The distance between two points is 3.61
How will you find the distance between two other points (2,5) and (10,8)?
areaCompute the area of a triangle
area = ½ * 3 *4 = 6 cm2
b3Given two complex numbers z1=a1+b1*i and z2=a2+b2*i, find z3= z1+z2
SGiven the number of seconds, find number of hours, minutes and seconds
3675 seconds can be written as
1 hour 1 min 15 sec
Some problems are from How to Solve it: Modern Heuristics by Michalewicz and Fogel. Springer 2004.
yExample: Make a triangle with maximum area
the area of that triangle
name final midterm avg_hw quizze letter
aaaa 30 20 30 4 ?
bbbb 20 15 40 10 ?
How can I assign letter grades?
Given n (for example n=1000), compute
1. All engineering reasoning expresses a purpose. Take time to state your purpose clearly.
2. All engineering reasoning seeks to figure something out, to settle some question, solve some engineering problem.
3. All engineering reasoning requires to settle some assumptions.
4. All engineering reasoning is done from some perspective or point of view.
5. All engineering reasoning is based on or data, information, and evidence.
6. All engineering reasoning is expressed through, and shaped by, concepts and theories.
7. All engineering reasoning entails shaped by, inferences or interpretations by which we draw conclusions and give meaning to engineering work.
8. All engineering reasoning leads somewhere or has shaped by, implications and consequences.