+ 4

How do i complete this assignment? Name:(HR Budget) Found in primitive operators basics java.

/* Basically i can answer one part of the questions(Test1,2,3) at a time. Each have different values or "Employee Salaries". My problem is that i cant figure out how to answer them all at the same time(If that's what im supposed to do?) I tried continuing the code with no prevail. Forgot to mention they want me to use scanner aswell like below. When I try to start test 2 after test 1 it basically starts giving me errors and i cant figure it out. Thank you in advance! */ import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int salaryFirstEmployee = 1500; scanner.nextInt(); int salarySecondEmployee = 3200; scanner.nextInt(); var totalSum = salaryFirstEmployee + salarySecondEmployee; System.out.println(totalSum); } }

22nd Oct 2020, 7:02 PM
KnowledgeIsPower
KnowledgeIsPower - avatar
2 Answers
0
Use scanner to get input: int salaryFirstEmployee = scanner.nextInt(); int salarySecondEmployee = scanner.nextInt(); https://www.sololearn.com/learn/Java/2220/ Lykewize You are welcome 😃 Don't feel bad. We all have been there too. Happy learning!
22nd Oct 2020, 7:17 PM
Kevin ★
+ 1
Thank you very much! I feel so stupid 😂
23rd Oct 2020, 12:33 AM
KnowledgeIsPower
KnowledgeIsPower - avatar