0% found this document useful (0 votes)
76 views10 pages

Assignment#01 (C# - 116)

The document is a C# program for a restaurant order and payment system. It lists different chicken meal options with prices in Pakistani rupees. It prompts the user to enter a meal choice and quantity in kg. Based on the currency selected (dollar, euro, rupees), it calculates the pre-tax price, sales tax, and total price in the selected currency. The program contains if/else statements to handle the different meal and currency options.

Uploaded by

Ali Hassan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views10 pages

Assignment#01 (C# - 116)

The document is a C# program for a restaurant order and payment system. It lists different chicken meal options with prices in Pakistani rupees. It prompts the user to enter a meal choice and quantity in kg. Based on the currency selected (dollar, euro, rupees), it calculates the pre-tax price, sales tax, and total price in the selected currency. The program contains if/else statements to handle the different meal and currency options.

Uploaded by

Ali Hassan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

University of Wah

Department of Computer Science

Advance Programming C#

Assignment #01

Course Instructor: Ma’am Isra Naz


Name: Ali Hassan
Reg: UW-20M-CS-BS-116
University of Wah
Department of Computer Science

Code:
using System;
namespace restaurantorderpaymentsystem
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Code Meal Per kg Price in Pakistani Rupees");
Console.WriteLine("1: Chicken Handi 1800");
Console.WriteLine("2: Chicken Karahi 2000");
Console.WriteLine("3: Chicken Tikka 2200");
Console.WriteLine("4: Chicken Haleem 500");
Console.WriteLine("5: Creamy Chicken 2500");
Console.WriteLine("-----------------------------------------------------");
Console.WriteLine("Enter your Choice Please:");
int choice = int.Parse(Console.ReadLine());
//int meal_price;
String Currency;
if (choice == 1)

{
Console.WriteLine("Orderd Chicken Handi");
Console.WriteLine("Enter the Quantity in Kg");
int Quantity = int.Parse(Console.ReadLine());
//int Price = Quantity * 1800;
Console.WriteLine("Enter the Currency: Dollar,Rupees or Euro");
Currency = (Console.ReadLine());
University of Wah
Department of Computer Science

if (Currency == "Dollar")
{
Console.WriteLine("Price in Dollar...");
int Price_in_dollar = Quantity * 1800 / 100;
Console.WriteLine("Meal Price:" +Price_in_dollar);
float Tax = Price_in_dollar / 100 * 2;
Console.WriteLine("Sales Tax:" + Tax);
float Total_Price = Price_in_dollar + Tax;
Console.WriteLine("Total Price:" + Total_Price);
}
else if (Currency == "Euro")
{
Console.WriteLine("Price in Euro...");
int Price_in_euro = Quantity * 1800 / 90;
Console.WriteLine("Meal Price:" +Price_in_euro);
float Tax = Price_in_euro / 100 * 2;
Console.WriteLine("Sales Tax:" + Tax);
float Total_Price = Price_in_euro + Tax;
Console.WriteLine("Total Price:" + Total_Price);
}
else if (Currency == "Rupees")
{
Console.WriteLine("Price in Rupees...");
int Price_in_Rupees = Quantity * 1800;
Console.WriteLine("Meal Price:" +Price_in_Rupees);
float Tax = Price_in_Rupees / 100 * 2;
Console.WriteLine("Sales Tax:" + Tax);
float Total_Price = Price_in_Rupees + Tax;
University of Wah
Department of Computer Science

Console.WriteLine("Total Price:" + Total_Price);


}

}
else if (choice == 2)
{
Console.WriteLine("Orderd Chicken Karahi");
Console.WriteLine("Enter the Quantity in Kg");
int Quantity = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the Currency: Dollar,Rupees or Euro");
Currency = (Console.ReadLine());
if (Currency == "Dollar")
{
Console.WriteLine("Price in Dollar...");
int Price_in_dollar = Quantity * 2000 / 100;
Console.WriteLine("Meal Price:" +Price_in_dollar);
float Tax = Price_in_dollar / 100 * 2;
Console.WriteLine("Sales Tax:" + Tax);
float Total_Price = Price_in_dollar + Tax;
Console.WriteLine("Total Price:" + Total_Price);
}
else if (Currency == "Euro")
{
Console.WriteLine("Price in Euro...");
int Price_in_euro = Quantity * 2000 / 90;
Console.WriteLine("Meal Price:" +Price_in_euro);
float Tax = Price_in_euro / 100 * 2;
Console.WriteLine("Sales Tax:" + Tax);
University of Wah
Department of Computer Science

float Total_Price = Price_in_euro + Tax;


Console.WriteLine("Total Price:" + Total_Price);
}
else if (Currency == "Rupees")
{
Console.WriteLine("Price in Rupees...");
int Price_in_Rupees = Quantity * 2000;
Console.WriteLine("Meal Price:" +Price_in_Rupees);
float Tax = Price_in_Rupees / 100 * 2;
Console.WriteLine("Sales Tax:" + Tax);
float Total_Price = Price_in_Rupees + Tax;
Console.WriteLine("Total Price:" + Total_Price);
}

}
else if (choice == 3)
{
Console.WriteLine("Orderd Chicken Tikka");
Console.WriteLine("Enter the Quantity in Kg");
int Quantity = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the Currency: Dollar,Rupees or Euro");
Currency = (Console.ReadLine());
if (Currency == "Dollar")
{
Console.WriteLine("Price in Dollar...");
int Price_in_dollar = Quantity * 2200 / 100;
Console.WriteLine("Meal Price:" +Price_in_dollar);
University of Wah
Department of Computer Science

float Tax = Price_in_dollar / 100 * 2;


Console.WriteLine("Sales Tax:" + Tax);
float Total_Price = Price_in_dollar + Tax;
Console.WriteLine("Total Price:" + Total_Price);
}
else if (Currency == "Euro")
{
Console.WriteLine("Price in Euro...");
int Price_in_euro = Quantity * 2200/ 90;
Console.WriteLine("Meal Price:" +Price_in_euro);
float Tax = Price_in_euro / 100 * 2;
Console.WriteLine("Sales Tax:" + Tax);
float Total_Price = Price_in_euro + Tax;
Console.WriteLine("Total Price:" + Total_Price);
}
else if (Currency == "Rupees")
{
Console.WriteLine("Price in Rupees...");
int Price_in_Rupees = Quantity * 2200;
Console.WriteLine("Meal Price:" +Price_in_Rupees);
float Tax = Price_in_Rupees / 100 * 2;
Console.WriteLine("Sales Tax:" + Tax);
float Total_Price = Price_in_Rupees + Tax;
Console.WriteLine("Total Price:" + Total_Price);
}
}
else if (choice == 4)
{
University of Wah
Department of Computer Science

Console.WriteLine("Orderd Chicken Haleem");


Console.WriteLine("Enter the Quantity in Kg");
int Quantity = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the Currency: Dollar,Rupees or Euro");
Currency = (Console.ReadLine());
if (Currency == "Dollar")
{
Console.WriteLine("Price in Dollar...");
int Price_in_dollar = Quantity * 500 / 100;
Console.WriteLine("Meal Price:" +Price_in_dollar);
float Tax = Price_in_dollar / 100 * 2;
Console.WriteLine("Sales Tax:" + Tax);
float Total_Price = Price_in_dollar + Tax;
Console.WriteLine("Total Price:" + Total_Price);
}
else if (Currency == "Euro")
{
Console.WriteLine("Price in Euro...");
int Price_in_euro = Quantity * 500 / 90;
Console.WriteLine("Meal Price:" +Price_in_euro);
float Tax = Price_in_euro / 100 * 2;
Console.WriteLine("Sales Tax:" + Tax);
float Total_Price = Price_in_euro + Tax;
Console.WriteLine("Total Price:" + Total_Price);
}
else if (Currency == "Rupees")
{
University of Wah
Department of Computer Science

Console.WriteLine("Price in Rupees...");
int Price_in_Rupees = Quantity * 500;
Console.WriteLine("Meal Price:" +Price_in_Rupees);
float Tax = Price_in_Rupees / 100 * 2;
Console.WriteLine("Sales Tax:" + Tax);
float Total_Price = Price_in_Rupees + Tax;
Console.WriteLine("Total Price:" + Total_Price);
}

}
else if (choice == 5)
{
Console.WriteLine("Orderd Creemy Chicken");
Console.WriteLine("Enter the Quantity in Kg");
int Quantity = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the Currency: Dollar,Rupees or Euro");
Currency = (Console.ReadLine());
if (Currency == "Dollar")
{
Console.WriteLine("Price in Dollar...");
int Price_in_dollar = Quantity * 2500 / 100;
Console.WriteLine("Meal Price:" +Price_in_dollar);
float Tax = Price_in_dollar / 100 * 2;
Console.WriteLine("Sales Tax:" + Tax);
float Total_Price = Price_in_dollar + Tax;
Console.WriteLine("Total Price:" + Total_Price);
}
else if (Currency == "Euro")
University of Wah
Department of Computer Science

{
Console.WriteLine("Price in Euro...");
int Price_in_euro = Quantity * 2500 / 90;
Console.WriteLine("Meal Price:" +Price_in_euro);
float Tax = Price_in_euro / 100 * 2;
Console.WriteLine("Sales Tax:" + Tax);
float Total_Price = Price_in_euro + Tax;
Console.WriteLine("Total Price:" + Total_Price);
}
else if (Currency == "Rupees")
{
Console.WriteLine("Price in Rupees...");
int Price_in_Rupees = Quantity * 2500;
Console.WriteLine("Meal Price:" +Price_in_Rupees);
float Tax = Price_in_Rupees / 100 * 2;
Console.WriteLine("Sales Tax:" + Tax);
float Total_Price = Price_in_Rupees + Tax;
Console.WriteLine("Total Price:"+Total_Price);
}
}
else
{
Console.WriteLine("ERROR!");

}
}
}
}
University of Wah
Department of Computer Science

Screenshot:

Thank you…..!!!

You might also like