package com.codegym.task.task02.task0205;
/*
Pay raise
*/
public class Solution {
public static void main(String[] args) {
salary(7000);
}
public static void salary(int a) {
int salary;
salary=a+1000;
a=salary+1000;
System.out.println("Your salary is:"+a+"dollars per month.");
}
}
not able to pass all test cases
Under discussion
Comments (8)
- Popular
- New
- Old
You must be signed in to leave a comment
Muhammed Akthus
2 May 2020, 02:49
Just code this
System.out.println("Your salary is:" +" " +(a+1000)+" " + "dollars per month.");
0
Ali Zahid
17 July 2019, 18:20
Use this one.
System.out.println("Your salary is: "+(a+1000)+" dollars per month.");
and dont forget to add fullstop at the end..
0
Ashish Mishra
16 June 2019, 14:05
To all who are facing problem for last test case you need to print exact output in order to pass:
public class Solution {
public static void main(String[] args) {
hackSalary(7000);
}
public static void hackSalary(int a) {
//write your code here
a = a + 1000;
System.out.println("Your salary is: " +a+" dollars per month.");
}
}
Note : There has to be same spacing as shown in conditions , n has to be period '.' at the last of the line
0
VikramSingh2710
5 June 2019, 16:51
you don't need to write the 16th line you can just print the "salary" instead of printing "a"
+1
Khurram
11 September 2018, 05:53
1. your code is increasing the salary by 2000. Try to adjust it so that it increases only 1000.
2. Make sure the output is the same as in the question, including the given spaces etc.
+1
Jacqueline Lim
10 September 2018, 14:32
The output in the example is different from the given task.
In the example, a = 8000, while in the task, a = 7000.
Therefore, the output in the task should be "Your salary is: 8000 dollars per month."
Another hint: You may just call System.out.println in the salary method. In your case, I suggest that you remove the "int salary" part.
0
Himanshu Pal
10 September 2018, 12:48
a = a + 1000
so salary 7000 +1000+1000
and you need a code something like this a + 1000
0
World Expedition
10 September 2018, 14:08
That i have done before same problem occured in that so for simplication according to the question i tried this.
+1