107 284
Assignments Done
97.9%
Successfully Done
In March 2023

# Answer to Question #241852 in C# for Anino

Question #241852

Return Lines 33-34 to the form:

Console.WriteLine("Employee {0} {1}, (ID: {2}) earned {3:C}",

firstName, lastName, idNum, grossPay);

Assume employees have their wages reduced by 20% to reflect the effects of taxes:

Modify the variable declarations in Line 6 to add netPay:  public static void Main()

{

int idNum;

double payRate, hours, grossPay;

string firstName, lastName;

Add a new line of code into the program to compute netPay which is grossPay multiplied by 0.8 (80%).

Math Lesson Reminder: The 0.8 multiplier is 1.0 - 0.20. If 20% of the employee's salary goes to tax, 80% of their salary (or 100% - 20%) is what they get to keep.

Modify Lines 33-34 to print out the value of netPay as well as grossPay.

1
2021-09-25T03:03:23-0400
using System;
using System.Collections.Generic;

namespace App{
class Program{
static void Main(string[] args){
int idNum;
double payRate, hours, grossPay, netPay;
string firstName, lastName;

// prompt the user to enter employee's first name
Console.Write("Enter employee's first name => ");

// prompt the user to enter employee's last name
Console.Write("Enter employee's last name => ");

// prompt the user to enter a six digit employee number
Console.Write("Enter a six digit employee's ID => ");

// prompt the user to enter the number of hours employee worked
Console.Write("Enter the number of hours employee worked => ");

// prompt the user to enter the employee's hourly pay rate
Console.Write("Enter employee's hourly pay rate: ");

// calculate gross pay
grossPay = hours * payRate;

//Add a new line of code into the program to compute netPay which is grossPay multiplied by 0.8 (80%).
//Math Lesson Reminder: The 0.8 multiplier is 1.0 - 0.20. If 20% of the employee's salary goes to tax,
//80% of their salary (or 100% - 20%) is what they get to keep.
netPay = grossPay * 0.8;

// output results
Console.WriteLine("Employee {0} {1}, (ID: {2}) earned {3:C}", firstName, lastName, idNum, netPay);

}
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!