CS 123 Lab 4 Instructor: Mark Boady Course Designer: Professor Bruce Char Department of Computer Science Drexel University Spring 2013.

Slides:



Advertisements
Similar presentations
CS123 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Spring 2012.
Advertisements

CS122 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Winter 2010.
1. 2 Type your ID # and press the ENTER key to continue YOU MUST LOG IN FOR PROPER CREDIT.
Please CLOSE YOUR LAPTOPS, and turn off and put away your cell phones, and get out your note-taking materials. Today’s daily quiz will be given at the.
COMS W1004 Introduction to Computer Science June 25, 2008.
Natural Environments: The Atmosphere GG 101 – Spring 2005 Boston University Professor: Ranga B. Myneni Office: Room 449 Stone Science Building (675 Commonwealth.
Course Objectives and Instructor Information. To understanding of current software engineering theory and practice To study various software development.
1. 2 Type your ID # and press the ENTER key to continue YOU MUST LOG IN FOR PROPER CREDIT.
Please CLOSE YOUR LAPTOPS, and turn off and put away your cell phones, and get out your note-taking materials. Today’s daily quiz will be given at the.
CS123 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Spring 2010.
Introduction to MA Day 1. Name: Charlotte Bailey Office: MATH 802 Office Phone: (765)
Introduction to MA Introduction to Calculus
Please open Daily Quiz 34. A scientific calculator may be used on this quiz. You can keep your yellow formula sheets out when you take the quiz. Remember.
NRS 122 Concepts of Mental Health Nursing Orientation for Fall 2012 Semester.
1. Please double click on the highlighted lab option for proper log in Successfully logged in Total time earned for the current semester will be displayed.
Please double click on the highlighted lab option for proper log in Successfully logged in Total time earned for the current semester will be displayed.
CS 121 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Fall 2009 ©By the author. All rights reserved. Permission.
1 SPANISH LAB ORIENTATION. Please double click on the highlighted lab option for proper log in Successfully logged in Total time earned for the current.
Introduction to Databases Computer Science 557 September 2007 Instructor: Joe Bockhorst University of Wisconsin - Milwaukee.
CS122 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Spring 2011.
General Computer Science for Engineers CISC 106 James Atlas Computer and Information Sciences 2/10/2010.
CS122 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Spring 2011.
CSE 1340 Introduction to Computing Concepts Class 1 ~ Intro.
CS123 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Spring 2010.
CS 121 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Fall 2009 ©By the author. All rights reserved. Permission.
Principles of Computer Science I Honors Section Note Set 1 CSE 1341 – H 1.
Number Representation, Data Types and Elementary Programming Shirley Moore CS 1401 February 5-7, 2013.
CS 122 / CS123 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Summer 2011 ©By the author. All rights reserved.
CS 121 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Fall 2009 ©By the author. All rights reserved. Permission.
CS122 Instructor Assignments Winter, 2010 Term. Overview Some changes in assignments due to schedule considerations Some new initiatives / revised strategies.
Calculus I – Course Syllabus Class Periods: 1:00pm-1:50am MTWF Classroom: Thompson Hall 315 Instructor: Mei Q. Chen, Thompson Hall 230
CS 121 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Fall 2010 ©By the author. All rights reserved. Permission.
CS122/CS123 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Summer 2011.
CS122 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Winter 2012.
CS122 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Spring 2011.
CS 121 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Fall 2011 ©By the author. All rights reserved. Permission.
CS123 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Spring 2010.
1 CS1430: Programming in C++ Section 2 Instructor: Qi Yang 213 Ullrich
CS 121 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Fall 2010 ©By the author. All rights reserved. Permission.
CS 121 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Fall 2012 ©By the author. All rights reserved. Permission.
CS123 Engineering Computation Lab Lab 1 Section Instructor: Mark Boady Content By: Bruce Char Department of Computer.
CS 121 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Fall 2011 ©By the author. All rights reserved. Permission.
CS123 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Spring 2012.
CS 121 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Winter, 2011 ©By the author. All rights reserved.
CS 121 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Fall 2012 ©By the author. All rights reserved. Permission.
1 COP 2510 Programming Concepts Spring credit hours Instructor:Dr. Rollins Turner ENB 343F Office Hours: MW 11:00 AM – 12:00.
1 CS 1430: Programming in C++. Quiz Functions Function Prototype float sqrt(float x); Function name, type, parameter and parameter type Function.
CS123 Engineering Computation Lab Lab 2 Instructor: Mark Boady Content By: Bruce Char Department of Computer Science Drexel University.
CS122 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Winter 2013.
CS 121 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Fall 2010 ©By the author. All rights reserved. Permission.
CS123 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Spring 2011.
CSE 1340 Introduction to Computing Concepts Class 1 ~ Intro.
CS122 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Winter 2012.
CS122 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Winter 2010.
CS123 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Spring 2013.
1. Please double click on the highlighted LAB OPTION for proper log in Successfully logged in Total time earned for the current semester will be displayed.
CS122 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Winter 2011.
CS122 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Winter 2012.
CS 122 Engineering Computation Lab Lab1 Bruce Char Department of Computer Science Drexel University Summer 2009 ©By the author. All rights reserved. Permission.
CS 122/CS123 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Summer 2011 ©By the author. All rights reserved.
Teachers: If you hand back Test 4 today, tell your class you will review it with them in class on Thursday when you do the review lecture on Chapters 6,
Please CLOSE YOUR LAPTOPS, and turn off and put away your cell phones, and get out your note-taking materials.
CS122 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Winter 2013.
CS 121 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Fall 2011 ©By the author. All rights reserved. Permission.
Grade Scale Quiz 3 Results: Average class score after partial credit: XX.X% Commonly missed questions: # ____________________ We will be going over some.
CS122 Engineering Computation Lab Lab 4
CSC 135 section 60 or CSC Fall 2017.
CS123 Engineering Computation Lab Lab 4
CS122 Engineering Computation Lab Lab 3
Final Exam End of Semester
Presentation transcript:

CS 123 Lab 4 Instructor: Mark Boady Course Designer: Professor Bruce Char Department of Computer Science Drexel University Spring 2013

Administrative Notes Please send your instructor your AVL form immediately if you are eligible for extended time for the Proficiency Exam Please also review your bbLearn Lab and Quiz grades and report any discrepancies to your instructor As with cs121 and cs122, there will be an opportunity to earn a 2% bonus for submitting a student evaluation. Details to follow! The lab 4 makeup lab will be moved to Tuesday, 5/28 due to the Memorial Day holiday on 5/27 – Room to be determined

Example New Question You can find the slope of a line from two points using the following formula: (y2-y1)/(x2-x1) Create a procedure slope:=proc(x1,y1,x2,y2) that returns the slope of the line. For example, slope(0,0,1,1) should return 1 Submit the Procedure

Proficiency Exam Preview Same logistics as in cs121 and cs122 – Proctored format – Two quizzes (25 and 70 minutes) – Sign-in and score verification To be conducted during week of June 3rd (week 10) in class for your regularly scheduled lab session Practice – week of May 27 (week 9) – All 4 quizzes and quizlets taken throughout the term will be re-posted on Tuesday, 5/28 – note that quiz 4 will take place during week 9 – A special quiz containing some problems not included in regular quizzes will also be issued – these questions are candidates for inclusion – A problem to develop a simple proc will also be included. It will be original and not from any of the quizzes. – Full quiz week (9) CLC coverage – Monday through Friday Graduating seniors are NOT exempt from the proficiency exam!!

Quiz Week (9) Activities Quiz 4 will be released on Friday (5/24) at 6 PM – Deadline: Thursday (5/30) at 4:30 PM – Makeup quiz – from Friday (5/31) at 9 AM through Sunday (6/2) at 11:00 PM 30% penalty No Pre-lab quizlet Be sure to visit the CLC for quiz assistance and use the quiz tips as needed. Practice week for Proficiency Exam – Will be posting practice quizzes on Tuesday, 5/28 – Exam to be conducted during week of June 3 (week 10 - final week of regular classes)

Programming is the same in any language Variables Procedure/functions Loops (for and while) Conditions (if statements) The next slides will show the Rabbit Problem from CS 122 in a number of different languages. You should see similarities to what you learned in Maple

Maple bunnies:=proc(year) local a,b,g,s,initial_rabbits,initial_foxes,r,f,i,nextr,nextf; a:=0.04; b:=5e-4; g:=0.2; s:=5e-5; initial_rabbits:=5891; initial_foxes:=16; r:=initial_rabbits; f:=initial_foxes; for i from 1 to year do nextr := r+floor(r*(a-b*f)); nextf := f-floor(f*(g-s*r)); r:=nextr; f:=nextf; end do: return [r,f]; end proc; bunnies(99);

Matlab function [ r,f ] = bunnies( year ) a = 0.04; b = 5e-4; g = 0.2; s = 5e-5; initial_rabbits=5891; initial_foxes=16; r=initial_rabbits; f=initial_foxes; for i=1:year nextr = r+floor(r*(a-b*f)); nextf = f-floor(f*(g-s*r)); r=nextr; f=nextf; end; end [r,f]=bunnies(99)

PHP function bunnies($years) { $a=0.04; $b=5e-4; $g=0.2; $s=5e-5; $initial_rabbits=5891; $initial_foxes=16; $r=$initial_rabbits; $f=$initial_foxes; for($i=1; $i <= $years; $i++) { $nextr = $r+floor($r*($a-$b*$f)); $nextf = $f-floor($f*($g-$s*$r)); $r=$nextr; $f=$nextf; } return array($r,$f); } echo print_r(bunnies(99));

C++ void bunnies(int years) { float a=0.04; float b=5e-4; float g=0.2; float s=5e-5; float initial_rabbits=5891; float initial_foxes=16; float r=initial_rabbits; float f=initial_foxes; for(int i=1; i <= years; i++) { float nextr = r+floor(r*(a-b*f)); float nextf = f-floor(f*(g-s*r)); r=nextr; f=nextf; } cout << r << ", " << f << endl; } //For simplicity the result is printed to the screen

Java static ArrayList bunnies(int years) { double a=0.04; double b=5e-4; double g=0.2; double s=5e-5; double initial_rabbits = 5891; double initial_foxes = 16; double r=initial_rabbits; double f=initial_foxes; for(int i=1; i <= years; i++) { double nextr = r+Math.floor(r*(a-b*f)); double nextf = f-Math.floor(f*(g-s*r)); r=nextr; f=nextf; } ArrayList res= new ArrayList (); res.add(new Integer( (int)(r))); res.add(new Integer( (int)(f))); return res; } System.out.println(bunnies(99));

Conclusions Topics in CS are in every programming language The following concepts were in each example Variable creation Assignment For Loops Procedure Definitions Return results Formal Parameters

Bounce Game API Game API – 3 key functions available – createTarget(x,y,w,h) Creates a target area consisting of 2x2 squares – x, y represent the coordinates of the lower left corner of the target area – w, h represent the target area’s width and height – drawBoard(T) Takes the list of target coordinates (T) and creates a plot structure of the target area for display – detectHits(x,y,radius,T) Performs collision detection (number of squares in the target area that have been knocked over) – x, y = coordinates of the center of the ball (disk object) – radius = radius of the ball – T = target list as created by createTarget function