Question #298330

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.

Expert's answer

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);
            
 
        }
    }

   
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS