// Directions: Intermediate #3-2
// 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 variable.
// 3) Create a new Method called CalculateTotalPrice before the Main method.
// a) Add a By Value input parameter for price.
// b) Add a By Reference input parameter for total.
// b) Method should be a void.
// 4) Call the method from the Main Method and pass in dblPrice By Value and dblTotal By Reference.
// 5) Output the Total as Currency.
// 6) Results:
// The SubTotal for the item is: ¤14.99
// The Total for the item is: ¤15.74
// 6) Submit your dotnetfiddle link in Blackboard.
using System;
public class Program
{
//Create method
public static void CalculateTotalPrice(double dblOriginalPrice, ref double dblTotal)
//Calculate dblTotal
dblTotal = dblOriginalPrice * 1.05;
}
public static void Main()
//Declare variables
double dblPrice = 14.99;
double dblTotal = 0;
//Call CalculateTotalPrice
CalculateTotalPrice(dblPrice, ref dblTotal);
//Output value to console as currency
Console.WriteLine(dblTotal.ToString("C"));