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

Intro Prog&Prob Solving

by: Ashleigh Dare

Intro Prog&Prob Solving ECS 030

Ashleigh Dare
GPA 3.75

Vladimir Filkov

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

Vladimir Filkov
Class Notes
25 ?




Popular in Course

Popular in Engineering Computer Science

This 3 page Class Notes was uploaded by Ashleigh Dare on Tuesday September 8, 2015. The Class Notes belongs to ECS 030 at University of California - Davis taught by Vladimir Filkov in Fall. Since its upload, it has received 63 views. For similar materials see /class/187764/ecs-030-university-of-california-davis in Engineering Computer Science at University of California - Davis.

Similar to ECS 030 at UCD

Popular in Engineering Computer Science


Reviews for Intro Prog&Prob Solving


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: 09/08/15
ECS 30 Practice Midterm Key The questions in this document may have appeared in midterms in previous years when this class was taught by different instructors l N UNIX commands 9 ST 9 F 9 10 points You just printed something to printer hexus and nd that it s printing a bunch of garbage What are the steps you take to cancel the print job Use lpq Phexus to nd the of my printjob and then use lprm Phexus job to remove the job from the queue 5 points What UNIX command would you type to see a list of all of the les including the hidden les in directory hwl Is a hwl 5 points You just wrote and saved the le test2c Now you want to make sure that only you can read and write it What UNIX command would you type to make testc only readable and writeable by you chmod 600 testc or chmod g rw o rw testc 5 points You want to move all of your C source les ending in c and header les ending in h from your hwl subdirectory to your midl subdirectory What UNIX command shouldyou type mv hwlc hwlh midl 5 points You want to view the le test3c a screen at a time What UNIX command would you type more test3c 50 points Write a complete warningfree C program that lists all of the common factors of two positive integers The program will prompt the user for the two numbers and then list on one line all the factors that the numbers have in common A factor of a number divides into that number with a remainder of zero The program will continue to ask the user for more pairs of numbers until the rst number entered is zero Your prompts and formats should match that shown User input is in bold Please enter two positive integers 20 12 l 2 4 Please enter two positive integers 60 120 123456101215203060 Please enter two positive integers 8 9 1 Please enter two positive integers 0 230 Done W 5 15 points Consider the following recursive function What does the function do as whole Do not describe what each line does void pbint n if n 0 pbn 2 putchar 0 n 2 It prints out the binary representation ofn starting with the leftmost 1 For example if n 43 then pb would print 101011 20 points Assuming that abc and ans are ints and a is 2 b is 4 and c is 7 at the beginning of each statement write on the line the value of ans There are no syntaX errors in these statements 2ans247 23 47 22 ans a b 3C39 6ans 7 4 4 7 3 4 0 8 1ans 7 lt 8 ampamp 8 gt 6 4 4 ampamp 6 lt 8ans 4 4 7 gt 7 3 6 3 5 6 lt 5 7 25 points Given the following series of if statements provide the outputs for each X Note that more than one printf can be executed for each X if X gt 20 printf First quot else ifX ifX lt 5 printf Second else printf Third 0 printf Fourth else ifX 9 ifXlt 19 Xgt25 printf Fifth gt 5 ampamp X lt 22 printf sixth quot a 5 points X 0 iSecond Fifthii b 5 points X 5 iThird Fifth iii c 5 points X 17 iThird Fifth Sixthi d 5 points X 20 iThird Fourth Sixthi e 5 points X 28 iFirst Fifthi 10 points Given the following make le After I edit twoh when I type make which les will be changed by gcc two o one o whole out wholeout oneo twoo threeo gcc o wholeout oneo twoo threeo oneo oneo wholeh oneh twoh gcc c oneo twoo twoo twoh wholeh gcc c twoo three o three c three h gcc c three c 22 points Data representation a 8 points Provide the hexadecimal representation for the following int that is presented as a binary number 1100 1010 0101 1111 1000 1110 0111 1011 C A 5 F 8 E 7 B 1 point each b 8 points Provide the binary representation for the following int that is presented as a hexadecimal number to help the graders place a space between every four digits D9AC3E6B 1101 1001 1010 1100 0011 1110 0110 1011 each 1 point c 6 points Provide the decimal equivalent of the following unsigned char that is presented as a binary number 10101011 128 32 8 2 1 171


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

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Allison Fischer University of Alabama

"I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over $600 per month. I 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!"

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.