Notes
Notes - notes.io |
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _odev2
{
class sinema
{
public class biletSat
{
int toplam1 = 0;
int toplam2 = 0;
public int Toplam1
{
get
{
return toplam1;
}
set
{
toplam1 = value;
}
}
public int Toplam2
{
get
{
return toplam2;
}
set
{
toplam2 = value;
}
}
public int Biletiptal(int a)
{
int x,ogrenci=0,tam=0,secim;
Console.WriteLine("Kaç tane bilet iptal ediceksiniz = ");
x = Convert.ToInt16(Console.ReadLine());
if (Toplam1+Toplam2!=0)
{
for (int i = 0; i < x; i++)
{
Console.WriteLine("[0]-öğrenci n[1]-tam seçiniz");
secim = Convert.ToInt16(Console.ReadLine());
switch (secim)
{
default:
Console.WriteLine("Hatalı seçim yaptınız..");i -= 1;
break;
case 0: ogrenci += 1; break;
case 1: tam += 1; break;
}
}
if (Toplam1-ogrenci*15>=0 && Toplam2-tam*25>=0)
{
Toplam1 -= ogrenci * 15;
Toplam2 -= tam * 25;
a += x;
}
else
{
Console.WriteLine("yeterli sayıda öğrenci veya tam bilet satışı yoktur.");
}
}
else
{
Console.WriteLine("Bilet satışı olmadığı için iptali de olamaz.");
}
return a;
}
public int Biletsat(int a)
{
int x, secim;
Console.WriteLine("Kaç tane bilet alıcaksınız = ");
x = Convert.ToInt16(Console.ReadLine());
if (a - x < 0)
{
Console.WriteLine("Yeterli sayıda boş koltuk yok.");
}
else
{
for (int i = 0; i < x; i++)
{
Console.WriteLine("[0] - Öğrenci n[1] - Tam");
secim = Convert.ToInt16(Console.ReadLine());
if (secim == 1)
{
Toplam2 += 25;
}
else if (secim == 0)
{
Toplam1 += 15;
}
else
{
Console.WriteLine("Hatalı seçim yaptınız.");
i--;
}
}
a = a - x;
}
return a;
}
}
}
class Program
{
static void Main(string[] args)
{
int x = 0, h;
Random rnd = new Random();
h = rnd.Next(20, 40);
int g = h;
sinema.biletSat cine = new sinema.biletSat();
while (x != 5)
{
Console.WriteLine("[1] Bilet Sat ");
Console.WriteLine("[2] Boş Koltuk Sayısını Öğren ");
Console.WriteLine("[3] Bakiye Öğren ");
Console.WriteLine("[4] Bilet İptal Et");
Console.WriteLine("[5] Çıkış ");
Console.WriteLine("[6] Ekranı Temizle ");
x = Convert.ToInt16(Console.ReadLine());
switch (x)
{
default: Console.WriteLine("Hatalı seçim"); break;
case 1: g = cine.Biletsat(g); break;
case 2: Console.WriteLine(g); break;
case 3: Console.WriteLine((cine.Toplam1+cine.Toplam2)); break;
case 4: g=cine.Biletiptal(g);break;
case 5: Console.WriteLine("Çıkış yapıyorsunuz.."); break;
case 6:Console.Clear(); break;
}
}
Console.ReadLine();
}
}
}
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team