Answer to Question #15737 in C# for ruhi
2012-10-01T09:49:24-04:00
define a console application project to display the different formatting styles used in display methods(i.e.console.writeLine())
1
2012-10-02T07:34:53-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 !
Learn more about our help with Assignments:
C#
Comments
Leave a comment