Friday, March 19, 2021

Weekly Total Expenses in C#

 Write a C# program that will input all your expenses for the week and display the total expenses.

Sample dialogue:

Food: 500.00

Grocery: 200.00

Cellphone/Internet Load: 100

Others: 300.00

Total Expenses: 1100.00

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.





Program Listing

// Mr. Jake R. Pomperada, MAED-IT, MIT
// www.jakerpomperada.com
// www.jakerpomperada.blogspot.com
// jakerpomperada@gmail.com
// March 19, 2021 Friday

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

namespace WeeklyExpenses
{
    class Program
    {
        static void Main(string[] args)
        {

            double food = 0.00;
            double grocery = 0.00;
            double cellphone_load = 0.00;
            double others = 0.00;
            double total_expenses = 0.00;

            Console.WriteLine("\n");
            Console.WriteLine("\tWeekly Total Expenses in C#");
            Console.WriteLine("\n");
            Console.Write("\tWhat is your expenses for Food? ");
            food = Double.Parse(Console.ReadLine());

            Console.Write("\tWhat is your expenses for Grocery? ");
            grocery = Double.Parse(Console.ReadLine());

            Console.Write("\tWhat is your expenses for Cellphone/Internet Load? ");
            cellphone_load = Double.Parse(Console.ReadLine());
            
            Console.Write("\tWhat is your other expenses? ");
            others = Double.Parse(Console.ReadLine());
            
            total_expenses = (food + grocery + cellphone_load + others);

            Console.WriteLine("\n");
            Console.WriteLine("\tTotal Expenses : PHP {0:0.00}", total_expenses);
            Console.WriteLine("\n");
            Console.WriteLine("\tEnd of Program");
            Console.WriteLine("\n\n");
            Console.ReadKey(); 
        }
    }
}


No comments:

Post a Comment