Sunday, October 16, 2016

Payroll System in C#

Here is a simple payroll system that I wrote using Microsoft C# programming language this payroll system is based here in the Philippine setting for the deductions like tax, philhealth, sss, pag-ibig. Our program will ask the name of the employee, position of the employee, rate per day and number of days the employee work in the company and then our program will compute the gross pay, total deductions and finally the net pay of the salary of the employee. I hope you will like my work thank you.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 


My mobile number here in the Philippines is 09173084360.




Sample Program Output


Program Listing

payroll.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

// October 16, 2016  Sunday
// Author : Mr. Jake R. Pomperada, MAED-IT
// Program to compute the salary of an employee in a company.

namespace payroll_solver
{
    class payroll
    {
        static void Main(string[] args)
        {
            string emp_name,position,reply;
            int no_days_work = 0,n=0;
            double sss = 0, philhealth = 0, tax=0,pag_ibig=0, daily_rate=0;
            double total_deductions = 0, gross_pay = 0, net_pay = 0;

            
        do {
            Console.Clear();
            Console.Write("EMPLOYEE'S PAYROLL SYSTEM");
            Console.Write("\n\n");
            Console.Write("Enter Employee's Name       : ");
            emp_name = Console.ReadLine();
            Console.Write("Enter Employee's Position   : ");
            position = Console.ReadLine();
            Console.Write("Enter Number of Day's Work  : ");
            no_days_work = Convert.ToInt32(Console.ReadLine());
            Console.Write("Enter Daily Salary Rate     : ");
            daily_rate = Convert.ToDouble(Console.ReadLine());

            gross_pay = (no_days_work * daily_rate);

            Console.Write("\n\n");
            Console.WriteLine("Gross Pay       : Php {0:0.00}.",  gross_pay);
            Console.Write("\n\n");
            Console.Write("===== DEDUCTIONS =====");
            Console.Write("\n\n");
            Console.Write("Enter SSS Contribution            : ");
            sss = Convert.ToDouble(Console.ReadLine());
            Console.Write("Enter PAG-IBIG Contribution       : ");
            pag_ibig = Convert.ToDouble(Console.ReadLine());
            Console.Write("Enter PHILHEALTH Contribution     : ");
            philhealth = Convert.ToDouble(Console.ReadLine());
            Console.Write("Enter BIR TAX Contribution        : ");
            tax = Convert.ToDouble(Console.ReadLine());

            total_deductions = (sss + pag_ibig + philhealth + tax);

            net_pay = (gross_pay - total_deductions);

            Console.Write("\n\n");
            Console.WriteLine("Total Deductions      : Php {0:0.00}.", total_deductions);
            Console.Write("\n\n");
            Console.Write("===== DISPLAY RESULTS =====");
            Console.Write("\n\n");
            Console.WriteLine("Employee's Name       : {0}.", emp_name);
            Console.WriteLine("Empoyee's  Position   : {0}.", position);
            Console.WriteLine("Gross Pay             : Php {0:0.00}.", gross_pay);
            Console.WriteLine("Total Deductions      : Php {0:0.00}.", total_deductions);
            Console.Write("\n\n");
            Console.WriteLine("Net Pay               : Php {0:0.00}.", net_pay);
            Console.Write("\n\n");
            Console.Write("Do You Want To Continue? Y/N : ");
            reply = Console.ReadLine();

            if (reply == "y" || reply == "Y")
            {
                continue;
            }
            else if (reply == "n" || reply == "N")
            {
                Console.Write("\n\n");
                Console.Write("Thank You For Using This Software.");
                Console.Write("\n\n");
                break;
            }
           
        } while (n == 0);
          Console.ReadLine();
        } 
    }
}



Product Bill Calculator in C#

Here is a sample program that I wrote in C# that will ask the user to give the product name, product quantity and product price and then our program will compute for the total cost of the product. What is good about this program is that I added a function that will prompt and ask the user do you want to continue using this program or not which enables the user to repeat the program running again and able to provide new values in a the other product. I hope you will find my work useful. Thank you.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 

My mobile number here in the Philippines is 09173084360.




Sample Program Output

Program Listing

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

// October 16, 2016  Sunday
// Author : Mr. Jake R. Pomperada, MAED-IT
// Program to compute bill given price and quantity

namespace bill_solver
{
    class bill
    {
        static void Main(string[] args)
        {
            string product_name, reply;
            int quantity = 0,n=0;
            double price = 0, amount = 0;
            
        do {
            Console.Clear();
            Console.Write("Product Bill Calculator");
            Console.Write("\n\n");
            Console.Write("Enter Product Name      : ");
            product_name = Console.ReadLine();
            Console.Write("Enter Quantity          : ");
            quantity = Convert.ToInt32(Console.ReadLine());
            Console.Write("Enter Product Price Php : ");
            price = Convert.ToDouble(Console.ReadLine());

            amount = (quantity * price);

            Console.Write("\n\n");
            Console.Write("===== DISPLAY RESULTS =====");
            Console.Write("\n\n");
            Console.WriteLine("Product          :  {0}.", product_name);
            Console.WriteLine("Price            :  {0:0.00}.", price);
            Console.WriteLine("Quantity         :  {0}.", quantity);
            Console.Write("\n\n");
            Console.WriteLine("Total Cost       : Php {0:0.00}.", amount);
            Console.Write("\n\n");
            Console.Write("Do You Want To Continue? Y/N : ");
            reply = Console.ReadLine();

            if (reply == "y" || reply == "Y")
            {
                continue;
            }
            else if (reply == "n" || reply == "N")
            {
                Console.Write("\n\n");
                Console.Write("Thank You For Using This Software.");
                Console.Write("\n\n");
                break;
            }
           
        } while (n == 0);
        Console.ReadLine();
        } 
    }
}



Saturday, October 15, 2016

Basic User Input in C#

This simple program will show you basic input and output operations in Microsoft C# programming language.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 

My mobile number here in the Philippines is 09173084360.




Sample Program Output

Program Listing

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace basic_user_input
{
    class user_input
    {
        static void Main(string[] args)
        {
            string name;
            int age=0;
            double height=0;

            Console.Write("Basic User Input in C# ");
            Console.Write("\n\n");
            Console.Write("What is your name : ");
            name = Console.ReadLine();
            Console.Write("What is your age  : ");
            age = Convert.ToInt32(Console.ReadLine());
            Console.Write("What is your height in Centimeter(s) : ");
            height = Convert.ToDouble(Console.ReadLine());

            //Print a blank line
            Console.WriteLine();

            //Show the details you typed
            Console.Write("\n\n");
            Console.Write("===== DISPLAY REPORT =====");
            Console.Write("\n\n");
            Console.WriteLine("Name is {0}.", name);
            Console.WriteLine("Age is {0}.", age);
            Console.WriteLine("Height is {0}.", height);
            Console.Write("\n\n");
            Console.Write("End of Program");
            Console.ReadLine();
        }
    }
}




Seconds To Hours, Minutes and Seconds in C#

A very simple program that I wrote using C# as my programming language that will ask the user to give time in seconds and then our program will converted the given time in hours, minutes and seconds.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 

My mobile number here in the Philippines is 09173084360.




Sample Program Output

Program Listing

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace time_conversion
{
    class time_check
    {
        static void Main(string[] args)
        {
            long v,sec,hr,min; 

            Console.Write("Time Converter Converter");
            Console.Write("\n\n");
            Console.Write("Enter Time in Seconds   : ");
            sec = Convert.ToInt32(Console.ReadLine());

            hr=sec/3600; 
            v=sec%3600; 
            min=v/60; 
            sec=v%60; 

            Console.Write("\n\n");
            Console.Write("===== DISPLAY REPORT =====");
            Console.Write("\n\n");
            Console.WriteLine(" Time in hour:min:sec is: {0}:{1}:{2}." ,hr,min,sec);
            Console.Write("\n\n");
            Console.Write("End of Program");
            Console.ReadLine();
        }
    }
}








Loan Interest Solver in C# Using Console

Here is a simple program that I wrote using Microsoft C# programming language that will compute for the interest to be paid by the customer to the loan that he or she acquire from a bank or a lending institution. What does our program will do is to ask the user to give the principal amount being borrowed, second our program will ask the rate of interest and finally the third our program will ask time refers to the number of years the loan amount should be paid of by the borrower. The code is very simple and easy to understand.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 

My mobile number here in the Philippines is 09173084360.




Sample Program Output

Program Listing

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace loan_solve_problem
{
    class loan_solver
    {
        static void Main(string[] args)
        {
            double amount=0, rate=0, time=0, solve_interest=0;

            Console.Write("Loan Interest Solver");
            Console.Write("\n\n");
            Console.Write("Enter Principal Amount    : ");
            amount = Convert.ToDouble(Console.ReadLine());
            Console.Write("Enter Rate of Interest    : ");
            rate = Convert.ToDouble(Console.ReadLine());
            Console.Write("Enter Period of Interest  : ");
            time  = Convert.ToDouble(Console.ReadLine());
              
            solve_interest = (amount * rate * time) / 100;

            Console.Write("\n\n");
            Console.Write("===== DISPLAY REPORT =====");
            Console.Write("\n\n");
            Console.WriteLine("The Interest is Php {0:0.00}.", solve_interest);
            Console.Write("\n\n");
            Console.Write("End of Program");
            Console.ReadLine();
        }
    }
}





Student Grade Solver in C# Using Console


Here is a sample program that I wrote using C# as my programming language that will ask the user to give the student name, subject, prelim, midterm and endterm grade and then our program will compute for the final grade of the student using C# in console environment.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 

My mobile number here in the Philippines is 09173084360.




Sample Program Output

Program Listing

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace student_grade_solver
{
    class grade_solve
    {
        static void Main(string[] args)
        {
            string student_name, subject;
            double prelim = 0, midterm = 0, endterm = 0;
            double final_grade = 0;
           
            Console.Write("Student Grade Solver");
            Console.Write("\n\n");
            Console.Write("Student Name    : ");
            student_name = Console.ReadLine();
            Console.Write("Subject         : ");
            subject = Console.ReadLine();
            Console.Write("Prelim Grade    : ");
            prelim = Convert.ToDouble(Console.ReadLine());
            Console.Write("Midterm Grade   : ");
            midterm = Convert.ToDouble(Console.ReadLine());
            Console.Write("Endterm Grade   : ");
            endterm = Convert.ToDouble(Console.ReadLine());

            final_grade = (prelim * 0.2) + (midterm * 0.3) + (endterm * 0.5); 

            Console.Write("\n\n");
            Console.Write("===== DISPLAY REPORT ====="); 
            Console.Write("\n\n");
            Console.WriteLine(" Student Name  :  {0}. ",student_name);
            Console.WriteLine(" Subject       :  {0}. ",subject);
            Console.WriteLine(" Final Grade   :  {0:0}.",final_grade);
            Console.Write("\n\n");
            Console.Write("End of Program");
            Console.ReadLine();
        }
    }
}




Celsius To Fahrenheit Converter in C#

A simple console program that I wrote in C# that will ask the user temperature in Celsius and then it will convert to Fahrenheit temperature equivalent. 

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 

My mobile number here in the Philippines is 09173084360.




Sample Program Output


Program Listing

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace temperature
{
    class temp_solver
    {
        static void Main(string[] args)
        {
            double celsius=0,solve_fahrenheit=0;

            Console.Write("Celsius To Fahrenheit Converter");
            Console.Write("\n\n");
            Console.Write("Enter Temperature in Celsius   : ");
            celsius = Convert.ToDouble(Console.ReadLine());

            solve_fahrenheit = (1.8 * celsius) + 32;

            Console.Write("\n\n");
            Console.Write("===== DISPLAY REPORT =====");
            Console.Write("\n\n");
            Console.WriteLine("The Temperature in Fahrenheit is {0:0.00}.", solve_fahrenheit);
            Console.Write("\n\n");
            Console.Write("End of Program");
            Console.ReadLine();
        }
    }
}






Sum of Two Numbers in C# Using Console

A very simple program that I wrote using Microsoft C# programming language that will accept two integer input values from the user and then our program will add the sum of the two input values using console environment in C#.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 


My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 

My mobile number here in the Philippines is 09173084360.




Sample Program Output

Program Listing

add.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace add
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, sum;
            Console.Write("Sum of Two Numbers in C# Using Console");
            Console.Write("\n\n");
            Console.Write("Enter the first number : ");
            a = Convert.ToInt32(Console.ReadLine());
            Console.Write("Enter second number : ");
            b = Convert.ToInt32(Console.ReadLine());
            sum = a + b;
            Console.Write("\n\n");
            Console.WriteLine("The sum of {0} and {1} is {2}.", a,b,sum);
            Console.Write("\n\n");
            Console.Write("End of Program");
            Console.ReadLine();
        }
    }
}