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

Scientific Computing

by: Viviane Windler

Scientific Computing ACMS 20210

Viviane Windler
GPA 3.76

Yongtao Zhang

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

Yongtao Zhang
Class Notes
25 ?




Popular in Course

Popular in Applied Mathematics

This 0 page Class Notes was uploaded by Viviane Windler on Sunday November 1, 2015. The Class Notes belongs to ACMS 20210 at University of Notre Dame taught by Yongtao Zhang in Fall. Since its upload, it has received 16 views. For similar materials see /class/232702/acms-20210-university-of-notre-dame in Applied Mathematics at University of Notre Dame.


Reviews for Scientific Computing


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
Practice problems set Test yourself and review 1 Write the output ofthe following code include ltiostreamgt using namespace std int main int iptr jptr i iptr new int jptr new int3 double dptr dptr new doube6 iptr 7 cout ltlt iptr ltlt ltlt jptr ltlt endl fori0 ilt6 i dPtri 5 fori0 ilt6 i cout ltlt dptr ltlt 39 39 dptr dptr 1 cout ltlt endl fori0 ilt6 i cout ltlt dptri ltlt 39 39 return 0 2 Give the output of the following code include ltiostreamgt using namespace std int main int sum kij int x44 1 2 3 4 5 6 7 8 9 8 7 3 2 1 7 1 sum 0 for int i1 ilt3 i for int j0 jlt3 i ifxi gt xi1U sum cout ltlt sum ltlt endl return 0 3 The following declaration is made inta1112131415 int b5 pa Which of the following assignments are illegal a pb d p p3 e p ampb 0 p a8 9 ampb p2 i 33 P 4 This program is supposed to print various messages depending on the temperatures entered by a user There are many errors in the code Please correct all of them using the line below the code include ltiostreamgt using namespace std int main double temp cout ltlt Enterthe temperature in Fahrenheit ltlt endl cin gtgttemp iftemplt32 cout ltlt It is freezing ltlt endl else if 32 lt temp lt 59 cout ltlt It is not bad ltlt endl else if 59 lt temp lt 80 cout ltlt It is nice ltlt endl ese cout ltlt It is hot ltlt endl return 0 5 Give the output of the following program include ltiostreamgt using namespace std int f1 intamp int intmain inta1b3c5 cout ltlt 3 ltlt 3 ltlt 1 ltlt b ltlt 1 c ltlt c ltlt endl c f1a b cout ltlt 3 ltlt 3 ltlt 1 ltlt b ltlt 1 c ltlt c ltlt endl a1b3c5 a b c f1a b cout ltlt 3 ltlt 3 ltlt 1 ltlt b ltlt 1 c ltlt c ltlt endl return 0 int f1 int amp p int q p 10 q 20 return pq Practice problems set ll Test yourself and review 1 The following declarations are made double a 35 b 16 int k 6 m 5 Determine which of the following statements return a false and which return a true mamalt2m m Hmagtkm kgt4agtamp magtmmwzm 5 a gt double mk 120 2 Which ofthe following are a valid declaration of a function that returns nothing and has two double variables a void fdouble double b double X y void fX y c void fdouble X double y d fdouble X double y e void fdouble ampX double ampy 3 Complete the function named f2 that takesthree variables an integer array the length of the array and an integer M The function f2 will return nothing If M is smaller than all elements in the array do nothing OthenNise replace the rst smallest number in the array by M include ltiostreamgt using namespace std void f2int int int int main intj k int a9 2 2 3 7 5 6 4 8 9 cout ltlt Enter a number ltlt endl cin gtgt k f2a 9 k for i0 ilt9 i cout ltlt ai ltlt cout ltlt endl return 0 void f2int a int length int M int min aO int minoffset 0 return 4 Suppose that the address ofthe first element ofarray u is 0bef5e280 Give the output of the following program include ltiostreamgt using namespace std int main int u 1 2 3 4 5 6 7 8 ip k ip u 2 cout ltlt ip ltlt ltlt ip2 ltlt endl cout ltlt u ltlt ltlt u1 ltlt endl for int j0 jlt8 j2 kj cout ltlt juk ltlt endl return 0 5 Suppose we have some function whose code begins with the following declarations and initializations int ix1 iy2 int ipampix A lfthe next line reads pM what values do both ix and iy have B lfinstead ofA the next line reads W m what values do both ix and iy have C lfinstead ofA or B the next line reads iy0m what values do both ix and iy have


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

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

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.