using System

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cinema
{

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

public enum status {
Available,
Sold,
}

class Program
{
// Decleration

static bool box = new bool3;
static bool, hall = new bool6, 5;
static bool, gallery = new bool4, 5;
static int b = 0; static int h = 0; static int g = 0;

static void Main(string args)
{

// Array initialize

for (int i = 0; i < 3; i++)
{
boxi = true;
}

for (int i = 0; i < 6; i++)
{
for (int j = 0; j < 5; j++)
{
halli,j = true;
}

}

for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 5; j++)
{
galleryi, j = true;
}

}

char input;
int revenue = 0;

// Program

do
{
//int b_max = 3; int h_max = 30; int g_max = 20;

Console.WriteLine("Welcome to My Cinema (Revenue=Rs." + revenue + ", Box# " + b + ", Hall#" + h + ", Gallery#" + g + ")");

Console.WriteLine("
Box(Rs.3000)");

for (int i = 0; i < 3; i++)
{
if (boxi == true)
Console.Write(i + 1 + "- "+status.Available);
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.Write(i + 1 + "- "+status.Sold + " ");
Console.ForegroundColor = ConsoleColor.White;

}
}
Console.WriteLine();

Console.WriteLine("
Hall(Rs.500/Ticket)");

for (int i = 0; i < 6; i++)
{
char a = (char) (i + 65); // Get ASCHII code and convert into Character.

Console.Write(a +": ");
for (int j = 0; j < 5; j++)
{
if(halli, j == true)
Console.Write(j + 1 + "- "+status.Available);
else
Console.Write(j + 1 + "- "+status.Sold + " ");
}
Console.WriteLine();
}

Console.WriteLine("
Gallery(Rs.700/Ticket)");
for (int i = 0; i < 4; i++)
{
char a = (char)(i + 65);
Console.Write(a + ": ");
for (int j = 0; j < 5; j++)
{
if (galleryi, j == true)
Console.Write(j + 1 + "- " + status.Available + " ");
else
Console.Write(j + 1 + "- " + status.Sold + " ");
}
Console.WriteLine();

}

Console.Write("Want to purchase ticket (y/n):");
input = (char) Console.Read();
Console.Read();
if (input == 'y' || input == 'Y')
{

Console.ReadLine();
Console.Write("Ticket Type (Box, Hall, Gallery):");
string type = Console.ReadLine();

switch (type)
{
case "box" : case "Box":
revenue += bo();
break;
case "hall": case "Hall":
revenue += ha();
break;
case "gallery": case "Gallery":
revenue += gal();
break;
default:
break;
}
}

} while (input == 'y' || input == 'Y');

}

public static int ha()
{
int sum = 0;

int no_of_ticket = 0; int row = 0; int seat = 0;

Console.Write("Number of Tickets want to buy: ");
no_of_ticket = Convert.ToInt32( Console.ReadLine());

for (int i = 0; i < no_of_ticket; i++)
{

Console.Write("Seat Information (Row# Seat#): ");
row = Convert.ToInt32(Console.Read());
seat = Convert.ToInt32( Console.ReadLine());

if (hallrow – 65, seat – 1 == true)
{
hallrow – 65, seat – 1 = false;
Console.WriteLine("Seat is booked");
sum = sum + 500;
}
else {
Console.WriteLine("Seat is Already Booked");
i–;
}

}
h += no_of_ticket;

return sum;
}

public static int bo()
{
int sum = 0;

Console.Write("Enter the box you want to Buy: ");
int box_no = Convert.ToInt32(Console.ReadLine());

if (boxbox_no – 1 == true)
{
boxbox_no – 1 = false;
Console.WriteLine("Box is booked");
sum = 3000;
b++;
}
else {
Console.WriteLine("Box is Already booked");
}

return sum;
}

public static int gal()
{
int sum = 0;

int no_of_ticket = 0; int row = 0; int seat = 0;

Console.Write("Number of Tickets want to buy: ");
no_of_ticket = Convert.ToInt32(Console.ReadLine());

for (int i = 0; i < no_of_ticket; i++)
{

Console.Write("Seat Information (Row# Seat#): ");
row = Convert.ToInt32(Console.Read());
seat = Convert.ToInt32(Console.ReadLine());

if (galleryrow – 65, seat – 1 == true)
{
galleryrow – 65, seat – 1 = false;
Console.WriteLine("Seat is booked");
sum = sum + 700;
}
else
{
Console.WriteLine("Seat is Already Booked");
i–;
}

}
g += no_of_ticket;

return sum;

}
}
}

x

Hi!
I'm Delia!

Would you like to get a custom essay? How about receiving a customized one?

Check it out