Answer to Question #15669 in C# for Zulekha

Question #15669
define a console application project to display the different formatting styles used in display methods(i.i. console.writeLine())
1
Expert's answer
2012-10-02T07:28:37-0400
using System;
using System.Collections.Generic;
using
System.Linq;
using System.Text;

namespace _15669
{
public
class TipCalculator
{
private const double tipRate =
0.18;
public static int Main(string[] args)

{

double billTotal = 1352.06;
double
tip = billTotal * tipRate;

Console.WriteLine();
Console.WriteLine("Bill
total:\t{0,8:c}", billTotal);
Console.WriteLine("Tip
total/rate:\t{0,8:c} ({1:p1})",
tip, tipRate);

Console.WriteLine(("").PadRight(24, '-'));

Console.WriteLine("Grand total:\t{0,8:c}", billTotal + tip);

Console.ReadLine();
Console.ReadLine();

return 0;
}
}
}

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
New on Blog
APPROVED BY CLIENTS