Square of a number

  • 5
  • Locked
There are several ways to square a number. For example, some people write a number and then draw a square around it. This method is used by people who haven't studied anywhere. Everybody else has to multiply, remember the table of squares, ... or use a program. Your program should display the square of 5.
You can't complete this task, because you're not signed in.
Comments (41)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Level 8 , Scottsdale, United States
16 September 2021, 04:49
This kinda came out of nowhere ! lol --- a Method is a function in JAVA that is in a Class performing some actions. See the int a defined in the function name defined as int sqr ? that's pretty much a variable known as a - reusable - Parameter. The function is launched --or called- to do something -- above it -- and "passes in" the argument which is 5. The 5 aligns with that variable int a; and it doesn't need to be defined nor assigned separately. This is huge to understand in all programming languages. and it's fuzzy to begin with ... if this is wrong or confusing please help clarify it genius's
Level 3 , Austin, United States
20 July 2021, 22:59
I don't really understand this one yet.
Ms. Anonymous
Level 2
2 August 2021, 20:02
Me, too. I do feel the design of this task can be improved.
Level 3 , Mount Laurel, United States
15 April 2021, 20:51
I would like to be able to verify multiple solutions! I found one way to do it, but would like to try other ways. Because it is already completed it wont reverify!
Ernestas Salna
Level 3 , Vilnius, Lithuania
3 March 2021, 11:25
This was shown in previous lessons. If you read and study the presented material, you will see the pattern.
Jenna Bakonyi
Level 2 , Saint Louis, United States
29 December 2020, 17:46
Once again I am a beginner to this and it has not been taught how to write square. This should be something taught prior to expecting us to do it.
Raluca Mancu
Level 3 , Zürich, Switzerland
21 January 2021, 22:22
I am with you. I am stuck with these two last ones ;(
Edewor Abraham
Level 3 , warri, Nigeria
16 September 2020, 13:10
my first try took forever to load i guess the compiler was like " what in the actual hepp"
Level 8 , Milan, Italy
12 May 2020, 13:02
if you read the main instructions for the course/site you will see that some lessons are marked as "future", as this one is. this means that it contains material that has not been shown yet and you will have to figure it out yourself or do a little research to get the answer. they can be skipped and only to serve as a challenge for those who want to push themselves a bit further.
Level 6 , Germany
10 June 2020, 02:40
To anybody out there, this advice is in need to be taken wholeheartedly, should you not want to be discouraged or feel any remorse towards codegym.
Level 4 , Portland, United States
2 May 2020, 21:46
This was never taught. Isn't this a teaching program? I had no idea what to put in the println as a return value...very confusing. I was initializing a and had no idea what the return did. They explain the easy stuff ad nauseum and when it comes to this they drop the ball. When did we learn about return in a method?
Level 8 , Scottsdale, United States
16 September 2021, 04:52
Agree ! Code Gym is pretty cool and they look at all these comments to make it better ! I think they toss things out that are not covered yet as a wake up technique lol This topic will be explained in detail soon. let it ride for now !
Level 2 , Hammond, United States
11 April 2020, 08:03
This program should be removed or at least talked about at some point.
Level 2 , Hammond, United States
11 April 2020, 07:56
We never went over sqt, did we?