These two pictures are my resource and driver classes. Please, help me with the error in my resource class. I want my resource class to have getName, getSalary, getThePercentageThatTheEmployeeWantToRaise, and calculateTheNewSalary methods. For my driver class, I want the driver class to ask the user to input their name, salary, how much they want to raise, and print out their new salary.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

These two pictures are my resource and driver classes. Please, help me with the error in my resource class. I want my resource class to have getName, getSalary, getThePercentageThatTheEmployeeWantToRaise, and calculateTheNewSalary methods. For my driver class, I want the driver class to ask the user to input their name, salary, how much they want to raise, and print out their new salary. 

 

1 public class USE11R
2 {
String inputName;
String inputSalary;
String percentageRaise;
float raiseSalary;
public String getName ()
{
return inputName;
10
11
}
public void setName (String name)
12
13
{
this.inputName = name;
}
public String getSalary()
{
return inputSalary;
}
public void setSalary(String salary)
{
this.inputSalary - salary;
}
public String getRaisePercentage()
{
return percentageRaise;
}
public void setPercentageRaise(String raise)
{
this.percentageRaise = raise;
}
public void calculateNewSalary()
{
raiseSalary = inputSalary + inputSalary * percentageRaise / 100;
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
34
35
36
GU5E11R.java G U5E11D.java G U4P17.java
Compile Messages
JGRASP Messages
Run I/O
Interactions
| USE11R.java:35: error: bad operand types for binary operator **
raiseSalary = inputSalary + inputSalary * percentageRaise / 100;
Stop
Clear
first type: String
second type: String
Сорy
Transcribed Image Text:1 public class USE11R 2 { String inputName; String inputSalary; String percentageRaise; float raiseSalary; public String getName () { return inputName; 10 11 } public void setName (String name) 12 13 { this.inputName = name; } public String getSalary() { return inputSalary; } public void setSalary(String salary) { this.inputSalary - salary; } public String getRaisePercentage() { return percentageRaise; } public void setPercentageRaise(String raise) { this.percentageRaise = raise; } public void calculateNewSalary() { raiseSalary = inputSalary + inputSalary * percentageRaise / 100; 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 34 35 36 GU5E11R.java G U5E11D.java G U4P17.java Compile Messages JGRASP Messages Run I/O Interactions | USE11R.java:35: error: bad operand types for binary operator ** raiseSalary = inputSalary + inputSalary * percentageRaise / 100; Stop Clear first type: String second type: String Сорy
1 import java.util.*;
2 public class USE11D
3 {
public static void main (String[] args)
{
Scanner sc = new Scanner(System.in);
4
7
System.out.print("Please, enter your name: ");
String inputName = sc.nextline();
8.
10
11
12
System.out.print("Please, enter your salary: ");
String inputSalary = sc.nextline ();
13
14
15
System.out.print("Please, enter how many percent you want to raise your salary: ");
String percentageRaise = sc.nextLine();
16
17
18
USE11R resource = new U5E11R();
resource.setName (inputName);
resource.setSalary(inputSalary);
resource.calculateNewSalary();
}
19
20
21
22
23
24 }
25
Transcribed Image Text:1 import java.util.*; 2 public class USE11D 3 { public static void main (String[] args) { Scanner sc = new Scanner(System.in); 4 7 System.out.print("Please, enter your name: "); String inputName = sc.nextline(); 8. 10 11 12 System.out.print("Please, enter your salary: "); String inputSalary = sc.nextline (); 13 14 15 System.out.print("Please, enter how many percent you want to raise your salary: "); String percentageRaise = sc.nextLine(); 16 17 18 USE11R resource = new U5E11R(); resource.setName (inputName); resource.setSalary(inputSalary); resource.calculateNewSalary(); } 19 20 21 22 23 24 } 25
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Math class and its different methods
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education