# General Computer Science for Engineers CISC 106 Lecture 01 James Atlas Computer and Information Sciences 9/2/2009.

## Presentation on theme: "General Computer Science for Engineers CISC 106 Lecture 01 James Atlas Computer and Information Sciences 9/2/2009."— Presentation transcript:

General Computer Science for Engineers CISC 106 Lecture 01 James Atlas Computer and Information Sciences 9/2/2009

Course Overview Website: ◦ http://www.udel.edu/CIS/jatlas/106/09F/ Lab based course ◦ MATLAB ◦ TA for each lab

Labs Pair programming Labs assigned on Monday Labs always due on the following Thursday at 11:55PM (10 days from assignment) Projects are group work and will be due 3 weeks after assigned

Grading Labs (25%) Participation (5%) Two Projects (10% + 10%) Two Midterm Exams (15% + 15%) Final Exam (20%) Your final course grade cannot be more than one letter grade higher than your exam average

Course Help Office Hours ◦ Tues 1-3PM Thurs 2-4PM ◦ TA: TBD Sakai ◦ Forums are great! E-mail

Intro to Computer Science Exercise:Compute based Pictionary Your team must create a list of instructions to draw a picture ◦ Choose a simple object to draw ◦ Numbers are allowed ◦ All prepositions, adjectives are allowed  on, next to, across ◦ Nouns can only be geometric nouns:  Circle  Line  Square ◦ No “car” or object nouns

MATLAB Command line Interactive (interpreted) matlab ◦ GUI version matlab -nodesktop ◦ Text version

MATLAB Prompt ◦ >> Expression ◦ >> 2 * 2 Variable ◦ >> product = 2 * 2

MATLAB How can we calculate the area of a circle? >> pi * 3^2 >> radius = 3 >> pi * radius ^ 2

f xf(x)

Functions Top-down program design (pp. 87-90) Breaking problems down Code reuse (Don’t reinvent the wheel) How do we write functions in MATLAB?

MATLAB m-files Create a circleArea m-file

Sample function circleArea.m %circleArea = number -> number %takes the radius of a circle and returns the calculated area of a circle function outputValue = circleArea(radius) outputValue = pi * radius ^ 2;

Now, what if we want to calculate area of a ring A ring of two concentric circles = -