CodeGym /Courses /Java Syntax /Tasks with and without asterisks

Tasks with and without asterisks

Java Syntax
Level 4 , Lesson 16
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."

Comments (58)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
NebraskaBigFoot Level 5, United States
23 May 2025
"They were specially designed for IntelliJ IDEA" but we don't install IntelliJ IDEA until level 5 lesson 3?
nealgoogs Level 21, Eliot, United States
19 August 2024
you can use break in the last question.
Donkasking Level 6, United States
7 August 2024
That last one was a doozy! For future challengers, the placement of where you parse your integers matters!
Chris Christi Level 6
6 June 2024
8 attempts?!! OMG, am I too thick to be a Java developer?!!!
tri bui Level 7, Saigon, Viet Nam
28 May 2024
lesson learn: "read you test carefully!"
Luke Level 5, Saint Paul, United States
19 February 2024
Codegym you think you're sooooo smart making us include -1 in the summation ;)
Rather Be Coding Level 14, Detroit, United States
26 August 2023
So, you want to add -1 as well? Strange if we're breaking when that is entered.
Reganralph Level 6, DORTMUND, Germany
15 June 2022
int b = 0; while (true){ int a = Integer.parseInt(bb.readLine()); if (a<=-1){ b = b+a; System.out.println(b); break; } b=b+a; } please cna i get help as to why this SAYS Be sure that the program works correctly with negative numbers.
rags 3 Level 5, Wichita, United States Expert
5 July 2023
you need your if statement farther down i think below b+a
Ali_Alshehri Level 6, Saudi Arabia
19 May 2022
I use bubble sort algo to order number and then print the middle one
tri bui Level 7, Saigon, Viet Nam
28 May 2024
calm down bro. we have not learn bubble sort yet
Romant Level 15, Russia, Russian Federation
17 April 2022
Hi guys! To my mind, the Best way of learning the Codegym course is following. (1) Solve tasks by your own, using the Codegym help section, comments, or even web search - its really ok! Get used to it. (2) After you Verified a task, Download correct solution. >> Push the Help button in the task menu. (3) Correct your own solution in efficient and short way. Actually, it was the best way to correct my code and understand it. Sometimes I had Bullshit-code, dont know how it worked %)))))