An attorney’s office charge Php150 for every 20 minutes of consultation. Write a program that will ask
the user to enter the number of hours incurred for a consultation. The program then displays the bill of
the user and it starts over again. The loop will only stop if the user entered zero (0) hours for
consultation.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
int hours = 0;
int pricePer20 = 150;
do
{
Console.WriteLine("Please enter the number of hours incurred for a consultation");
hours = Convert.ToInt32(Console.ReadLine());
if (hours != 0)
{
int bill = pricePer20 * 3 * hours;
Console.WriteLine("Total price: Php{0}", bill);
}
} while (hours != 0);
}
}
}
Comments
Thanks
Leave a comment