Write a program that shows the formatted retail price of items when there is a 15% markup. Test the program by performing a compile-time initialization with Ruggy Shoes, which has a wholesale price of $52.00. Display appropriately labeled retail and wholesale values for the shoes. Once you get that running, go back into your source code, add lines of code that will reassign the memory location’s values for a Teno Jacket, which has a wholesale price of $71.00. Add additional lines of code, which will display the new information.
Explanation:
Program:
// Create a class named FormatedRetailPrice
class FormatedRetailPrice
{
// Create a main method to run the program
static void Main(string[] args)
{
// Declare a string variable named itemName to store the item name
string itemName = "Ruggy Shoes";
// Declare a double variable named wholeSalePrice to store the whole sale price.
double wholeSalePrice = 52.00;
// Display item name
Console.WriteLine("Item: " + itemName);
// Display whole sale price
Console.WriteLine("Whole Sale Price: " + string.Format("{0:0.00}", wholeSalePrice));
// Display retail price.
Console.WriteLine("RetailPrice: " + string.Format("{0:0.00}", (wholeSalePrice + (wholeSalePrice * 0.15))));
// The following lines of code is used to reassign the
// memory location vlaues for a Teno Jacket.
itemName = "Teno Jacket";
wholeSalePrice = 71.50;
Console.WriteLine();
// Display item name
Console.WriteLine("Item: " + itemName);
// Display whole sale price
Console.WriteLine("Whole Sale Price: " + string.Format("{0:0.00}", wholeSalePrice));
// Display retail price.
Console.WriteLine("RetailPrice: " + string.Format("{0:0.00}", (wholeSalePrice + (wholeSalePrice * 0.15))));
Console.ReadKey();
}
}
Output:
Item: Ruggy Shoes
Whole Sale Price: 52.00
RetailPrice: 59.80
Item: Teno Jacket
Whole Sale Price: 71.50
RetailPrice: 82.23