Question

Project 2 Description Create a Visual C# project that when an employee's biweekly sales amount is...

Project 2 Description



Create a Visual C# project that when an employee's biweekly sales amount is entered and the Calculate button is pressed, the gross pay, deductions, and net pay will be displayed. Each employee will receive a base pay of $1200 plus a sales commission of 8% of sales.

Once the net pay has been calculated, display the budget amount for each category listed below based on the percentages given.

   
    base pay = $1200; use a named constant variable
    commission = 8% of sales
    gross pay = base pay + commission
    deductions = 21% of gross pay
    net pay = gross pay - deductions


Budget:

    housing = 33% of net pay
    food and clothing = 17% of net pay
    entertainment = 28% of net pay
    miscellaneous = 22% of net pay


Use textboxes to input the employee name and sales amount.  Do not allow the user to enter invalid information for the employee name and the employee sales amount (no exceptions are displayed).

Use labels to display the results of the calculations. All dollar amounts should be displayed in currency formatting. The Accept and Cancel buttons should be set to appropriate values. Add an appropriate background image for the form.


NOTE:  Be sure to use the concepts you have learned in this chapter along with the concepts learned in previous chapters.

The focus should be set to the first input textbox.

When the user selects the Clear button, the all textboxes and labels are cleared. If the user selects the Exit button, the application should close. Do not allow the user to type in any textbox or label that is not appropriate.

Add an appropriate title at the top of the form. The title should describe the application and let the user know what to do.

Be sure to change the default values and use meaningful names for your controls and variables. The form should look professional and all controls are aligned and configured with appropriate content and font formatting. The form title bar should be changed to have appropriate text. Feel free to change fore and back colors.


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

Code

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 Biweeklysales
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
const double base_pay = 1200;
const double commision = 0.08;
private void btnCalculate_Click(object sender, EventArgs e)
{
double salesAmount, grossPay, deduction, netPay, housing, food, enet, misc;

salesAmount = Convert.ToDouble(txtSales.Text);
grossPay = base_pay + salesAmount * commision;
deduction= grossPay * 0.21;
netPay = grossPay - deduction;

housing = netPay * 0.33;
food = netPay * 0.17;
enet = netPay * 0.28;
misc = netPay * 0.22;

lblDeductions.Text = deduction.ToString("C");
lblEntertainment.Text = enet.ToString("C");
lblFood.Text = food.ToString("C");
lblGrossPay.Text = grossPay.ToString("C");
lblHousing.Text = housing.ToString("C");
lblMisc.Text = misc.ToString("C");
lblNetPay.Text = netPay.ToString("C");
}

private void btnClear_Click(object sender, EventArgs e)
{
txtName.Clear();
txtSales.Clear();

lblDeductions.Text = "$0";
lblEntertainment.Text = "$0";
lblFood.Text = "$0";
lblGrossPay.Text = "$0";
lblHousing.Text = "$0";
lblMisc.Text = "$0";
lblNetPay.Text = "$0";
}

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

Design

output

If you have any query regarding the code please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.

Add a comment
Know the answer?
Add Answer to:
Project 2 Description Create a Visual C# project that when an employee's biweekly sales amount is...
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
  • Visual Basic Programming Step 1-2 not important, it's just file naming.

    Visual Basic Programming Step 1-2 not important, it's just file naming. 3. Form contains nine Labels, one TextBox, and three Button controls. You use labels to let user know what to enter and what will be displayed; TextBoxes to input a number between 1 and 99. Buttons to Calculate change. Clear Input and Exit program. See below Form Layout with Controls for more details 4. Declare variables to store the entered value in TextBox, and what will be displayed in...

  • Visual Basic Programming Step 1-2 not important, it's just file naming. 3. Form contains nine Labels,...

    Visual Basic Programming Step 1-2 not important, it's just file naming. 3. Form contains nine Labels, one TextBox, and three Button controls. You use labels to let user know what to enter and what will be displayed; TextBoxes to input a number between 1 and 99. Buttons to Calculate change. Clear Input and Exit program. See below Form Layout with Controls for more details 4. Declare variables to store the entered value in TextBox, and what will be displayed in...

  • The following form will be used to determine the sales commission of employees. Using Visual Basic...

    The following form will be used to determine the sales commission of employees. Using Visual Basic Studio, build the form with these features:  The checkbox “Target Met” must be disabled.  The title of the form should appear as “Sales Commissions” Write the code to do the following: After entering the totals sales, the checkbox will automatically be checked if the average sales per month was $1,500 or more. Note: The average sales per month can be calculated by...

  • Create an application with the following requirements: 1 form graphic on the form itself, along with...

    Create an application with the following requirements: 1 form graphic on the form itself, along with various others depending on the graphics used You pick the form color or additional graphics The program should generate a random number(1 and 100). A label that asks the player to think of a number between 1 and 100. The player should be able to enter their guess into a textbox. The program should validate the users entry to make sure its: A number,...

  • Can you solve this proble by using C# application? C# is one of programming languages supported...

    Can you solve this proble by using C# application? C# is one of programming languages supported by Visual Studio 2015. It combines the features of Java and C ++ and is suitbale for rapid application development. A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected. The state sales tax rate is 4% and the county sales tax rate is 2%. Create an...

  • Programming question. Using Visual Studio 2019 C# Windows Form Application (.NET Framework) Please include code for...

    Programming question. Using Visual Studio 2019 C# Windows Form Application (.NET Framework) Please include code for program with ALL conditions met. Conditions to be met: Word Problem A person inherits a large amount of money. The person wants to invest it. He also has to withdraw it annually. How many years will it take him/her to spend all of the investment that earns at a 7% annual interest rate? Note that he/she needs to withdraw $40,000.00 a year. Also there...

  • Write a C# Windows Forms application that calculates and prints the take-home pay for a commissioned...

    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...

  • create an application in VISUAL BASIC that calculates a cars gas mileage. The formula for calculating...

    create an application in VISUAL BASIC that calculates a cars gas mileage. The formula for calculating the miles that a car can travel per gallon of gas is MPG = Miles/Gallon In the formula MPG is miles-per-gallon, miles is the number of miles that can be driven on a full tank of gas, and gallons is the number of gallons that the tank holds. The applications form should have TextBox controls that let the user enter the number of gallons...

  • 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...

  • Project 10-1 Convert lengths In this assignment, you’ll add code to a form that converts the valu...

    Project 10-1 Convert lengths In this assignment, you’ll add code to a form that converts the value the user enters based on the selected conversion type. The application should handle the following conversions: From To Conversion Miles - Kilometers: 1 mile = 1.6093 kilometers Kilometers - Miles: 1 kilometer = 0.6214 miles Feet - Meters: 1 foot = 0.3048 meters Meters - Feet: 1 meter = 3.2808 feet Inches - Centimeters: 1 inch = 2.54 centimeters Centimeters - Inches: 1...

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
ADVERTISEMENT