Home Page

Programming
From Problem to UML to C

QR Code Link

Unit Wk
Topic & Application
Falling ObjectOptical LensRoot Finding
1
Intro
C1
⬩1
A. Course Introduction(pptx)
B. Install Compiler/Editor (MinGW & Notepad++)
Milestone 1 Tools
Read Part 1 Teaching Notes §1 The Course and Tools
2
Problem
C2
⬩12
A. Review (tools): Compile→Link→run→debug (htm)
B. Understanding the Problem (pptx)
v=f(t) OR v≠f(t) ? Lens Theory Bisection
Problem(pptx) Problem(pptx) Problem(pptx)
3
UML
C3
⬩13
⬩20
Read Part 1 Teaching Notes §2 UML Diagrams (pg 4-8)
A. Theory: Defining Algorithms with UML (pptx)
B. Apply: Represent solution process with UML
UML(pptx) UML(pptx) UML(pptx)
C. Milestone 2 UML (example)
4
Function
C4
⬩21
Milestone 2_UML T1; 1_tools T2
Theory: Implementing the UML: Planning for Functions pptx
Apply: Decide on function: your own || library || others.
UML → g4func.c UML → o4func.c UML → r4func.c
Check: Walking through: Deciding Functions...
Func(pptx) Func(pptx) Func(pptx)
5
Variables
C5
⬩14
⬩22
Read SDBA §1.2 Variables pg 3-16 YZU
Milestone 2_UML T2; 1_tools T3
Review UML →Pseudo-Code: Falling Object, Optics, Root
Theory: Coding w/ Variables (pptx) Code
Practice: General Concepts §3 Variables p.24
C6
⬩15
⬩23
🔑
Milestone 2_UML T3; 1_tools T4
Apply: Create machine code (floating point variables)
g4func.c→g5var.c o4func.c→o5var.c r4func.c→r5var.c
Check: Walking through "a" solution...
g_var(pptx) o_var(pptx) r_var(pptx)
C7
⬩16
⬩24
⬩31
Coordinate System
o5var.c→o5com.c
o5com.c→o5coord.c
Rule Breaking
Midterm ⬩17Retry Milestone 1_tools(C)
⬩25Retry Milestone 2_UML(B)
⬩32Retry Milestone 3_var(A)
6
Pointers
C9
⬩26
⬩33
Prepare: Read SDBA §1.3 Pointers pg 16-31 YZU
Review: UML→Code a= f(a,b,c) g=(a,b,c) Quad 1 root
Theory: Pointers & Addresses(pptx)
Practice: General Concepts §4 Pointers p.25
Retry Milestone 1_tools, 2_UML, 3_var
C10
41
34
Prepare: Read SDBA §1.4 Pointers & Functions pg 31- YZU
Theory(2): Pointers & Functions(pptx) vpfunc(pptx)
g5var.c → g6ptr.c o5coord.c → o6ptr.c r5var.c → r6ptr.c
Check: Walking through "a" solution...
g_ptr(pptx) o_ptr(pptx) r_ptr(pptx)
Milestone 4_VP, Retry 1_tools, 2_UML, 3_var
Summary: Pointers/Variables
Read: Part 1 Teaching Notes ยง5 Pointers (pg16-19)
7
Flow
C11
C12
🔑
C13
Decision & Repetition (pptx) OC(pptx)
Apply: flow control to complete solution
Repetition + Input File (Mistype ↓)
g6ptr.c → g7loop.c mgdt.csv
Decision
→ Fix Lens Equ.
o6ptr.c → o7if.c
Decision + Repetition → Converge
r6ptr.c → r7loop.c
Check: Walking through "a" solution...
mgfloa.swf if(pptx) mrfloa.swf
Multiple Files
o7if.c → o7main.c + olib.c + olib.h
Multiple Lens
o7main.c → o8loop.c
olib.c & olib.h
A Solution: mofloa2.swf
Improving Efficiency/Clarity by Data Abstraction
8
Arrays
C14
C15
OverviewArrays → Summary & Application 7arr.swf
Apply: Use arrays to separate input, calculation, output
mg5loop.c (mgdt.csv) → UML → mg6array.c mo8loop.c, molib.c,molib.h, mo8.bat →UML →mo9array.c Generalize: ax3 + bx2 + cx + d = 0
mr4nrootp.c → mr5array.c
Check: Walking through "a" solution...
mgarra.swf moarra.swf mroot2.swf#70
Final ⬩4xRetry Milestone 4_ptr(C)
⬩5xRetry Milestone 5_flow(B)
⬩61Milestone 6_arr(A)
RetryF1Milestone Walkthrough and Retry
9
Records
F2 Records → Summary & Application 7rec.swf
Use records to link x,y data & remove pointers from user functions (i.e. use return)
mg6array.c(mgdt.csv) → mg7rec.c mo9array.c, molib.c, molib.h → moBrec.c -
Walking through "a" solution...
mgrav2.swf#96 mopt.swf#262 -
10
Next→
EX Final Code, Files & Text
mg7rec.c (mgdt.csv) moArec.c, moBrec.c