Programming in C# Write a program that shows the formatted retail price of shirt
ID: 3846011 • Letter: P
Question
Programming in C#
Write a program that shows the formatted retail price of shirts when there is a 15% markdown. Test the program by performing a compiletime initialization with an item labeled “Open Collar Running Shirt,” which has a wholesale price of $41.00. How much savings is expected with the markdown? Display appropriately labeled retail and markdown values for the shirt. 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 Razorback T-Shirt, which has a retail price of $36.00. Add additional lines of code, which will display the new item’s information along with the previous item. What happens if the markdown goes to 20% or 10%?
Explanation / Answer
check1.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace check1
{
class Program
{
static void Main(string[] args)
{
double price,markdown;
double s,p;
Console.Write("Enter the price of Open Collar Running Shirt : ");
p = Convert.ToDouble(Console.ReadLine());
Console.Write(" Enter the markdown % : ");
markdown = Convert.ToDouble(Console.ReadLine());
Console.Write(" Open Collar Running Shirt wholesale price = ${0} ",p);
price=p/(1-markdown/100);
s=price*markdown/100;
Console.Write(" Saving on Open Collar Running Shirt = ${0} ",s);
Console.Write(" Open Collar Running Shirt retail price = ${0} ",price);
Console.Write(" Enter a Razorback T-Shirt retail price : ");
price = Convert.ToDouble(Console.ReadLine());
Console.Write(" Enter the markdown % : ");
markdown = Convert.ToDouble(Console.ReadLine());
Console.Write(" Razorback T-Shirt retail price = ${0} ",price);
s=price*markdown/100;
p=price-s;
Console.Write(" Saving on Razorback Shirt = ${0} ",s);
Console.Write(" Razorback Shirt wholesale price = ${0} ",p);
}
}
}
Output :-
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.