New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

ECE 118 Notes

by: awright

ECE 118 Notes ECE 118

GPA 3.9

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Notes from January
Intro to Programming Languages
Class Notes
25 ?




Popular in Intro to Programming Languages

Popular in Computer Science and Engineering

This 3 page Class Notes was uploaded by awright on Sunday February 28, 2016. The Class Notes belongs to ECE 118 at University of Miami taught by Kubat in Fall 2015. Since its upload, it has received 29 views. For similar materials see Intro to Programming Languages in Computer Science and Engineering at University of Miami.

Popular in Computer Science and Engineering


Reviews for ECE 118 Notes


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 02/28/16
1.29.2016 Notes #include "library.h" void print_message() { print("message"); new_line(); } void main() { print_message(); print_message(); } This program just prints the word message twice because you called the function twice. #include "library.h" void print_message() { print("message"); new_line(); } void print_two_messages() { print_message(); print_message(); } void print_three_messages() { print_message(); print_two_messages(); } void print_four_messages() { print_three_messages(); print_message(); } void main() { print_four_messages(); } This is like what was done earlier with the squares. Calling up functions created new functions  and shortcuts so that this prints four messages just by saying print_four_messages(). Recursion #include "library.h" void print_N_messages(int N) { if (N>0) { print("message"); new_line(); print_N_messages(N-1); } } void main() { print_N_messages(3); } And this is how you do the same thing as above but a whole lot shorter. Use an “if condition” to  make the function recurring. Recursion is basically where the function calls itself. For recursion  you need a stopping criterion. The stopping criterion in this function is (N>0) so that once you  get down to (N­1) is not greater than 0, it stops writing message. if (~~) Stopping criterion for a recurring function, see above Sums of all numbers between n and 0 #include "library.h" int sums(int const n) { if (n>0) return (n + sums(n-1)); else return(0); } void main() { int const n = 5; print("the sum is "); print(sums(n)); new_line(); } This function uses recursion to get sum(N) = N + sum(N­1) so the above function prints “The  sum is 15.” There is a PowerPoint explaining recursion on blackboard as well. Sums for All Numbers Between n and m #include "library.h" int sums(int const n) { if (n>0) return (n + sums(n-1)); else return(0); } int sums(int const n, int const m) { if(n==m) return(n); else return(m + sums(n, m-1)); } void main() { int const n = 10; int const m = 3; print("the sum is "); print(sums(n, m)); new_line(); } This gets the sums of all numbers between 10 and 3 and then stops when m is equal to n. You  can also put “else return(n + sums(n+1, m)).” Even though the names of the two functions above  are the same, the compiler knows that they are different because they have a different number of  arguments.


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Kyle Maynard Purdue

"When you're taking detailed notes and trying to help everyone else out in the class, it really helps you learn and understand the I made $280 on my first study guide!"

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.