SlideShare una empresa de Scribd logo
1 de 2
Descargar para leer sin conexión
Can you please help fix Java code Thank you
import java.util.Scanner;
public class Overtime {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
String firstName;
System.out.println("Enter your first name:");
firstName = scnr.next();
System.out.print("Enter your last name: ");
String lastName = scnr.next();
System.out.print("Enter the number of hours you worked: ");
int hours = scnr.nextInt();
System.out.print("Enter your hourly pay rate: ");
double payRate = scnr.nextDouble();
double basePay;
double overtimePay = 0.0;
if (hours > 40) {
basePay = 40 * payRate;
overtimePay = (hours - 40) * payRate * 1.5;
} else {
basePay = hours * payRate;
}
double totalPay = basePay + overtimePay;
System.out.printf(firstName + " " + lastName + ", your pay is $%.1f%n", basePay+overtimePay
);
if (hours > 40) {
System.out.printf("Overtime accounts for $%.1f of that.%n", overtimePay);
}
if (hours > 70) {
System.out.println("You worked more than 70 hours. Your check may be delayed 3-4 business
days pending manager approval.");
}
}
}
2:Compare output Output differs. See highlights below. Input Your output ends with
Expectedoutput John Doe, your pay is $398.75 ends with overtime accounts for $108.75 of that.
Can you please help fix Java code Thank you   import java-util-Scanner.pdf

Más contenido relacionado

Similar a Can you please help fix Java code Thank you import java-util-Scanner.pdf

please help finish sorting methods- import java-util-Arrays- import ja.pdf
please help finish sorting methods- import java-util-Arrays- import ja.pdfplease help finish sorting methods- import java-util-Arrays- import ja.pdf
please help finish sorting methods- import java-util-Arrays- import ja.pdfanfenterprises
 
CODEimport java.util.; public class test { public static voi.pdf
CODEimport java.util.; public class test { public static voi.pdfCODEimport java.util.; public class test { public static voi.pdf
CODEimport java.util.; public class test { public static voi.pdfanurag1231
 
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdfimport java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdfadhityalapcare
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptxKimVeeL
 
JAVA PRACTICE QUESTIONS v1.4.pdf
JAVA PRACTICE QUESTIONS v1.4.pdfJAVA PRACTICE QUESTIONS v1.4.pdf
JAVA PRACTICE QUESTIONS v1.4.pdfRohitkumarYadav80
 
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 Problem1 java codeimport java.util.Scanner; Java code to pr.pdf Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
Problem1 java codeimport java.util.Scanner; Java code to pr.pdfanupamfootwear
 
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdfSumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdfankkitextailes
 
Write a Java ProgramSolutionAnswer- Code- import java-io--- import jav.docx
Write a Java ProgramSolutionAnswer- Code- import java-io--- import jav.docxWrite a Java ProgramSolutionAnswer- Code- import java-io--- import jav.docx
Write a Java ProgramSolutionAnswer- Code- import java-io--- import jav.docxlez31palka
 
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...Nithin Kumar,VVCE, Mysuru
 
The solution is as belowEmployeeDemo.javaimport java.util.Scann.pdf
The solution is as belowEmployeeDemo.javaimport java.util.Scann.pdfThe solution is as belowEmployeeDemo.javaimport java.util.Scann.pdf
The solution is as belowEmployeeDemo.javaimport java.util.Scann.pdfaparnatiwari291
 
import java.uti-WPS Office.docx
import java.uti-WPS Office.docximport java.uti-WPS Office.docx
import java.uti-WPS Office.docxKatecate1
 
Computer java programs
Computer java programsComputer java programs
Computer java programsADITYA BHARTI
 

Similar a Can you please help fix Java code Thank you import java-util-Scanner.pdf (14)

please help finish sorting methods- import java-util-Arrays- import ja.pdf
please help finish sorting methods- import java-util-Arrays- import ja.pdfplease help finish sorting methods- import java-util-Arrays- import ja.pdf
please help finish sorting methods- import java-util-Arrays- import ja.pdf
 
CODEimport java.util.; public class test { public static voi.pdf
CODEimport java.util.; public class test { public static voi.pdfCODEimport java.util.; public class test { public static voi.pdf
CODEimport java.util.; public class test { public static voi.pdf
 
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdfimport java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptx
 
Java -lec-5
Java -lec-5Java -lec-5
Java -lec-5
 
JAVA PRACTICE QUESTIONS v1.4.pdf
JAVA PRACTICE QUESTIONS v1.4.pdfJAVA PRACTICE QUESTIONS v1.4.pdf
JAVA PRACTICE QUESTIONS v1.4.pdf
 
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 Problem1 java codeimport java.util.Scanner; Java code to pr.pdf Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdfSumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
 
Write a Java ProgramSolutionAnswer- Code- import java-io--- import jav.docx
Write a Java ProgramSolutionAnswer- Code- import java-io--- import jav.docxWrite a Java ProgramSolutionAnswer- Code- import java-io--- import jav.docx
Write a Java ProgramSolutionAnswer- Code- import java-io--- import jav.docx
 
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
 
The solution is as belowEmployeeDemo.javaimport java.util.Scann.pdf
The solution is as belowEmployeeDemo.javaimport java.util.Scann.pdfThe solution is as belowEmployeeDemo.javaimport java.util.Scann.pdf
The solution is as belowEmployeeDemo.javaimport java.util.Scann.pdf
 
Java programs
Java programsJava programs
Java programs
 
import java.uti-WPS Office.docx
import java.uti-WPS Office.docximport java.uti-WPS Office.docx
import java.uti-WPS Office.docx
 
Computer java programs
Computer java programsComputer java programs
Computer java programs
 

Más de aonetelecompune

Cardiovascular drift as a result of dehydration caused by sweat loss d.pdf
Cardiovascular drift as a result of dehydration caused by sweat loss d.pdfCardiovascular drift as a result of dehydration caused by sweat loss d.pdf
Cardiovascular drift as a result of dehydration caused by sweat loss d.pdfaonetelecompune
 
Carbon cioxide ( CO2) is readily soluble in water- according to the eq.pdf
Carbon cioxide ( CO2) is readily soluble in water- according to the eq.pdfCarbon cioxide ( CO2) is readily soluble in water- according to the eq.pdf
Carbon cioxide ( CO2) is readily soluble in water- according to the eq.pdfaonetelecompune
 
Capstone project topic Wireless Infrastructure in the Cloud Wireless d.pdf
Capstone project topic Wireless Infrastructure in the Cloud Wireless d.pdfCapstone project topic Wireless Infrastructure in the Cloud Wireless d.pdf
Capstone project topic Wireless Infrastructure in the Cloud Wireless d.pdfaonetelecompune
 
Capsule Staining Staphylococcus aureus- Escherichia coli- Bacillus meg.pdf
Capsule Staining Staphylococcus aureus- Escherichia coli- Bacillus meg.pdfCapsule Staining Staphylococcus aureus- Escherichia coli- Bacillus meg.pdf
Capsule Staining Staphylococcus aureus- Escherichia coli- Bacillus meg.pdfaonetelecompune
 
Can someone tell me why I'm getting Java error cannot invoke add(int).pdf
Can someone tell me why I'm getting Java error cannot invoke add(int).pdfCan someone tell me why I'm getting Java error cannot invoke add(int).pdf
Can someone tell me why I'm getting Java error cannot invoke add(int).pdfaonetelecompune
 
Can you site your sources for the information given please Step 1- Res.pdf
Can you site your sources for the information given please Step 1- Res.pdfCan you site your sources for the information given please Step 1- Res.pdf
Can you site your sources for the information given please Step 1- Res.pdfaonetelecompune
 
Can you please provide a example of how these linux commands are used.pdf
Can you please provide a example of how these linux commands are used.pdfCan you please provide a example of how these linux commands are used.pdf
Can you please provide a example of how these linux commands are used.pdfaonetelecompune
 
Capital Markets provide which of the following to a firm- (Select all.pdf
Capital Markets provide which of the following to a firm- (Select all.pdfCapital Markets provide which of the following to a firm- (Select all.pdf
Capital Markets provide which of the following to a firm- (Select all.pdfaonetelecompune
 
Capital flight is Question 32 options- 1) 2) 3).pdf
Capital flight is Question 32 options-             1)      2)      3).pdfCapital flight is Question 32 options-             1)      2)      3).pdf
Capital flight is Question 32 options- 1) 2) 3).pdfaonetelecompune
 
Capillaries are better for material exchange because compared to arter.pdf
Capillaries are better for material exchange because compared to arter.pdfCapillaries are better for material exchange because compared to arter.pdf
Capillaries are better for material exchange because compared to arter.pdfaonetelecompune
 
Can this be done with an Arduino Uno- if so can I get pictures of how.pdf
Can this be done with an Arduino Uno- if so can I get pictures of how.pdfCan this be done with an Arduino Uno- if so can I get pictures of how.pdf
Can this be done with an Arduino Uno- if so can I get pictures of how.pdfaonetelecompune
 
Can someone Please solve Question 1 part B - Thanks!.pdf
Can someone Please solve Question 1 part B -  Thanks!.pdfCan someone Please solve Question 1 part B -  Thanks!.pdf
Can someone Please solve Question 1 part B - Thanks!.pdfaonetelecompune
 
Canada's Quota on European Cheese- In 2021- Canada imposed a quota on.pdf
Canada's Quota on European Cheese- In 2021- Canada imposed a quota on.pdfCanada's Quota on European Cheese- In 2021- Canada imposed a quota on.pdf
Canada's Quota on European Cheese- In 2021- Canada imposed a quota on.pdfaonetelecompune
 
Charles named several programs and philosophies that are integral to t.pdf
Charles named several programs and philosophies that are integral to t.pdfCharles named several programs and philosophies that are integral to t.pdf
Charles named several programs and philosophies that are integral to t.pdfaonetelecompune
 
Chapters 5 - 11 book is Human Resource Management in Health Care princ.pdf
Chapters 5 - 11 book is Human Resource Management in Health Care princ.pdfChapters 5 - 11 book is Human Resource Management in Health Care princ.pdf
Chapters 5 - 11 book is Human Resource Management in Health Care princ.pdfaonetelecompune
 
Chapter Review Questions Labeling Itentifu she thene ratanovien of mur (1).pdf
Chapter Review Questions Labeling Itentifu she thene ratanovien of mur (1).pdfChapter Review Questions Labeling Itentifu she thene ratanovien of mur (1).pdf
Chapter Review Questions Labeling Itentifu she thene ratanovien of mur (1).pdfaonetelecompune
 
Chapter 8 sample study questions What is the difference between a Lang.pdf
Chapter 8 sample study questions What is the difference between a Lang.pdfChapter 8 sample study questions What is the difference between a Lang.pdf
Chapter 8 sample study questions What is the difference between a Lang.pdfaonetelecompune
 
Chapter 6 Define virus- viroid- virion- prion- provirus- reverse trans.pdf
Chapter 6 Define virus- viroid- virion- prion- provirus- reverse trans.pdfChapter 6 Define virus- viroid- virion- prion- provirus- reverse trans.pdf
Chapter 6 Define virus- viroid- virion- prion- provirus- reverse trans.pdfaonetelecompune
 
Chapter 7 Discussion Key Handling This chapter discusses the importanc.pdf
Chapter 7 Discussion Key Handling This chapter discusses the importanc.pdfChapter 7 Discussion Key Handling This chapter discusses the importanc.pdf
Chapter 7 Discussion Key Handling This chapter discusses the importanc.pdfaonetelecompune
 
Can someone pls explain the table- FOr the labelled A to E- How do you.pdf
Can someone pls explain the table- FOr the labelled A to E- How do you.pdfCan someone pls explain the table- FOr the labelled A to E- How do you.pdf
Can someone pls explain the table- FOr the labelled A to E- How do you.pdfaonetelecompune
 

Más de aonetelecompune (20)

Cardiovascular drift as a result of dehydration caused by sweat loss d.pdf
Cardiovascular drift as a result of dehydration caused by sweat loss d.pdfCardiovascular drift as a result of dehydration caused by sweat loss d.pdf
Cardiovascular drift as a result of dehydration caused by sweat loss d.pdf
 
Carbon cioxide ( CO2) is readily soluble in water- according to the eq.pdf
Carbon cioxide ( CO2) is readily soluble in water- according to the eq.pdfCarbon cioxide ( CO2) is readily soluble in water- according to the eq.pdf
Carbon cioxide ( CO2) is readily soluble in water- according to the eq.pdf
 
Capstone project topic Wireless Infrastructure in the Cloud Wireless d.pdf
Capstone project topic Wireless Infrastructure in the Cloud Wireless d.pdfCapstone project topic Wireless Infrastructure in the Cloud Wireless d.pdf
Capstone project topic Wireless Infrastructure in the Cloud Wireless d.pdf
 
Capsule Staining Staphylococcus aureus- Escherichia coli- Bacillus meg.pdf
Capsule Staining Staphylococcus aureus- Escherichia coli- Bacillus meg.pdfCapsule Staining Staphylococcus aureus- Escherichia coli- Bacillus meg.pdf
Capsule Staining Staphylococcus aureus- Escherichia coli- Bacillus meg.pdf
 
Can someone tell me why I'm getting Java error cannot invoke add(int).pdf
Can someone tell me why I'm getting Java error cannot invoke add(int).pdfCan someone tell me why I'm getting Java error cannot invoke add(int).pdf
Can someone tell me why I'm getting Java error cannot invoke add(int).pdf
 
Can you site your sources for the information given please Step 1- Res.pdf
Can you site your sources for the information given please Step 1- Res.pdfCan you site your sources for the information given please Step 1- Res.pdf
Can you site your sources for the information given please Step 1- Res.pdf
 
Can you please provide a example of how these linux commands are used.pdf
Can you please provide a example of how these linux commands are used.pdfCan you please provide a example of how these linux commands are used.pdf
Can you please provide a example of how these linux commands are used.pdf
 
Capital Markets provide which of the following to a firm- (Select all.pdf
Capital Markets provide which of the following to a firm- (Select all.pdfCapital Markets provide which of the following to a firm- (Select all.pdf
Capital Markets provide which of the following to a firm- (Select all.pdf
 
Capital flight is Question 32 options- 1) 2) 3).pdf
Capital flight is Question 32 options-             1)      2)      3).pdfCapital flight is Question 32 options-             1)      2)      3).pdf
Capital flight is Question 32 options- 1) 2) 3).pdf
 
Capillaries are better for material exchange because compared to arter.pdf
Capillaries are better for material exchange because compared to arter.pdfCapillaries are better for material exchange because compared to arter.pdf
Capillaries are better for material exchange because compared to arter.pdf
 
Can this be done with an Arduino Uno- if so can I get pictures of how.pdf
Can this be done with an Arduino Uno- if so can I get pictures of how.pdfCan this be done with an Arduino Uno- if so can I get pictures of how.pdf
Can this be done with an Arduino Uno- if so can I get pictures of how.pdf
 
Can someone Please solve Question 1 part B - Thanks!.pdf
Can someone Please solve Question 1 part B -  Thanks!.pdfCan someone Please solve Question 1 part B -  Thanks!.pdf
Can someone Please solve Question 1 part B - Thanks!.pdf
 
Canada's Quota on European Cheese- In 2021- Canada imposed a quota on.pdf
Canada's Quota on European Cheese- In 2021- Canada imposed a quota on.pdfCanada's Quota on European Cheese- In 2021- Canada imposed a quota on.pdf
Canada's Quota on European Cheese- In 2021- Canada imposed a quota on.pdf
 
Charles named several programs and philosophies that are integral to t.pdf
Charles named several programs and philosophies that are integral to t.pdfCharles named several programs and philosophies that are integral to t.pdf
Charles named several programs and philosophies that are integral to t.pdf
 
Chapters 5 - 11 book is Human Resource Management in Health Care princ.pdf
Chapters 5 - 11 book is Human Resource Management in Health Care princ.pdfChapters 5 - 11 book is Human Resource Management in Health Care princ.pdf
Chapters 5 - 11 book is Human Resource Management in Health Care princ.pdf
 
Chapter Review Questions Labeling Itentifu she thene ratanovien of mur (1).pdf
Chapter Review Questions Labeling Itentifu she thene ratanovien of mur (1).pdfChapter Review Questions Labeling Itentifu she thene ratanovien of mur (1).pdf
Chapter Review Questions Labeling Itentifu she thene ratanovien of mur (1).pdf
 
Chapter 8 sample study questions What is the difference between a Lang.pdf
Chapter 8 sample study questions What is the difference between a Lang.pdfChapter 8 sample study questions What is the difference between a Lang.pdf
Chapter 8 sample study questions What is the difference between a Lang.pdf
 
Chapter 6 Define virus- viroid- virion- prion- provirus- reverse trans.pdf
Chapter 6 Define virus- viroid- virion- prion- provirus- reverse trans.pdfChapter 6 Define virus- viroid- virion- prion- provirus- reverse trans.pdf
Chapter 6 Define virus- viroid- virion- prion- provirus- reverse trans.pdf
 
Chapter 7 Discussion Key Handling This chapter discusses the importanc.pdf
Chapter 7 Discussion Key Handling This chapter discusses the importanc.pdfChapter 7 Discussion Key Handling This chapter discusses the importanc.pdf
Chapter 7 Discussion Key Handling This chapter discusses the importanc.pdf
 
Can someone pls explain the table- FOr the labelled A to E- How do you.pdf
Can someone pls explain the table- FOr the labelled A to E- How do you.pdfCan someone pls explain the table- FOr the labelled A to E- How do you.pdf
Can someone pls explain the table- FOr the labelled A to E- How do you.pdf
 

Último

Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 

Último (20)

Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 

Can you please help fix Java code Thank you import java-util-Scanner.pdf

  • 1. Can you please help fix Java code Thank you import java.util.Scanner; public class Overtime { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); String firstName; System.out.println("Enter your first name:"); firstName = scnr.next(); System.out.print("Enter your last name: "); String lastName = scnr.next(); System.out.print("Enter the number of hours you worked: "); int hours = scnr.nextInt(); System.out.print("Enter your hourly pay rate: "); double payRate = scnr.nextDouble(); double basePay; double overtimePay = 0.0; if (hours > 40) { basePay = 40 * payRate; overtimePay = (hours - 40) * payRate * 1.5; } else { basePay = hours * payRate; } double totalPay = basePay + overtimePay; System.out.printf(firstName + " " + lastName + ", your pay is $%.1f%n", basePay+overtimePay ); if (hours > 40) { System.out.printf("Overtime accounts for $%.1f of that.%n", overtimePay); } if (hours > 70) { System.out.println("You worked more than 70 hours. Your check may be delayed 3-4 business days pending manager approval."); } } } 2:Compare output Output differs. See highlights below. Input Your output ends with Expectedoutput John Doe, your pay is $398.75 ends with overtime accounts for $108.75 of that.