Turing Assignment
Author |
Message |
MajorOp
|
|
|
|
|
Sponsor Sponsor
|
|
|
TokenHerbz
|
Posted: Tue Dec 14, 2010 9:50 am Post subject: RE:Turing Assignment |
|
|
No one will "DO" your code. If you put effort into attempting it, which you did not, People on this site will assist you into solving the problems you run in by explaining /teaching you about that problem.
...This post will be Deleted by a Mod in 3, 2, 1 ...
|
|
|
|
|
|
DemonWasp
|
Posted: Tue Dec 14, 2010 9:58 am Post subject: RE:Turing Assignment |
|
|
Nobody here does school assignments. You won't learn this way. Make an attempt first, describe what problems you're having, and we will help you work through those problems.
Problem 1 requires some input and two IF statements.
Problem 2 requires some input and one IF/ELSIF/ELSE statement.
Problem 3 requires some input, an IF statement and some very basic arithmetic (multiplication).
Problem 4 requires some input, a case statement and some addition.
Problem 5 requires four variables (minimum, maximum, total, number_of_numbers), a loop, an IF to determine when to exit, an IF to (possibly) update the minimum, another for the maximum, and some arithmetic to update the total. The average, computed after the loop, is just total / number_of_numbers.
Problem 6 requires a for loop and some floating-point math.
Problem 7 requires a loop and use of the mod and div operators. Consider this: what is (3456 mod 10)? How about (3456 div 10)? Think about how you might apply those questions several times to find the digits of 3456 one at a time.
Problem 8 requires you to write two small programs. The first will determine whether a given number, n, is prime. The easiest and most obvious way to do this it to check whether n is divisible by any number from 2 to n-1 (use the mod operator!). You should put your first program in a function. The second will go from a to b (or, b to a, depending on values) and check each number to determine whether it's prime or not, then output based on that.
|
|
|
|
|
|
MajorOp
|
Posted: Tue Dec 14, 2010 5:30 pm Post subject: Re: Turing Assignment |
|
|
I missed a few classes, the first assignment was easy; but this one involves things I haven't learned.
|
|
|
|
|
|
MajorOp
|
Posted: Tue Dec 14, 2010 5:34 pm Post subject: Re: Turing Assignment |
|
|
Thanks DemonWasp, I will work with the help you gave.
MajorOp
|
|
|
|
|
|
|
|