Question

Write a C# Windows Forms application that calculates and prints the take-home pay for a commissioned sales employee. Allow the user to enter values for the name of the employee and the sales amount for the week. Employees receive 7% of the total sales. Federal tax rate is 18%. Retirement contribution is 15%. Social Security tax rate is 9%. Use appropriate constants. Write Input, Display, and Calculate methods. Your final output should display all calculated values, including the total deductions and all defined constants.

Net Pay Calculator 2.Form 1 Form10 Employee name Nicolas Bourbak Employees total weekly sales: 212.14 Employee commission is

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Output will be like:

Form Employee Name Nayanthara Employee total weekly sales 100000 Employees contribution toal 7% of sales Calculate take home

Form will be like:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace payCalculatorForm
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
double totalWeekSales = Convert.ToDouble(textBox2.Text);
double pay = totalWeekSales * 0.07;

double federalTaxRate = pay * 0.018;
double retirementContribution = pay * 0.015;
double socialSecurityTax = pay * 0.09;

textBox3.Text = Convert.ToString(federalTaxRate);
textBox4.Text = Convert.ToString(retirementContribution);
textBox5.Text = Convert.ToString(socialSecurityTax);


double netPay = pay - (federalTaxRate + retirementContribution + socialSecurityTax);

label9.Text = Convert.ToString(netPay);
  

}

private void button2_Click(object sender, EventArgs e)
{
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
textBox5.Text = "";

}

private void button3_Click(object sender, EventArgs e)
{
this.Close();
}
}
}

Designer will be like:

namespace payCalculatorForm
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;

/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}

#region Windows Form Designer generated code

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.textBox4 = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.textBox5 = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(38, 50);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(84, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Employee Name";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(197, 50);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 20);
this.textBox1.TabIndex = 1;
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(197, 108);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(100, 20);
this.textBox2.TabIndex = 3;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(38, 111);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(139, 13);
this.label2.TabIndex = 2;
this.label2.Text = "Employee total weekly sales";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(58, 179);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(194, 13);
this.label3.TabIndex = 4;
this.label3.Text = "Employee\'s contribution toal 7% of sales";
//
// button1
//
this.button1.Location = new System.Drawing.Point(61, 235);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(363, 50);
this.button1.TabIndex = 5;
this.button1.Text = "Calculate take home pay";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F);
this.label4.Location = new System.Drawing.Point(192, 313);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(105, 24);
this.label4.TabIndex = 6;
this.label4.Text = "Deductions";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(247, 410);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(100, 20);
this.textBox3.TabIndex = 10;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(88, 413);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(139, 13);
this.label5.TabIndex = 9;
this.label5.Text = "Retirement contribution 15%";
//
// textBox4
//
this.textBox4.Location = new System.Drawing.Point(247, 352);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(100, 20);
this.textBox4.TabIndex = 8;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(88, 352);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(76, 13);
this.label6.TabIndex = 7;
this.label6.Text = "Federal tax 8%";
//
// textBox5
//
this.textBox5.Location = new System.Drawing.Point(247, 455);
this.textBox5.Name = "textBox5";
this.textBox5.Size = new System.Drawing.Size(100, 20);
this.textBox5.TabIndex = 12;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(88, 458);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(92, 13);
this.label7.TabIndex = 11;
this.label7.Text = "Social security 9%";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F);
this.label8.Location = new System.Drawing.Point(192, 502);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(117, 24);
this.label8.TabIndex = 13;
this.label8.Text = "Total net pay";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(253, 541);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(35, 13);
this.label9.TabIndex = 14;
this.label9.Text = "label9";
//
// button2
//
this.button2.Location = new System.Drawing.Point(136, 570);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 15;
this.button2.Text = "Clear";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(326, 570);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(75, 23);
this.button3.TabIndex = 16;
this.button3.Text = "Exit";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(591, 605);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.label9);
this.Controls.Add(this.label8);
this.Controls.Add(this.textBox5);
this.Controls.Add(this.label7);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.label5);
this.Controls.Add(this.textBox4);
this.Controls.Add(this.label6);
this.Controls.Add(this.label4);
this.Controls.Add(this.button1);
this.Controls.Add(this.label3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.label2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
this.PerformLayout();

}

#endregion

private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox textBox5;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
}
}

Please rate it if the above solution helps you in any way or if you have any concerns comment it, I will help you through again.

Add a comment
Know the answer?
Add Answer to:
Write a C# Windows Forms application that calculates and prints the take-home pay for a commissioned...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Has to be written in C#! Write a Windows Forms application that calculates and prints the...

    Has to be written in C#! Write a Windows Forms application that calculates and prints the take-home pay for a commissioned sales employee. Allow the user to enter values for the name of the employee and the sales amount for the week. Employees receive 7% of the total sales. Federal tax rate is 18%. Retirement contribution is 15%. Social Security tax rate is 9%. Use appropriate constants. Write Input, Display, and Calculate methods. Your final output should display all calculated...

  • 1. Total net pay, $16.592.58 Excel PR 11-4B Payroll register OBJ. 2,3 The following data for...

    1. Total net pay, $16.592.58 Excel PR 11-4B Payroll register OBJ. 2,3 The following data for Flexco Inc. relate to the payroll for the week ended December, 2016 Hours Hourly Weekly Federal Retirement Employee Worked Rate Salary Income Tax Savings Carlton 52 $50.00 $667.00 $ 60 Grove $4,000 860.00 100 Johnson 36 52.00 355.68 Koufax 58.00 578.55 Maddux 45.00 349.65 Seaver 3,200 768.00 Spahn 52.00 382.20 0 Winn 75 48 50.00 572.00 54.00 43 480.60 0 46 80 Young Employees...

  • Sean Matthews is a waiter at the Duluxe Lounge. In his first weekly pay in March,...

    Sean Matthews is a waiter at the Duluxe Lounge. In his first weekly pay in March, he earned $300.00 for the 40 hours he worked. In addition, he reports his tips for February to his employer ($500.00), and the employer withholds the appropriate taxes for the tips from this first pay in March. Calculate his net take-home pay assuming the employer withheld federal income tax (wage-bracket, single, 3 allowances), social security taxes, and state income tax (2%). Enter deductions beginning...

  • PR 11-4B Payroll register OBJ. 2,3 The following data for Flexco Inc. relate to the payroll...

    PR 11-4B Payroll register OBJ. 2,3 The following data for Flexco Inc. relate to the payroll for the week ended December 9, 2048: 1. Total net pay $16,592.58 Hours Worked Hourly Rate $50.00 Weekly Salary Retirement Savings $ 60 100 $4,000 Employee Carlton Grove Johnson Koufax Maddux Seaver Spahn Winn Young 52.00 58.00 45.00 Federal Income Tax $667.00 860.00 355.68 578.55 349.65 768.00 382.20 572.00 480.60 44 3,200 120 0 46 52.00 50.00 54.00 80 Employees Grove and Seaver are...

  • PR 11-4B Payroll register Obj. 2, 3 The following data for Flexco Inc. relate to the...

    PR 11-4B Payroll register Obj. 2, 3 The following data for Flexco Inc. relate to the payroll for the week ended December 9, 2018: Hours Worked 52 Weekly Salary Hourly Rate $50.00 52.00 58.00 45.00 Retirement Savings $ 60 100 $4,000 Employee Carlton Grove Johnson Koufax Maddux Seaver Spahn Winn Young 36 Federal Income Tax $667.00 860.00 355.68 578.55 349.65 768.00 382.20 572,00 480.60 44 62 120 3.200 52.00 50.00 54.00 Employees Grove and Seaver are office staff, and all...

  • Problem PR - A (2018) * Peppy Company pays its employees on the 15th and last...

    Problem PR - A (2018) * Peppy Company pays its employees on the 15th and last day of each month. Employees gross pay is subject to these taxes: Applied to First $128,400 ALL Wages First $7,000 First $7,000 Tax FICA - Social Security FICA Medicare Federal Unemployment State Unemployment Rate 6.20% 1.45% 0.80% 4.00% The company is preparing its payroll for the period ending October 31, 2018. Payroll records show the following information for the company's three employees. Current Pay...

  • ment Chapter 116 Help Seve & Exit Check Paloma Co. has four employees. FICA Social Security...

    ment Chapter 116 Help Seve & Exit Check Paloma Co. has four employees. FICA Social Security taxes are 6.2% of the first $128.400 paid to each employee, and FICA Medicare taxes are 1.45% of gross pay. Also, for the first $7,000 paid to each employee the company's FUTA taxes are 0.6% and SUTA taxes are 5.4%. The company is preparing its payroll calculations for the week ended August 25. Payroll records show the following information for the company's four employees...

  • please help, In this lab, you complete a C++ program with the provided data files. The program calculates the amount of...

    please help, In this lab, you complete a C++ program with the provided data files. The program calculates the amount of tax withheld from an employee’s weekly salary, the tax deduction to which the employee is entitled for each dependent, and the employee’s take- home pay. The program output includes state tax withheld, federal tax withheld, dependent tax deductions, salary, and take-home pay. Instructions Ensure the source code file named Payroll.cpp is open in the code editor. Variables have been...

  • Write a Java application with a class name of Payroll, for the “Travel Agency”, that willCalculate...

    Write a Java application with a class name of Payroll, for the “Travel Agency”, that willCalculate the weekly paycheck for both Salaried and Hourly employees. Salaried employees will be paid 1/52 of their annual pay minus 18% withheld for federal and state taxes, as well as 4% for retirement pension. Salaried employees do not collect overtime pay. There are two types of Hourly employees; permanent employees and temporary weekly employees. •Permanent weekly employees will be paid their hourly rate minus...

  • Accounting Question, Help me fill this out, please! Paloma Co. has four employees. FICA Social Security...

    Accounting Question, Help me fill this out, please! Paloma Co. has four employees. FICA Social Security taxes are 6.2% of the first $128,400 paid to each employee, and FICA Medicare taxes are 1.45% of gross pay. Also, for the first $7,000 paid to each employee, the company's FUTA taxes are 0.6% and SUTA taxes are 5.4%. The company is preparing its payroll calculations for the week ended August 25. Payroll records show the following information for the company's four employees....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT