
-----------------------------------
asdfasdf123
Thu Nov 27, 2014 12:34 pm

Square roots
-----------------------------------
What is it you are trying to achieve?
I'm trying to finish an assignment.


What is the problem you are having?
How would I do this?
"Write a program that asks the user to enter a positive integer.  The program determines whether the square root of the integer entered is an integer.  If the square root is an integer, display the value of the square root, otherwise display ?the square root is not an integer?.  Your program may NOT use a fractional exponent or the built?in Turing square root (sqrt) function."


Describe what you have tried to solve this problem



Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)








Please specify what version of Turing you are using
4.1 Version 1.0.1

-----------------------------------
Tony
Thu Nov 27, 2014 3:46 pm

Re: Square roots
-----------------------------------
I'm trying to finish an assignment.
How much of the assignment do you have done? What do you have left to do?

It would be helpful to express the problem in your own words, simply to encourage yourself to understand the question well enough to do so. The followup will be "what is the first step?" which should really be read as "what part can you do right now?".

Getting user's input could be a good place to start. You can then even prototype the output part, if you have a placeholder for the middle (e.g. pretend that only 9 is a number with a square root).

-----------------------------------
asdfasdf123
Fri Nov 28, 2014 12:00 pm

Re: Square roots
-----------------------------------
I can't figure out how to find the square root of the user's input without using fractional exponents or the sqrt function, and I don't know how to determine whether or not it's an integer.

-----------------------------------
DemonWasp
Fri Nov 28, 2014 12:37 pm

RE:Square roots
-----------------------------------
You don't have to do that. Try looking at the problem backwards: if you have ONLY multiplication and for-loops, how can you figure out whether a number is a square of an integer?

Hint: you can easily compute the square of a number using only multiplication.
