Page 1 of 1
Homework 5, due October 16, 2008.
Posted: Mon Oct 13, 2008 9:51 am
by goodwine
Reading: Chapter 5 from the course text.
Individual Problem: Complete the
exam and correct any mistakes you think you may have made. Also do the "extra credit" problem. In this homework both problems are required and are worth the same credit. If you think you got the exam completely correct, then submitting the same thing is o.k., but please submit it again.
Re: Homework 5, due October 16, 2008.
Posted: Mon Oct 13, 2008 5:10 pm
by jcorona
Re: Homework 5, due October 16, 2008.
Posted: Mon Oct 13, 2008 5:20 pm
by rcasiano
I have a problem with my variables pertaining to the input value of the number of decimals. I defined my variable(prec1) as the amount of decimals(ranging from one to six), then I made another variable(prec2) with is 10^(-prec1). My problem is that I defined prec1 as an integer and prec2 as a real number so when I do my if statement to check the decimal places to kick out of the do loop, my prec2 is calculated as zero. The problem is the conflict of real and integer numbers and my program works only when I set BOTH equal to real numbers, but this doesn't make sense because one cannot have a decimal place of 4.532 etc., only a decimal place of an integer. My only option to fix this is to do if statements to see if the real number entered was between a certain range(like >1 and <1.5 for example), then redefine it in accordance with that range(one in this example but still being a real number of course),THEN use newly "calculated" value as my decimal place to obtain my second variable(prec2 which is 10^-prec1), and finally use prec2 in my if statement inside my do loop to check for the level of precision defined by the user. Is this absolutely necessary or am I just nitpicking?
Re: Homework 5, due October 16, 2008.
Posted: Mon Oct 13, 2008 10:41 pm
by ngeraci
Nicholas Geraci
AME 20214 HW 5
Exam 1
prog1.f
prog2.f
Re: Homework 5, due October 16, 2008.
Posted: Tue Oct 14, 2008 10:30 am
by satkinso
Homework 5:
problem one prog1.f
"extra credit" prog2.f
Re: Homework 5, due October 16, 2008.
Posted: Tue Oct 14, 2008 3:49 pm
by pranade
Piyush Ranade
Attachment: Program with the extra credit portion within the code.
Re: Homework 5, due October 16, 2008.
Posted: Wed Oct 15, 2008 4:53 pm
by ereinecc
Homework 5
Re: Homework 5, due October 16, 2008.
Posted: Wed Oct 15, 2008 5:05 pm
by goodwine
rcasiano wrote:I have a problem with my variables pertaining to the input value of the number of decimals. I defined my variable(prec1) as the amount of decimals(ranging from one to six), then I made another variable(prec2) with is 10^(-prec1). My problem is that I defined prec1 as an integer and prec2 as a real number so when I do my if statement to check the decimal places to kick out of the do loop, my prec2 is calculated as zero. The problem is the conflict of real and integer numbers and my program works only when I set BOTH equal to real numbers, but this doesn't make sense because one cannot have a decimal place of 4.532 etc., only a decimal place of an integer. My only option to fix this is to do if statements to see if the real number entered was between a certain range(like >1 and <1.5 for example), then redefine it in accordance with that range(one in this example but still being a real number of course),THEN use newly "calculated" value as my decimal place to obtain my second variable(prec2 which is 10^-prec1), and finally use prec2 in my if statement inside my do loop to check for the level of precision defined by the user. Is this absolutely necessary or am I just nitpicking?
Have you resolved this? I'm sorry I didn't see it sooner. I don't immediately see why prec2 would evaluate to zero.
Re: Homework 5, due October 16, 2008.
Posted: Wed Oct 15, 2008 8:37 pm
by jhollan3
Jonathan Holland
prog1.f
prog2.f
Re: Homework 5, due October 16, 2008.
Posted: Thu Oct 16, 2008 6:19 pm
by kbeltran
Homework 5
Thanks!
Katherine Beltran