Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: Icons.... Pin
MarkB7774-Feb-08 16:50
MarkB7774-Feb-08 16:50 
GeneralGetting midnight out of a calendar control Pin
kozu4-Feb-08 15:04
kozu4-Feb-08 15:04 
GeneralRe: Getting midnight out of a calendar control Pin
Christian Graus4-Feb-08 17:12
protectorChristian Graus4-Feb-08 17:12 
GeneralRe: Getting midnight out of a calendar control Pin
Vikram A Punathambekar4-Feb-08 17:52
Vikram A Punathambekar4-Feb-08 17:52 
AnswerRe: Getting midnight out of a calendar control Pin
Vikram A Punathambekar4-Feb-08 17:44
Vikram A Punathambekar4-Feb-08 17:44 
GeneralRe: Getting midnight out of a calendar control Pin
J4amieC4-Feb-08 22:41
J4amieC4-Feb-08 22:41 
GeneralRe: Getting midnight out of a calendar control Pin
Vikram A Punathambekar5-Feb-08 0:30
Vikram A Punathambekar5-Feb-08 0:30 
GeneralI need help with a program Pin
Alex5014-Feb-08 11:54
Alex5014-Feb-08 11:54 
Hello, I need to write a program that has an output:

:

1. The total cost of all the items
2. The total sales tax, which is 8% of the total cost

The gratuity (tip). Most people tip either at the 15%, 20%, or 25% level, so tell the user what the 15% tip is, the 20% tip is, and the 25% tip is



I wrote everything but I do not know how to add a tip as a 15, 20 and 25 percent, so could someone help me out.


class Program

{

static void Main(string[] args)

{

// Price of items

const decimal PriceOnePizza = 0.95M;

const decimal PriceAPairOfHamburger = 2.95M;

const decimal PriceOneHotDog = 4.55M;

const decimal TaxRate = 0.08M; // 5.75%

// Customer personal infoirmation

// Unsigned numbers to represent cleaning items

uint NumberOfPizza, NumberOfHamburger, NumberOfHotDog;

// Each of these sub totals will be used for cleaning items

// Values used to process an order

decimal TotalOrder, TaxAmount, SalesTotal;

Console.WriteLine("-/- Arbys Restaurant -/-");

// Request customer information from the user

// Request the quantity of each category of items

Console.Write("Number of Pizza: ");

string strPizza = Console.ReadLine();

NumberOfPizza = uint.Parse(strPizza);

Console.Write("Number of Hamburger: ");

string strHamburger = Console.ReadLine();

NumberOfHamburger = uint.Parse(strHamburger);

Console.Write("Number of Dresses: ");

string strHotDog = Console.ReadLine();

NumberOfHotDog = uint.Parse(strHotDog);

// Perform the necessary calculations

// Calculate the "temporary" total of the order

// Calculate the tax amount using a constant rate

TaxAmount = TotalOrder * TaxRate;

// Add the tax amount to the total order

SalesTotal = TotalOrder + TaxAmount;

// Communicate the total to the user...

Console.Write("\nThe Total order is: ");

Console.WriteLine(SalesTotal);

// and request money for the order

// Display the receipt

Console.WriteLine("====================================");

Console.WriteLine("-/- Arbys Restaurant -/-");

Console.WriteLine("====================================");

Console.Write("Customer: ");

Console.WriteLine("------------------------------------");

Console.WriteLine("Item Type Qty Unit/Price Sub-Total");

Console.WriteLine("------------------------------------");

Console.Write("Shirts ");

Console.Write(NumberOfPizza);

Console.Write(" ");

Console.Write(PriceOnePizza);

Console.Write(" ");

Console.Write(NumberOfHamburger);

Console.Write(" ");

Console.Write(PriceAPairOfHamburger);

Console.Write(" ");

Console.Write(NumberOfHotDog);

Console.Write(" ");

Console.Write(PriceOneHotDog);

Console.Write(" ");

Console.Write("Total Order: ");

Console.WriteLine(TotalOrder);

Console.Write("Tax Rate: ");

Console.Write(TaxRate * 100);

Console.WriteLine('%');

Console.Write("Tax Amount: ");

Console.WriteLine(TaxAmount);

Console.Write("Total Amount: ");

Console.WriteLine(SalesTotal);

Console.WriteLine("------------------------------------");

Console.WriteLine("====================================");

}

}

}
GeneralRe: I need help with a program Pin
Christian Graus4-Feb-08 12:31
protectorChristian Graus4-Feb-08 12:31 
GeneralRe: I need help with a program Pin
DaveyM694-Feb-08 12:34
professionalDaveyM694-Feb-08 12:34 
GeneralRe: I need help with a program Pin
Christian Graus4-Feb-08 17:13
protectorChristian Graus4-Feb-08 17:13 
GeneralGet Font width in windows form Pin
Leo Smith4-Feb-08 9:00
Leo Smith4-Feb-08 9:00 
GeneralRe: Get Font width in windows form Pin
Ennis Ray Lynch, Jr.4-Feb-08 9:17
Ennis Ray Lynch, Jr.4-Feb-08 9:17 
GeneralRe: Get Font width in windows form Pin
Leo Smith4-Feb-08 10:33
Leo Smith4-Feb-08 10:33 
Generalsql server Urgent!!!! Pin
netJP12L4-Feb-08 8:54
netJP12L4-Feb-08 8:54 
GeneralRe: sql server Urgent!!!! Pin
snorkie4-Feb-08 9:35
professionalsnorkie4-Feb-08 9:35 
GeneralRe: sql server Urgent!!!!....Thanks You ROCKED........... Pin
netJP12L4-Feb-08 10:06
netJP12L4-Feb-08 10:06 
GeneralRe: sql server Urgent!!!! Pin
Not Active4-Feb-08 14:06
mentorNot Active4-Feb-08 14:06 
GeneralDate Pin
simworld4-Feb-08 6:55
simworld4-Feb-08 6:55 
GeneralRe: Date Pin
J$4-Feb-08 7:12
J$4-Feb-08 7:12 
GeneralRe: Date Pin
simworld4-Feb-08 7:32
simworld4-Feb-08 7:32 
GeneralRe: Date Pin
J$4-Feb-08 8:01
J$4-Feb-08 8:01 
GeneralRe: Date Pin
PIEBALDconsult4-Feb-08 13:58
mvePIEBALDconsult4-Feb-08 13:58 
GeneralRe: Date Pin
DaveyM694-Feb-08 8:14
professionalDaveyM694-Feb-08 8:14 
GeneralRe: Date Pin
snorkie4-Feb-08 8:20
professionalsnorkie4-Feb-08 8:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.