CodeGym/Java Tasks/Pay raise

Pay raise

  • 3
  • Locked
It's good to be a programmer: your salary will grow rapidly. And if this doesn't happen, you can influence the situation with a little help from your hacker friends. Imagine that you have access to the automated payroll system. You need to write an interceptor method that will add $1000 to each salary payment.
You can't complete this task, because you're not signed in.
Comments (83)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
ak
Level 4 , Bangalore, India
9 September 2025, 04:58
a = a + 1000; System.out.println("Your salary is: " + a + " dollars per month.");
Elhestia
Level 1 , Madrid, Spain
2 September 2023, 19:46
Hint: + (a+1000) +
codewoman Frontend Developer
12 September 2022, 21:50
Oh my god, I've been here for 15 minutes, and you know where I was going wrong? instead of typing "per month" I was typing "*fer* month" and then it was just the last step haha ​​and when I changed f = p everything went baadumpiti in my head... and sorry for my english :p but is really funny when you recognize your error in the code, and i wanted share this 😆😆
Anonymous #10762391
Level 2 , Germany
25 August 2021, 12:51
In the hackSalary method, create a new integer called x which adds 1000 to int a (salary). Then in the same method, print the ("required text but include " + yourNewInteger + "in the argument.") Don't forget correct punctuation :O
Jose Luis
Level 2 , Benito Juarez
31 May 2021, 18:43
In the hackSalary method you should include one line with the output, with the text required, inserting your operation and finishing wit the other text required. Just concatenate these wit symbol '+'
Eros nullfeathers
Level 4 , Salt Lake City, United States
18 March 2021, 07:21
It took 32 tries to realize that it didn't want println, it wanted print lol
Rica
Level 3 , Manchester, United States
11 April 2021, 17:38
Lord...thank you. Extremely fickle.
Tim Gorman
Level 3 , Canada
7 March 2021, 17:34
Couldn't work this out when I thought that it was correct. Had to get help and I'd missed the " : " got to read these questions better, silly mistake again.
Leonard
Level 3 , Stuttgart, Germany
16 January 2021, 12:30
Uh noo, I didn't see my mistake for a soooo long time: It was just "...per months."
Java_Mooood
Level 3 , San Antonio, United States
12 October 2020, 18:01
Add print statement to hackSalary method and inside it concatenate a +1000
chan kenneth
Level 7 , Hong Kong, Hong Kong
21 January 2021, 08:07
how ? i added System.out.println and i also don't get anything
mastere
Level 9 , Rochester, United States
25 September 2020, 04:55
I tried it 17 times even though I nearly had it right the first time. I was wondering what was wrong every time I would change something a little. Then it hit me! I forgot the Colon " : " after the " is " in the string. Your salary is: 8000 dollars per month. I kept putting it like this "Your salary is " Instead of like this "Your salary is: " If you got it wrong just check it over again in detail to make sure you did not miss anything like I did the first few times. Even a missing colon " : " can mess you up on this one.