VB icon

Product Bill Calculator in C#

Email
Submitted on: 10/16/2016 1:25:25 AM
By: Jake R. Pomperada  
Level: Beginner
User Rating: Unrated
Compatibility: C#
Views: 1885
author picture
 
     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.

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
//**************************************
// Name: Product Bill Calculator in C#
// Description: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.
// By: Jake R. Pomperada
//**************************************

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


Other 38 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.