Answer to Question #12194 in C# for Cherry blossom

Question #12194
The cost of a brand new car is P420,000 for GL model and P3398,000 XL model. If a car phone will be installed, an additional P40,000 will be added to the cost. Moreover, 15% discount on the total cost will be given if the buyer pays in full(not installment), Write a Program that would input the car model bought, whether with car phone, use code ‘’W’’ for with car phone and ‘’O’’ for without car phone) and whether it will be paid in full(use code’’F’’ for full payments and ‘’I’’ for instalment).Program must then output the cost of the car.
1
Expert's answer
2012-07-26T08:50:48-0400
String model;
char phone;
char
paid;
double cost=0;
Console.WriteLine("Enter
model: ");
model = Console.ReadLine();
if (model
== "GL")
{
cost = 420000;

}
if (model == "XL")
{
cost =
3398000;
}
Console.WriteLine("Car phone:
");
phone = char.Parse(Console.ReadLine());
if
(phone == 'W')
{
cost = cost +
40000;
}
Console.WriteLine("Full or instalment:
");
paid = char.Parse(Console.ReadLine());
if
(paid == 'F')
{
cost = cost - 0.15 *
cost;
}
Console.WriteLine("Cost: " + cost);

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS