I need to update this java program to take input about each employee from a file and write their information and salary/pay information to a file. use input file
payroll.txt
Kevin
Yang
60
20
Trey
Adams
30
15
Rick
Johnson
45
10
Cynthia
Wheeler
55
11.50
Sarah
Davis
24
10
Muhammad
Rabish
66
12
Dale
Allen
11
18
Andrew
Jimenez
80
15
import java.util.Scanner;
public class SalaryCalcLoop
{
double Rpay = 0, Opay = 0;
void calPay(double hours, double rate) {
if (hours <= 40)
{
Rpay = hours * rate;
Opay = 0;
}
else
{
double Rhr, Ohr;
Rhr = 40;
Ohr = hours - Rhr;
Rpay = Rhr * rate;
Opay = Ohr * (1.5 * rate);
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String name;
int shift = 0;
Double rate, hours;
System.out.println("Pay Calculator");
String ch = "";
do
{
System.out.println("Enter Your Name");
name = sc.next();
System.out.println("Enter Your Shift, Enter 0 for Day, Enterv1 for
Night");
System.out.println("0=Day, 1= Night");
shift=sc.nextInt();
System.out.println("Enter Number of Hours Worked");
hours = sc.nextDouble();
System.out.println("Enter Hourly Pay");
rate = sc.nextDouble();
SalaryCalc c = new SalaryCalc();
c.calPay(hours, rate);
Double Tpay = c.Rpay + c.Opay;
System.out.println();
System.out.println("Calculate Pay");
System.out.println("Employee Name: " + name);
System.out.println("Employee Regular Pay: " + c.Rpay);
System.out.println("Employee Overtime Pay: " + c.Opay);
System.out.println("Employee Total Pay: " + Tpay);
if (shift == 0)
{
System.out.println("Employee PayPeriod is Friday");
}
else
{
System.out.println("Employee PayPeriod is Saturday");
}
System.out.println("Press Y to continue. Press any other key to
exit ");
ch=sc.next();
}
while(ch.equalsIgnoreCase("y"));
}
}
Saturday"); } System.out.println("Press Y to continue. Press any other key to exit "); ch=sc.next(); } while(ch.equalsIgnoreCase("y")); } }
In: Computer Science
I need to update this java program to take input about each employee from a file and write their information and salary/pay information to a file. use input file
payroll.txt
import java.util.Scanner;
public class SalaryCalcLoop
{
double Rpay = 0, Opay = 0;
void calPay(double hours, double rate) {
if (hours <= 40)
{
Rpay = hours * rate;
Opay = 0;
}
else
{
double Rhr, Ohr;
Rhr = 40;
Ohr = hours - Rhr;
Rpay = Rhr * rate;
Opay = Ohr * (1.5 * rate);
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String name;
int shift = 0;
Double rate, hours;
System.out.println("Pay Calculator");
String ch = "";
do
{
System.out.println("Enter Your Name");
name = sc.next();
System.out.println("Enter Your Shift, Enter 0 for Day, Enterv1 for
Night");
System.out.println("0=Day, 1= Night");
shift=sc.nextInt();
System.out.println("Enter Number of Hours Worked");
hours = sc.nextDouble();
System.out.println("Enter Hourly Pay");
rate = sc.nextDouble();
SalaryCalc c = new SalaryCalc();
c.calPay(hours, rate);
Double Tpay = c.Rpay + c.Opay;
System.out.println();
System.out.println("Calculate Pay");
System.out.println("Employee Name: " + name);
System.out.println("Employee Regular Pay: " + c.Rpay);
System.out.println("Employee Overtime Pay: " + c.Opay);
System.out.println("Employee Total Pay: " + Tpay);
if (shift == 0)
{
System.out.println("Employee PayPeriod is Friday");
}
else
{
System.out.println("Employee PayPeriod is Saturday");
}
System.out.println("Press Y to continue. Press any other key to
exit ");
ch=sc.next();
}
while(ch.equalsIgnoreCase("y"));
}
}
Saturday"); } System.out.println("Press Y to continue. Press any other key to exit "); ch=sc.next(); } while(ch.equalsIgnoreCase("y")); } }
Payroll.txt
Kevin
Yang
60
20
Trey
Adams
30
15
Rick
Johnson
45
10
Cynthia
Wheeler
55
11.50
Sarah
Davis
24
10
Muhammad
Rabish
66
12
Dale
Allen
11
18
Andrew
Jimenez
80
15
In: Computer Science
JAVA question here, and thank you. I need ot update the following classes an fixme's on this.canvas = null etc.
Thanks!
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import edu.luc.etl.cs313.android.shapes.model.*;
/**
* A Visitor for drawing a shape to an Android canvas.
*/
public class Draw implements Visitor<Void> {
// TODO entirely your job (except onCircle)
private final Canvas canvas;
private final Paint paint;
public Draw(final Canvas canvas, final Paint paint) {
this.canvas = null; // FIXME
this.paint = null; // FIXME
paint.setStyle(Style.STROKE);
}
@Override
public Void onCircle(final Circle c) {
canvas.drawCircle(0, 0, c.getRadius(), paint);
return null;
}
@Override
public Void onStrokeColor(final StrokeColor c) {
return null;
}
@Override
public Void onFill(final Fill f) {
return null;
}
@Override
public Void onGroup(final Group g) {
return null;
}
@Override
public Void onLocation(final Location l) {
return null;
}
@Override
public Void onRectangle(final Rectangle r) {
return null;
}
@Override
public Void onOutline(Outline o) {
return null;
}
@Override
public Void onPolygon(final Polygon s) {
final float[] pts = null;
canvas.drawLines(pts, paint);
return null;
}
}
In: Computer Science
restrictive convenants of Lululemon such as non- competition , non- solicitation provision.
In: Economics
Calculate the following project, at cost of capital of 10%
| Years | Cash Flow (RM) |
| 0 | -10,000 |
| 1 | 2000 |
| 2 | 2000 |
| 3 | 4000 |
| 4 | 4000 |
| 5 | 5000 |
i) calculate NPV (8marks)
ii) calculate PI
iii) Justified should we accept or reject the project?
In: Finance
CO(g)+H2O(g)⇌CO2(g)+H2(g)
Kp=0.0611 at 2000 K
A reaction mixture initially contains a CO partial pressure of 1360
torr and a H2O partial pressure of 1768 torr at 2000
K.
Part A
Calculate the equilibrium partial pressure of CO2 and H2
? torr
In: Chemistry
Consider the following reaction:
CO(g)+H2O(g)⇌CO2(g)+H2(g)
Kp=0.0611 at 2000 K
A reaction mixture initially contains a CO partial pressure of 1390 torr and a H2O partial pressure of 1710 torr at 2000 K.
Calculate the equilibrium partial pressure of CO2.
In: Chemistry
PLEASE DONT COPY FROM INTERNET PLAGIRISM IS PROHIBITED
WRITE 2000 WORDS ON THE TOPIC.
TOPIC: INTERNATIONAL TRADE AND DYNAMIC OF UAE (REQUIRE 2000 WORDS)
1. Introduction of the topic
2. Review of literature
3. Data, methodology
4. Analysis & Findings of the study
5. Conclusion
6. Reference
In: Economics
Consider the following reaction: CO(g)+H2O(g)⇌CO2(g)+H2(g) Kp=0.0611 at 2000 K A reaction mixture initially contains a CO partial pressure of 1390 torr and a H2O partial pressure of 1770 torr at 2000 K.
A) Calculate the equilibrium partial pressure of CO2.
In: Chemistry
You just celebrated your 25th birthday today. You plan to invest $2000 annually, with the first $2000 invested on your 26th birthday and the last invested on your 60th birthday.
What is the value of this investment on your 61st birthday if all invested funds earn 6 percent annually?
In: Finance