Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Overloading
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Total: " + computeTotal(60.9, 96)+"\n");
- Console.WriteLine("Total with 50% discount: "+ computeTotal(60.9, 96, 0.50));
- }
- static double computeTotal(double price, double qty)
- {
- return price * qty;
- }
- static double computeTotal(double price, double qty, double discount)
- {
- return Math.Abs(((price * qty) * discount) - price * qty);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement