// Directions: Intermediate #3-1
// 1) Fork this fiddle to your work area.
// 2) Create two double variables in the Main method: dblPrice and dblTotal. Assign the value of 14.99 to the dblPrice variable.
// 3) Create a new static Method called CalculateTotalPrice before the Main method.
// a) Add a By Value input parameter for the dblPrice.
// b) Method should return the value of the dblPrice * 1.05.
// 4) Call the method from the Main Method and pass in dblPrice By Value.
// 5) Output the Total as Currency.
// 6) Results:
// The subTotal for the item is: ¤14.99
// The Total for the item is: ¤15.74
// 7) Submit your dotnetfiddle link in Blackboard.
using System;
public class Program
{
static double CalculateTotalPrice (double dblPrice)
return dblPrice * 1.05;
}
public static void Main()
double dblPrice = 14.99;
double dblTotal;
dblTotal = CalculateTotalPrice(dblPrice);
Console.WriteLine("Sub total: " + dblPrice.ToString("C"));
Console.WriteLine("Total: " + dblTotal.ToString("C"));