undefined

Practice calling methods

Java Syntax
Level 2 , Lesson 8
Available

"Hi, Amigo. I’d like to give you a couple of tasks:"

undefined
7
Task
Java Syntax, level 2, lesson 8
Locked
Minimum of two numbers
Someone is younger, someone else is older. Someone is taller, someone else is shorter. In programming, searching for smaller and larger values is just as important as in the real world. Of course, programming is the real world, right? Let's write a method that compares two integers and returns the minimum.
undefined
7
Task
Java Syntax, level 2, lesson 8
Locked
Minimum of three numbers
"Don't compare me with others!" she cried. But comparisons are unavoidable in this world. Especially in programming. Let's take three numbers, look at them, and figure out which one is the smallest. We'll do this using a program, more precisely, a special min method that calculates which number is smaller than the other two.
undefined
7
Task
Java Syntax, level 2, lesson 8
Locked
Minimum of four numbers
Four tired cowboys sat in a room. Each of them has to draw a number out of a pot. Whoever of the four draws the smallest number has to go fetch some whiskey. Help these guys determine who has to go. Find the minimum of the four numbers.
undefined
1
Task
Java Syntax, level 2, lesson 8
Locked
Repetition is the mother of all learning
In a secret data center, an Agent with three pairs of eyes sits. His brain is built in such a way that he can only perceive what he reads as phrases repeated three times, each time on a new line. Let's help the Agent and send him a message in a format he'll understand. To do this, let's implement the print3 method.
undefined
1
Task
Java Syntax, level 2, lesson 8
Locked
Print three times
I do not repeat do not repeat do not repeat in threes in threes in threes. Based on this first sentence, have you already guessed what your task is? If not, here it is: implement the print3 method so that it displays the passed string or word three times on the same line. Don't forget to separate all the words with spaces.
undefined
1
Task
Java Syntax, level 2, lesson 8
Locked
Even to the moon!
Programmers often move from place to place, but only if they want to. That's why they love converters so much. Well, maybe that's not why. Still, we will practice writing them. Now imagine that you have to work at a particular location: the Moon. Let's implement a method that converts your Earth weight to your lunar weight.
Comments (144)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Daniel Lungu Level 3 Seattle United States
2 May 2021
Please somebody explain how "I love you!" is related to s?
BoluwajiPeters Level 4 Vacuum. Nigeria
15 February 2021
I'm still having a hard time understanding the concepts of methods and calling methods. What exactly is it about? And about the epic tasks, I just check the solution and move on. I don't even understand the solutions.
Mike Bayley Level 3 Fishponds United Kingdom
10 February 2021
Top-Tip: After you complete the task successfully, click on Help > Download Correct Solution. It will give you inspiration of what your code could be in it's best form. If your code doesn't change then, bonus!
J.Mestan Level 4 Mainz Germany
31 December 2020
Is it normal if I can't do these epic tasks?
Brandon Foust Level 4 Austin United States
16 December 2020
How does this even make sense? public class Solution { public static void print3(String s) { System.out.print(s + " "); System.out.print(s + " "); System.out.println(s); } public static void main(String[] args) { print3("window"); print3("file"); } window window window file file file ----------------- If (s) is = to print3, then how does the above work? My brain: print(s + " ") = windowfile + space not "window file" and println(s) = windowfile yet somehow it is able to type window window window file file file. ???
Mihai Bone Level 8 Bucharest Romania
25 September 2020
Don't play with Epic ones if you are not prepared. ( joking but be ready to spend hours)
Noah Jones Level 4 Leesburg United States
22 September 2020
For the last exercise, it needs to be worded so that there are spaces needed between each of the words.
Kasia Level 22 Zabrze Poland
18 September 2020
Can anybody help to explain why it doesn't pass?
Kasia Level 22 Zabrze Poland
18 September 2020
the minimum three numbers exercise took any bit of my intelligence that I had _^_ (or any way I feel like that xD)
14 September 2020
I'm strugling calling the method in the 2nd exercise. My brain doens't have a clear step about what to do or where to go. Can somebody help me with a hint? Appreciate it :)