# Register now to access 7 million high quality study materials (What's Course Hero?) Course Hero is the premier provider of high quality online educational resources. With millions of study documents, online tutors, digital flashcards and free courseware, Course Hero is helping students learn more efficiently and effectively. Whether you're interested in exploring new subjects or mastering key topics for your next exam, Course Hero has the tools you need to achieve your goals.

9 Pages

### HowTo06

Course: COMP 1100, Fall 2009
School: Allan Hancock College
Rating:

Word Count: 496

#### Document Preview

To How . . . Reading: Thompson Ch.4 COMP1100 Introduction to Programming and Algorithms Clem Baker-Finch Australian National University Semester 1, 2006 COMP 1100 How To . . . 1 How To Design a Function We will go through some very basic ideas about how to come up with a function denition to solve a particular problem. When learning to program, the biggest hurdle is knowing how and where to start. The...

Register Now

#### Unformatted Document Excerpt

Coursehero >> California >> Allan Hancock College >> COMP 1100

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
To How . . . Reading: Thompson Ch.4 COMP1100 Introduction to Programming and Algorithms Clem Baker-Finch Australian National University Semester 1, 2006 COMP 1100 How To . . . 1 How To Design a Function We will go through some very basic ideas about how to come up with a function denition to solve a particular problem. When learning to program, the biggest hurdle is knowing how and where to start. The running example will be to design and dene a function to convert integers to English phrases corresponding to how we say numerals. (The script we are going to develop will be different to NumWords.hs used in Week 2 lab classes.) COMP 1100 How To . . . 2 Understand the Problem Analyse the problem. Think about all the details. Is the problem fully specied? For example, we want our program to say numerals properly, not like telephone numbers etc. Do we want it to work for all integers? No matter how big? Negative as well as positive? There is no right answer to these questions. Its up to the person specifying the requirements that is, the customer. For this exercise, we will only deal with positive numbers between 0 and 100. (It will be fairly easy to extend, once we have nished.) COMP 1100 How To . . . 3 What is a good name for the function? I chose convert. Not a very informative name can you suggest a better one? What is the Functions Type? What are its inputs and outputs? convert :: Int -> String COMP 1100 How To . . . 4 Abstraction Reducing Complexity You cant gure it out at all once! This is the KEY ACTIVITY in software development! 1. Does the problem break down into smaller parts? 2. Is there a simpler version you can do rst? 3. Have you seen a similar or related problem? COMP 1100 How To . . . 5 For our exercise, thinking about (1) and (2) in the list, we can start by working on the problem of converting single digit numerals: 0 to 9. (Why do I think that will help? Common sense and experience . . . ) COMP 1100 How To . . . 6 What Tools Do We Have? What does the programming language give you that might be useful? In Haskell, the Prelude functions and other libraries. (This knowledge improves with practice.) Do you know of any other programs or functions that may be similar or otherwise useful? I routinely cut and paste code from programs I have written earlier. I routinley look at old programs for clues and details. COMP 1100 How To . . . 7 Test...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Sonoma - ANTH - 590
COMMENTARYThe Waterloo battlefield is dominated by the &quot;Lion Mound,&quot; built by the Dutch in the 1820s over a stretch of Wellington's front lines.History, Archaeology, and the European Heritage IndustryReshaping Waterlooby NEIL ASHER SILBERMANsl
Sonoma - ANTH - 590
International Journal of Heritage Studies Vol. 12, No. 3, May 2006, pp. 292300The Scope and Definitions of Heritage: From Tangible to IntangibleYahaya AhmadSince the adoption of the Venice Charter in 1964, there have been many conservation guide
Washington - BIS - 411
Biotechnology and BioethicsBiotechnology and Society BIS 411 Monday and Wednesday 3:30-5:35 UW1-020 Class Number 9 February 1, 2006 Fukuyama Chapters 1 &amp; 2Class 9 Fukuyama 1&amp;2 2/1/06Why this course?Intersection of biology, society and polit
Washington - BIS - 398
Jamie Rockwell 4/27/09 BIS 393C Professor BlumenfieldNews Analysis For 5/6 ClassWhat Will the Olympics Mean for China? A Conversation with Professor Andrew Nathan http:/www.columbia.edu/cu/news/global/nathan.html and also a video This Question a
UC Davis - SAS - 025
Chapter 1: Introduction to Global Climate ChangeEverybody talks about the weather, but nobody does anything about it. This comment, attributed to Mark Twain in 1897, is no longer valid. Today human activities influence climate on both a local and gl
Sonoma - EDU - 420
Sheri Wood EDMS 420Dyslexia, an In-dept Study AbstractIntroduction: Dyslexia is a leaning disability that affects approximately eight to ten percent of the western population. The type of dyslexia discussed in this paper is developmental dyslexia.
W. Alabama - AH - 325
Revised 8/21/06AH 325Patient: Mechanism of Injury:MANUAL ASSESSMENT TECHNIQUE REVIEWExaminer: Date:Select one specific manual assessment technique to study &amp; complete the following items. This must completed on an actual patient who exhibits
Temple - TUA - 77473
Small business owner speaks out in wake of recession, election.Opening and running a small business is an intimidating idea in itself. Owning a small business in the wake of Americas economic recession is an even scarier undertaking. Lynda Rotelle,
Temple - TUA - 75432
Temple - TUA - 84760
Temple Expands While Housing Disappears It's that time of year, the time when all the upperclassmen at Temple University duke it out for housing around campus. With all of the stress of previous midterms and the future stress of finals, students do n
Temple - TUA - 56298
An Exercise In The Exotic As my alarm buzzed early Saturday morning I looked at the time and tried to remember why I was supposed to wake up so early. I was almost ready to roll over and go back to sleep until I looked over the side of my bed and saw
CSU Channel Islands - MATH - 120
Math 120A Introduction to Group Theory: Question sheet 6Hand in questions 4, 12 &amp; 14 at lecture Friday 15th May 1. Find all the orbits of the following permutations: (a) (145)(2345) S5 , (b) (1574)(324)(3256) S7 , (c) : Z Z where (n) = n + 3. 2.
CSU Channel Islands - MATH - 120
CSU Channel Islands - MATH - 120
CSU Channel Islands - MATH - 120
Math 120A: Introduction to Group Theory MidtermNo arguments are required for questions 1, 2 and 3, though question 4 requires full proofs. Marks are in brackets after each question - total 50 1. (a) Define what it means for : G H to be a homomorph
CSU Channel Islands - MATH - 120
Math 120A Introduction to Group Theory: Question sheet 5Hand in questions 2, 3 &amp; 4 at lecture Friday May 8th 1. Give examples of two distinct groups of order 720, one Abelian, the other not, stating which is which. 2. In this question we work in the
Sonoma - ANTH - 325
Anthro 325: World Prehistory Spring 2009 First Farmers Poster Assignment The poster assignments in this class are intended to present specific categories of data, information, or kinds of analysis that help us explore the contrasting positions archae
Trinity U - CS - 1323
CSCI 1323 (Discrete Structures), Spring 2004 Homework 8Assigned: April 23, 2004. Due: April 30, 2004, at 5pm. Accepted until May 3 at 5pm without penalty. Not accepted past May 4 at 5pm. Credit: 30 points.1ProblemsDo the following problems. Yo
Trinity U - CS - 1323
CSCI 1323 (Discrete Structures), Spring 2004 Homework 4Assigned: February 23, 2004. Due: March 1, 2004, at 5pm. Credit: 20 points.1ProblemsDo the following problems. You do not need to turn in answers for the ones marked &quot;Not to turn in&quot;. Mos
Arizona - BIOC - 462
zapbackground [0,0,0]load 1b7f.pdbset ambient 20set specular onresetslab offmoveTo 1 -116 -551 -827 165.3 175 -8 -18wireframe offcpk offselect proteincartoons oncolor whiteselect helixcolor limeselect sheetcolor redselect rnaw
Trinity U - CS - 1323
CSCI 1323 (Discrete Structures), Spring 2003 Homework 2Assigned: January 28, 2003. Due: February 4, 2003, at 5pm. Credit: 20 points.1ProblemsDo the following problems. You do not need to turn in answers for the ones marked Not to turn in. Most
Arizona - BIOC - 462
zapbackground [0,0,0]load 1GTS.PDBset ambient 20set specular onresetslab offmoveTo 1 -993 -52 104 177.4 100 2 6wireframe offselect proteincolor white cartoons onselect sheetcolor redselect helixcolor limeselect rnawireframe 0.25c
Arizona - BIOC - 462
zapbackground [0,0,0]load 1C9S.PDBset ambient 20set specular onresetslab offmoveTo 1 936 350 -37 103.0 125 0 15wireframe offcpk offselect proteinrestrict :l or :m or :n or :o or :p or :q or :r or :s or :t or :u or :vcolor whitecartoon
Trinity U - CS - 1323
CSCI 1323 (Discrete Structures), Spring 2001 Homework 4Assigned: January 30, 2001. Due: February 6, 2001, at the start of class. Credit: 20 points.1Problems1. (4 points) Using the predicate symbols shown and appropriate quantiers, write each E
Trinity U - CS - 1323
CSCI 1323 (Discrete Structures), Spring 2001 Homework 20Assigned: April 26, 2001. Due: May 5, 2001, at the start of the exam period. Not accepted late. Credit: 20 extra credit points. You are not required to turn in any of these problems; any you t
Old Dominion - CS - 148
CS148 Introduction to Programming IIAyman Abdel-HamidDepartment of Computer Science Old Dominion University Lecture 12: 2/24/2003Lecture 12: 2/24/2003 CS148 Spring 2003 1OutlineLinked lists Operations on linked lists Insert at back Insert at fr
Arizona - ECOL - 406
Lecture 26, 25 Nov. 2008 Restoration &amp; Reconciliation Conservation Biology ECOL 406R/506R University of Arizona Fall 2008 Bonine &amp; Epps506 meet at 1505h todayReadings Today 25 Nov: Restoration &amp; Reconciliation: Primack Ch8 Tues 02 Dec: CREATIVITY
Trinity U - CS - 4320
CSCI 4320 (Principles of Operating Systems), Fall 2007 Review for Midterm Exam1Format of the examThe exam will be in class October 10. You will have 50 minutes. You may use your textbook and any notes or papers you care to bring (with the excep
Trinity U - CS - 4320
CSCI 4320 (Principles of Operating Systems), Fall 2005 Review for Exam 11Format of the examThe exam will be in class October 19. You will have 50 minutes. You may use your textbook and any notes or papers you care to bring (with the exception o
Arizona - GEO - 101
Foundathighaltitudes&amp;highelevations Typicallylocatedbetween55N&amp; 80N MainlyintheArcticbutAlpineTundraFoundoneithersideoftheequator Locatedaround3040S&amp;30 50N MostlyinAfrica,butalsoinIndia,Southconditionsfoundthroughouttheworldshigh America&amp;Australi
Trinity U - CS - 1323
CSCI 1323February 11, 2005Administrivia Reminder: Quiz solutions on Web, usually shortly after class. Course &quot;useful links&quot; page has links to more examples of induction.Slide 1Mathematical Induction, Continued Basic idea is to prove someth
Trinity U - CS - 1323
CSCI 1323February 11, 2004Administrivia Course &quot;useful links&quot; page has links to more examples of induction.Slide 1Mathematical Induction, Continued Basic idea is to prove something true for all integers greater than some basevalue (usually
Trinity U - CS - 1323
CSCI 1323 (Discrete Structures), Spring 2001 Homework 10Assigned: March 1, 2001. Due: March 8, 2001, at the start of class. Credit: 20 points.1Problems1. (6 points) Do problem 17 on p. 138 of the textbook. Use the first principle of mathematic
Trinity U - CS - 1323
CSCI 1323February 20, 2006Administrivia Reminder: Homework 3 due Wednesday.Slide 1Mathematical Induction, Recap Basic idea is to prove something true for all integers greater than some basevalue (usually 0 or 1) in two steps: Base case -
Sonoma - USERS - 426
Econ 426 Sonoma State University Spring 2008 Dr. Robert Eyler Topic Coverage for Midterm While we have had a variety of topics, people and ideas discussed to date in class, this list is meant to focus on what will be covered for the exam. Use this li
Sonoma - CS - 101
CS101 Lecture 15How the Internet WorksWhen did the Internet start? The Internet was born in _ with the invention of ARPANET ARPANET was a research project funded by the Defense Department to build a computer network so they could act faster the
Washington - COM - 340
Washington - COM - 340
Washington - COM - 340
Old Dominion - CS - 775
CS 775/875: Fall 2000Chapter 14: ReplicationWhy Data Replication? Performance enhancements Increased availability Fault tolerance (related to correctness) Issue: Replication transparency, consistenceySystem Model Asynchronous system Fa
Old Dominion - CS - 471
CS471: Operating System Concepts Fall 2006 (Lecture: TR 11:25-12:40 PM)Homework #4 Points: 20Due: September 26, 2006 SolutionQuestion 1 [Points 10] Exercise 7.11 Consider the following snapshot of a system: Allocation A B C D P0 P1 P2 P3 P4 0 0 1
Seattle Pacific - MEDIA - 0304
S p ort s I n f or m at io n Of f i c eLinnea Jarvits, Assistant SIDFOR IMMEDIATE RELEASE: JANUARY 20, 20042004 Women's Gymnastics206/281-2772 voice | 206/281-2266 fax | frmacdon@spu.edu | www.spu.edu/falconsonlineGymnasts Face First Road Test
Temple - TUA - 03226
CIS 1055 Computers and Applications Laboratory Syllabus Summer 2007 Section 421 Laboratory Instructor: Meg Guerreiro E-Mail Address: megann@temple.edu Web Address: http:/astro.temple.edu/~tua03226 Office Location: 412 Wachman Hall Office Hours: Wedn
Temple - CP - 2579
CIS 1055 Computers and Applications Laboratory Syllabus Fall 2007 Section 620 Laboratory Instructor: Christopher M. Pascucci E-Mail Address: cpascucci@temple.edu Web Address: http:/astro.temple.edu/~cp2579/ Office Location: 412 Wachman Hall Office P
Trinity U - M - 1312
Math 1312 Spring 2007Calculus IIFirst Midterm Exam Tuesday, February 6, 7:00 PM - 9:00 PMYour name (please print):Instructions: Other than a single 8.5&quot; 11&quot; page of handwritten notes, this is a closed book, closed notes exam. Use of calculato
Norwich - MA - 224
MA224 INTEGRAL OF THE DAY APRIL 3, 2006 Compute L [sin bt] either directly from the integral eibt -e-ibt . 2i Solution I &quot;The Cowboy Way.&quot; Let I = u = e-st , du = -se-st dt, Therefore, 1 I = - e-st cos bt - b 1 s = - e-st cos bt - b b We integrate
CSU Channel Islands - ICS - 151
HOMEWORK 6 (OPTIONAL)ICS 151 Digital Logic DesignSpring 2004 Due Monday June 12, 6 p.m. NAME:_ 1. Moore Sequence Detector Design a synchronous sequential circuit with one input (x) and one output (z) line that recognizes the input string x=1111. I
Washington - FACULTY - 501
Christopher P. Salas-Wright Writing Sample_ Across the political spectrum, it is not uncommon to hear people talk about Latinos (or Hispanics) in the United States as if they were a single, homogenous group. To be sure, there most certainly are a n
Norwich - MA - 224
MA224 INTEGRAL OF THE DAY MARCH 30, 2006 dx sin x + cos 2x Solution. By the double-angle formula for cosine, we have2dx = sin x + cos 2x2dx sin x + (cos2 x - sin2 x)2= =dx cos2 x sec2 x dx= tan x + C
Norwich - MA - 224
MA224 INTEGRAL OF THE DAY MARCH 27, 2006 dx 1 + 2x + 3Solution. We let u =1 + 2x = u2 = 1+2x, 2u du = 2 dx = u du = dx. Therefore, u du u+3 1-dx = 1 + 2x + 3 =3 du u+3 = u - 3 ln |u + 3| + C = 1 + 2x - 3 ln( 1 + 2x + 3) + C
Norwich - MA - 224
MA224 INTEGRAL OF THE DAY FEBRUARY 16, 2006 9 - x2 dx x I will do the problem two ways, once following each hint. Solution I. Let u = 9 - x2 = u2 = 9 - x2 = 2u du = -2x dx = u du = -x dx. Then 9 - x2 9 - x2 dx = x dx x x2 = = u (-u) du 9 - u2 u2
Norwich - MA - 224
MA224 INTEGRAL OF THE DAY MARCH 27, 2006x4 ! x10 + 16 dxSolution. Let u = x5 ! du = 5 x 4 dx . Also, u 2 = x10 . Thusx4 1 du ) x10 + 16 dx = 5 ) u 2 + 16 1 1 &quot;x# = \$ tan !1 % &amp; + C 5 4 '4( = 1 &quot;x# tan !1 % &amp; + C 20 '4(
Sonoma - ECON - 421
Data Dictionary - Appendix NAppendix N Occupation Last Week &amp; Last YearPage 1 of 52N.1Coding for: January February March May June October November Comp Use Basic Outgoing2004 2005 2003 -2006 2003 -2005 2004 2003 -2005 2004 2003 2003 -2006 20
Duke - CPS - 170
%!PS-Adobe-3.0 %Title: Microsoft PowerPoint - Intro %Creator: PScript5.dll Version 5.2 %CreationDate: 1/13/2004 11:29:16 %For: parr %BoundingBox: (atend) %Pages: (atend) %Orientation: Portrait %PageOrder: Special %DocumentNeededResources: (atend) %Do
Duke - CPS - 170
%!PS-Adobe-3.0 %Title: Microsoft PowerPoint - CSP1 %Creator: PScript5.dll Version 5.2 %CreationDate: 2/12/2004 15:36:6 %For: parr %BoundingBox: (atend) %Pages: (atend) %Orientation: Portrait %PageOrder: Special %DocumentNeededResources: (atend) %Docu
Duke - CPS - 170
%!PS-Adobe-2.0 %Creator: dvips(k) 5.92b Copyright 2002 Radical Eye Software %Title: hw1.dvi %Pages: 1 %PageOrder: Ascend %BoundingBox: 0 0 612 792 %EndComments %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips hw1.dvi %DVIPSParameters: dpi
Duke - CPS - 170
%!PS-Adobe-3.0 %Title: Microsoft PowerPoint - Games I %Creator: PScript5.dll Version 5.2 %CreationDate: 2/12/2004 15:36:45 %For: parr %BoundingBox: (atend) %Pages: (atend) %Orientation: Portrait %PageOrder: Special %DocumentNeededResources: (atend) %
Duke - CPS - 170
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;Error&gt;&lt;Code&gt;NoSuchKey&lt;/Code&gt;&lt;Message&gt;The specified key does not exist.&lt;/Message&gt;&lt;Key&gt;904a66fb13f27631dca732c71be2032d875950d1.ps&lt;/Key&gt;&lt;RequestId&gt;0E 595B767F1A5B25&lt;/RequestId&gt;&lt;HostId&gt;CVMD8e0XE5HVK6lMjT0CvlTBnVme
Duke - CPS - 170
%!PS-Adobe-3.0 %Title: Microsoft PowerPoint - Logic Intro %Creator: PScript5.dll Version 5.2 %CreationDate: 3/3/2004 13:28:20 %For: parr %BoundingBox: (atend) %Pages: (atend) %Orientation: Portrait %PageOrder: Special %DocumentNeededResources: (atend
Duke - CPS - 170
%!PS-Adobe-3.0 %Title: Microsoft PowerPoint - First Order Logic %Creator: PScript5.dll Version 5.2 %CreationDate: 3/3/2004 13:29:42 %For: parr %BoundingBox: (atend) %Pages: (atend) %Orientation: Portrait %PageOrder: Special %DocumentNeededResources:
Duke - CPS - 170
%!PS-Adobe-3.0 %Title: Microsoft PowerPoint - Logic Programming Systems %Creator: PScript5.dll Version 5.2 %CreationDate: 3/3/2004 13:29:4 %For: parr %BoundingBox: (atend) %Pages: (atend) %Orientation: Portrait %PageOrder: Special %DocumentNeededReso