Final tasks

New Java Syntax
Level 12 , Lesson 7
Available

"Hello, soldier!"

"Hello, Captain Squirrels, sir!"

"I have great news for you. Here are some exercises to reinforce your skills. Work on them every day, and your competence will grow exponentially. They were specially designed for IntelliJ IDEA."

12
Task
New Java Syntax, level 12, lesson 7
Locked
Correct answer: d = 2.941
A spaceship flew to planet of Paleo-Know, and met there creatures that didn't even know integer arithmetic. But this whole story has nothing to do with our task. It's only here as an amazing fact to get your attention. Meanwhile, you need to add one cast operation to the code and get the correct answer.
12
Task
New Java Syntax, level 12, lesson 7
Locked
Numbers and strings
The add method should add up the input arguments and return a string like this: a+b=sum For example, if you pass (7, 8) to the method, then it should return the string "7+8=15". But the method is not working properly at present. Your task is to fix it.
12
Task
New Java Syntax, level 12, lesson 7
Locked
But that's how I want it
Implement the toCustomString method so that it converts a Number to a String according to a specific type-dependent rule: - if the argument is a Byte object, then divide it by 2 and convert it to a string, adding the letter "b" at the end; - if the argument is an Integer object, then divide it by 3
12
Task
New Java Syntax, level 12, lesson 7
Locked
Human class constructors
People are different. And each person differs in significant ways. Suppose we have a newborn who has only a name and a mother. Or suppose we have a musician that prizes his band and his ability to perform. Let's write a Human class with 6 fields and come up with 10 different constructors for it. Each constructor should make sense.
12
Task
New Java Syntax, level 12, lesson 7
Locked
Use the fewest number of static modifiers
"Fewest statics, maximum result" is the motto for your next task. It will require you to analyze code already written by some good soul, and understand where this kind person forgot to put static modifiers. The code won't compile. But don't stick them everywhere. Try to use them as little as possible.
12
Task
New Java Syntax, level 12, lesson 7
Locked
Task about algorithms
We received a new children's assignment from the ordered isomorphs on Planet Linear Chaos. You remember that it was these weirdos who thought up all sorts of sorting techniques and constantly practice them. That's why these tasks are so strange. Check it out: read 30 numbers from the keyboard. Display the 10th and 11th smallest numbers. But, you know, you've got to try it!

"Those previous exercises were for rookies. I've added some more advanced bonus exercises for the old-timers. Just for veterans."

Comments (41)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
abhishe_kira Level 18, India Expert
23 June 2023
at the beginning of the CodeGym course I was afraid of tasks, But now I'm loving it.
Fadhil Radhian Level 18, Semarang, Indonesia
24 March 2023
thanks for the tasks
AmirMasoud Level 26, Seattle, United States
18 January 2022
I enjoyed a lot solving these tasks hope you too
MsebaF Level 10, San Luis, Argentina
16 January 2022
I did it! I resolved number of letters on my own and i like my solution, the I downloaded codegym's to compare (generaly i do that to see alternatives)... the thing is I don't quite get CG's solution.
Michael Level 10, España
8 September 2021
Done, But why can't I see the following Java Core lessons? Maybe they can only be seen with the paid subscription?
Ozkin Level 25, Colombia Expert
17 November 2022
can you see the Java Core lessons?
Anonymous #11267629 (Anouk) Level 27, Netherlands Expert
25 April 2023
Hi, I have the same question. How can I get the Java Core lessons?
Naughtless Level 41, Olympus Mons, Mars
2 June 2021
Well, here we are people, at the end of Java Syntax. Let this be a milestone for each and everyone who made it.
DarthGizka Level 24, Wittenberg, Germany
31 May 2021
task1018 (Corrections are needed) caveat: the task has to following undocumented requirements: * "The solution must have an Integer variable index" * "The solution must have a String variable name" These variables are completely superfluous, as is the use of an instance variable for the map instead of a local variable. They aren't even useful for creating conflicts that need to be resolved by judicious qualification, since local variables (including parameters) always take precedence. Go figure. Good thing I'm through with this ... it took me almost a whole week (while working full-time, though, so I wasn't exactly slacking).
ImDevin Level 15, Old Town, United States
19 May 2021
Finally, done with the Syntax. took me 2 months. Whew!!! Wonder what kind of challenges JavaCore will have in store. Gonna have to go back to review some of the tough tasks in the Syntax for review, so I don't forget how to do them. For those who are moving on to Core, good luck. Happy coding! :)
Sinisa Level 11, Banja Luka, Bosnia and Herzegovina
29 March 2021
It is more important to have a picture in your mind how the algorithm should look like. If you do that, you will eventually come up with a solution. There is of course matter of language limitations, ie., things that JVM will not allow you to do. Syntax comes at the last place. Whereas if you don't know how to start, other things are certainly irrelevant. Since I came to Java from Python, I've made comparisons from the very start of this course. Java is more complicated (verbose and harder on syntax), not to mention everything is an object mindset. However I have it on my studies' syllabus so I'm kinda forced to learn it.
Jurij Thmsn Level 29, Flensburg, Germany
7 February 2021
Enjoyed these Exercises 🦍 goodbye level 10