Total Expenditure of month program in c#.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace cp_theory_task_paractise
{
class Program
{
static void Main(string[] args)
{
int travel, stat, lunch, tday = 0, texp = 0, day = 0, ts = 0, tt = 0, tl = 0;
do
{
Console.WriteLine("Enter Travel Exp of day:{0}", day + 1);
travel = Convert.ToInt32(Console.ReadLine());
tt = tt + travel;
Console.WriteLine("Enter Stationary Exp of day:{0}", day + 1);
stat = Convert.ToInt32(Console.ReadLine());
ts = ts + stat;
Console.WriteLine("Enter Lunch Exp of day:{0}", day + 1);
lunch = Convert.ToInt32(Console.ReadLine());
tl = tl + lunch;
tday = ts + tl + tt;
Console.WriteLine("day{0} exp:{1}", day + 1, tday);
++day;
}
while (day < 7);
texp = tt + ts + tl;
Console.WriteLine("Total exp of week:{0}", texp);
texp = texp * 4;
Console.WriteLine("Total exp of month:{0}", texp);
}
}
}
Comments
Post a Comment