Question: I need help on problem 3 and 4 could you please do it in java for me Problem 3 : Employee Salary Calculator Complete the
I need help on problem and could you please do it in java for me
Problem : Employee Salary Calculator
Complete the following program to determine the raise and new Salary for an employee by adding if else statements to compute the raise. The
input to the program includes the current annual salary for the employee and a number indicating the performance rating excellent, good,
and poor An employee with a rating of will receive a raise, an employee with a rating of will receive a raise, and one with a rating of
will receive a raise.
Salary.java
Computes the raise and new salary for an employee
import java.util.Scanner;
public class Salary
f
public static void main String args
double currentSalary; current annual salary
double rating; performance rating
double raise; dollar amount of the raise
I
Scanner scan new ScannerSystemin;
Get the current salary and performance rating
System.out.print Enter the current salary: ;
currentSalary scan. nextDouble;
System.out.print Enter the performance rating: ;
rating scan.nextDouble;
Compute the raise Use if else
Print the results
System.out.println Amount of your raise: $ raise;
System.out.println Your new salary: $currentSalary raise;
Problem : Powers of File PowersOfjava contains a skeleton of a program to read in an integer from the user and print out that many powers of
starting with
a Here are the first powers of :
b Modify the program so that instead of just printing y powers, you print which power each is eg: Here are the first powers of :
PowersOfjava
Print out as many powers of as the user requests
import java.util.Scanner;
public class Powersof
public static void mainString args
int numPowersOf; How many powers of to compute
int nextPowerOf; Current power of
int exponent; Exponent for current power of this
also serves as a counter for the loop
Scanner scan new ScannerSystemin;
System.out.print How many powers of would you like printed? ;
numPowersOf scan.nextInt;
Print a message saying how many powers of will be printed
Initialize exponent the first thing printed is to the what?
while
Print out current power of
Find next power of how do you get this from the last one?
Increment exponent
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
