Advertisement
nuggetin

vzxc

Oct 31st, 2021
1,066
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Overloading
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Console.WriteLine("Total: " + computeTotal(60.9, 96)+"\n");
  10.             Console.WriteLine("Total with 50% discount: "+ computeTotal(60.9, 96, 0.50));
  11.         }
  12.  
  13.         static double computeTotal(double price, double qty)
  14.         {
  15.             return price * qty;
  16.         }
  17.  
  18.         static double computeTotal(double price, double qty, double discount)
  19.         {
  20.             return Math.Abs(((price * qty) * discount) - price * qty);
  21.         }
  22.     }
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement