Weekly payroll calculator (c++)

Solo disponible en BuenasTareas
  • Páginas : 10 (2485 palabras )
  • Descarga(s) : 0
  • Publicado : 6 de febrero de 2011
Leer documento completo
Vista previa del texto
Program Description:
This program will calculate an employee’s gross weekly pay. Given the total minutes worked on a week and the pay rate per hour, the application will calculate the total ammount of hours worked dividing the minutes worked by sixty (60 minutes in an hour). Once the total hours worked are calculated, they will be multiplied by the hourly pay rate to determine the gross weeklypay of a single employee.

Requirements Document:

Date Submitted: | December 2, 2010 |
Application Title: | Western Distribution Weekley Payroll Calculator |
Purpose: | The purpose of this program is to calculate an employee’s gross weekly pay based on hours worked and the hourly pay rate. |
Program Procedures: | Given the total minutes worked and the pay rete per hour, the programwill calculate the total hours worked and the gross weekly pay of a single employee. |
Algorithms, Processing & conditions: | The operations will be: divide (MinutesWorked / 60) giving HoursWorked and LeftoverMinutes, multiply (HoursWorked * PayRate) giving NetWeeklyPayroll. The clear button should delete MinutesWorked, PayRate, HoursWorked, LeftoverMinutes and NetWeeklyPay. The exit buttonwill close the form. |
Notes & restrictions: | The programming is made with C++ Visual Studio 2010. |
Comments: | Additional functions might be added if required by user. |

Event Planning Document:

Program Name: Western Distribution Weekley Payroll Calculator | Developer: Jorge R. Osorio | Object: Weekly Payroll Calculator | Date: 2 / Dec / 10 |
Object | Event Trigger | EventProcessing |
MinutesWorked | Data input | None |
PayRate | Data Input | None |
WeeklyPay button | Click | Divides MinutesWorked by 60; then multiplies the result (HoursWorked) by PayRate and displays the result as Weekly Payroll. |
Clear button | Click | Clears MinutesWorked, PayRate, HoursWorked, LeftoverMinutes and NetWeeklyPayroll. |
Exit Button | Click | Closes the form. |

SourceCode:

#pragma once

namespace WeeklyPayroll2 {

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

/// <summary>
/// Summary for Form1
/// </summary>
public ref class Form1 : publicSystem::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}

protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::PictureBox^ companyLogo;
protected:

private:System::Windows::Forms::Label^ LBLNetWeeklyPayroll;

private: System::Windows::Forms::Label^ LBLleftoverMin;
private: System::Windows::Forms::Label^ LBLhoursWorked;
private: System::Windows::Forms::TextBox^ txtPayRate;
private: System::Windows::Forms::TextBox^ txtMinutesWorked;
private: System::Windows::Forms::Label^ LBLpayRate;
private: System::Windows::Forms::Label^LBLtotalMinWorked;
private: System::Windows::Forms::Label^ LBLcalculation;
private: System::Windows::Forms::Label^ LBLwklyPayroll;
private: System::Windows::Forms::Label^ LBLwesternDist;
private: System::Windows::Forms::Button^ btnExit;
private: System::Windows::Forms::Button^ btnClear;
private: System::Windows::Forms::Button^ btnWeeklyPay;

private: System::Windows::Forms::Label^ label1;private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Label^ label3;

private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the...
tracking img