Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Practica3_3
  8. {
  9.     class PruebaManual
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Reserva bk1 = new Reserva();
  14.  
  15.            
  16.             Console.Write("Introduzca el NIF (8 caracteres + 1 letra):");
  17.             bk1.Nif = Console.ReadLine();
  18.  
  19.             Console.Write("Intrdoduzca el número de plazas que desea reservar (1 a 50):");
  20.             bk1.NumPlazas = Int32.Parse(Console.ReadLine());
  21.  
  22.             if (bk1.ReservaValida)
  23.                 Console.WriteLine("El NIF " + bk1.Nif + " ha realizado una reserva de " + bk1.NumPlazas + " plazas");
  24.             else
  25.             {
  26.                 if (bk1.Nif == null)
  27.                     Console.WriteLine("El formato del NIF no es correcto");
  28.                 else
  29.                     Console.WriteLine("El número de plazas solicitado no está permitido");
  30.             }
  31.             Console.Read();
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement