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

Fund. of Computing I

by: Mrs. Damaris Hyatt

Fund. of Computing I CSE 20211

Mrs. Damaris Hyatt
GPA 3.79

Nitesh Chawla

Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

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

Nitesh Chawla
Class Notes
25 ?




Popular in Course

Popular in Computer Science and Engineering

This 0 page Class Notes was uploaded by Mrs. Damaris Hyatt on Sunday November 1, 2015. The Class Notes belongs to CSE 20211 at University of Notre Dame taught by Nitesh Chawla in Fall. Since its upload, it has received 14 views. For similar materials see /class/232736/cse-20211-university-of-notre-dame in Computer Science and Engineering at University of Notre Dame.

Similar to CSE 20211 at ND

Popular in Computer Science and Engineering


Reviews for Fund. of Computing I


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: 11/01/15
Fundamentals of Computing Midterm Review Dr Nitesh Chawla You are not required to turn these in But please solve all the questions for your own practice before the midterm as they will help in review of concepts Please email me or the TAs with any questions I will post the solutions by endof Wednesday but please attempt the questions before looking up the solutions Also review all the exercises and quizzes in addition to the notes for the midterm And make sure to study the corresponding sectionschapters in the textbook This is just a sample problem set to have you revise and practice some ofthe concepts covered in class All the Best 1 Convert the following 3 binary numbers to decimal 1001101001 1100110001101111 11100011110011 617 20443359375 14579 2 Convert the following octal integers to hexadecimal 3456161212 72E E 28A 3 Convert the following hexadecimal to decimal 0xE43 0xABEF 0x7FA2 3651 44015 32674 4 What is the result of this expression Apply appropriate precedence rules 10987654321 18 5 What is precedence What is associativity Precedence descn bes which operators get executed rst Associativity is a property that describes how operators of the same precedence re grouped in the absence of parenthesis Operators may be leftassociative ghtassociative or nonassociative 6 How many bits are needed for a short int long oat and double short 16 int 32 long 32 oat 32 double 7 When should one use typecast Give an example When doing an operation that returns a different type than the variable you are setting it to you can use a typecast to return a different type For example if you have two integers but you want to get the result ofa decimal division between them you could type f float i1 oat i2 8 If I want a variable to have a scope throughout my program how should I declare it As a global variable 9 If I want a variable to have a scope only within a function how should I declare it As a local variable within the function 10 Does the function always have to return a value No void type 11 What does sizeof function do Give an example of its use It tells you the size of a given datatype in bytes When sizeof is applied at an array the result is the size in bytes of the array in memory If you want to know how many elements are in an integer array you can do int a5039 printf dn sizeofa sizeofint 12 Consider the following program What is the output includeltstdiohgt double Unknowndouble X double y int l int J main double X 10 double Y 20i int l 3 int J 4 X UnknownXYamplampJ printfquotlf lf d dnquotXY lJ Y UnknownYXampJampl printfquotlf lf d dnquotXYlJ double Unknowndouble x double y int l int J XXY yXY J JJ returnx It will print 3000000 2000000 7 11 3000000 5000000 25 18 13 Considerthe following Boolean expression lla ampamp b Which of the following is equivalent to this expression A a ampamp lb B la lb C la H b D a H lb E None of the options A D 14 What is printed when the go function is executed void govoid inta0 intb0 intsum0 fora0sumlt10blt4aa2 sumab aa1 bba printfquota d b dnquot a b a 9 b 12 15 What is printed when the gohere function is executed void goherevoid int X 7 int y 2 printfquotAns dnquot X y 10 16 Considerthe following initializations intx 1000 b 8 int d ampa Explain what types are the different variables and what are their values intis just an integer The location associated with X has 1000 stored in it and the value associated with b has 8 stored in it int is a pointer to an integer The location associated with d has a memory location stored in it and thatmemory location is the one associated with aThe operation is an indirection to the value contained in a s memory location 17 How does switch statement work Can I have nested switch Is the following valid Assume types is a valid variable with a valid value switchtypes case 1 case 3 case 5 printf hello break case 6 return It will work all cases 1 3 and 5 will lead to the printf 18 Give an example when nested for loops may be used If you need to loop over a two dimensional matrix you would have one loop to check every row then for every row you would need a loop to check every column in that row 19 lfl have a whilek and k is initialized at 1000 what should be the limiting condition or the exit condition ofthe while loop The loop will execute as long as k is true When k becomes false the next time the loop checks the condition it will fail and quit The false condition is set when k becomes 0 20 What is nested ifelse Anything wrong with these a if i gt 100 printf Helloquot else printf Hi else printf Hey Wrong b if i gt 100 printf Helloquot if i 100 printf Warmquot else printf Cool Correct 21 What is wrong with the code snippet below main int k 1dsum0iCount while k dsum k printf dn dsum iCount iCount should be initialized to 0 lWl be an in nite loop 80 iCount ork should be set to an upper limit Since kis being incremented it will never become 0 for the loop to exit 22 Review this code Any bugs Ifyes correct them by writing the correct C statements 2 points The purpose of this program is to calculate the sum of given real numbers The function cacuateSum takes the real array as input computes the sum and then returns the corresponding realvalued sum back to the main function includeltstdiohgt de ne sizeA 4 main oat mySum oat myNumssizeA 105 125 167 185 mySum cacuateSumampmyNums printf The array sum is f n mySum oat cacuateSumtempSum oat sumVaI fori0iltsizeAi sumVaI tempSumi Correct code is below includeltstdiohgt de ne sizeA 4 main oat mySum oat myNumssizeA 105 12 5 167 18 5 mySum calculateSummyNums no amp required printf The array sum is f n mySum oat calculateSumtempSum oat sumVal 0 sumVal has to be initialized to 0 int i i was not de ned fori0iltsizeAi sumVal tempSumi return sumVal return value required 23 I wanted to read 50 integers from a le I quickly write this program But this program does not work I realize that there are errors You can assume that there is a le called myFoo and it has 50 integers in it Please correct it includeltstdiohgt includeltstdlibhgt main FILE n int a50 int i Ok i f n fopenquotmyFooquot quot r quot 1 printf quotFile Not Foundnquot exit 0 whilefscanf n quotd ai 0 i for k0klti k printf quotdnquot ak fclose f in Corrected Program includeltstdiohgt includeltstdlibhgt main FILE n int a50 inti 0k if n fopenquotmyFooquot quot r quot 0 check against 0 printf quotFile Not Foundnquot exit 0 whilefscanf n d ampai 1 read until valid and since reading to an individual array element use amp i for k0klti k printf quotdnquot ak fclose n


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."


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

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.