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.
Homework 5, due October 16, 2008.
-
- Site Admin
- Posts: 1596
- Joined: Tue Aug 24, 2004 4:54 pm
- Location: 376 Fitzpatrick
- Contact:
Homework 5, due October 16, 2008.
Bill Goodwine, 376 Fitzpatrick
Re: Homework 5, due October 16, 2008.
You do not have the required permissions to view the files attached to this post.
Re: Homework 5, due October 16, 2008.
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.
Nicholas Geraci
AME 20214 HW 5
Exam 1
prog1.f
prog2.f
AME 20214 HW 5
Exam 1
prog1.f
prog2.f
You do not have the required permissions to view the files attached to this post.
Re: Homework 5, due October 16, 2008.
Homework 5:
problem one prog1.f
"extra credit" prog2.f
problem one prog1.f
"extra credit" prog2.f
You do not have the required permissions to view the files attached to this post.
Re: Homework 5, due October 16, 2008.
Piyush Ranade
Attachment: Program with the extra credit portion within the code.
Attachment: Program with the extra credit portion within the code.
You do not have the required permissions to view the files attached to this post.
Re: Homework 5, due October 16, 2008.
Homework 5
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 1596
- Joined: Tue Aug 24, 2004 4:54 pm
- Location: 376 Fitzpatrick
- Contact:
Re: Homework 5, due October 16, 2008.
Have you resolved this? I'm sorry I didn't see it sooner. I don't immediately see why prec2 would evaluate to zero.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?
Bill Goodwine, 376 Fitzpatrick
Re: Homework 5, due October 16, 2008.
Jonathan Holland
prog1.f
prog2.f
prog1.f
prog2.f
You do not have the required permissions to view the files attached to this post.
Re: Homework 5, due October 16, 2008.
Homework 5
Thanks!
Katherine Beltran
Thanks!
Katherine Beltran
You do not have the required permissions to view the files attached to this post.