A simple payroll program that I wrote using object oriented programming approach using C# programming language.
I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
Please subscribe to my channel https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg
=================================================
Want to support my channel?
GCash Account
Jake Pomperada
09173084360
Paypal
https://paypal.me/jakerpomperada
Patreon
https://www.patreon.com/jakerpomperada
Thank you very much for your support.
Program Listing
using System;
namespace Simple_Payroll_OOP
{
// a simple payroll program that will ask the user number of days work
// and rate per day and compute the gross pay of an employee using C#
// oop approach in programming
class Program
{
static void PrintHeader()
{
Console.WriteLine("\t===========================================");
Console.WriteLine("\tSimple Payroll Program in C# Using OOP");
Console.WriteLine("\t===========================================");
Console.WriteLine();
}
static void Main(string[] args)
{
Payroll payRoll = new Payroll();
PrintHeader();
while(true)
{
Console.Write("\tEnter number of days worked (0 to quit): ");
int numDays = ConsoleInput.ReadInt();
if(numDays == 0)
break;
Console.Write("\tEnter pay rate: ");
double payRate = ConsoleInput.ReadDouble();
double netPay = payRoll.CalcGrossPay(numDays, payRate);
Console.WriteLine("\tNet pay: " + netPay);
}
SayGoodBye();
Console.ReadKey();
}
private static void SayGoodBye()
{
Console.WriteLine("\n");
Console.WriteLine("\tThank You For Using This Program");
}
}
class Payroll
{
public double CalcGrossPay(int daysWorked, double ratePerDay)
{
return daysWorked * ratePerDay;
}
}
}
No comments:
Post a Comment