Likes

C# LAB at HoM 15

Sandy has bought a game and wants to install it on his computer, which has Windows 7 operating system installed on it. However, he needs to ensure if his computer meets the minimum processing requirements for the game. In addition, he wants to clean up the unused files of the C: drive of his computer to improve the computer's performance. Help Sandy to accomplish the preceding tasks. Hint 1: The Windows Experience Index link can be used to check the performance capabilities of a computer. Hint 2: The Disk Cleanup utility can be used to delete the unused files from a drive.


1.select start.
2.select Control panel.
The all Control panel ltems window is displayed
3.click the system link.
The system window is displayed
4.click the window Experience index link.
the performance information and Tools window is displayed.
the window displays the score for the different components of the computer.
5.close the performance information and tools window.
6.select start.
7.select all program.
8.select Accessories.
9.select system tools.
10.select Disk Cleanup.
  the Disk Cleanup: Drive selection dialog box is displayed.
  Ensure that the C: drive is selected from the Drives drop-down list.
11.click the OK button.
  the disk Cleanup message is displayed
  the disk Cleanup for (C:) dialog box is displayed.
12.click the OK button.
  the disk Cleanup dialog box is displayed.
13.click the delete Files button.
  the disk Cleanup dialog box is displayed.
  all the unnecessary files are deleted permanently.





David wants to create a ticket booking application for a movie theater. The application should ask the user for his choice, whether he wants to book the tickets or not. The application should also ask the user for the total number of tickets to be booked. While booking the tickets, if the total number of booked tickets exceeds the available tickets, the application should raise an exception and display an appropriate message. Hint: The total number of available tickets is 10.


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

namespace ConsoleApplication9
{
    class TicketLimit
    {
        static void Main(string[] args)
        {
            Summer Summer = new Summer();
            try
            {
                Summer.CalculateTicket();
            }
            catch (TicketLimt e)
            {
                Console.WriteLine(e.Message);
                Console.ReadLine();
            }
        }
    }
    public class TicketLimt : ApplicationException
    {
        public TicketLimt(string massage)
            : base(massage)
        {

        }
    }
    public class Summer
    {
        int TotalTickets = 10;
        int count = 0;
        char choice = 'Y';
        public void CalculatetICKET()
        {
            while (true)
            {
                Console.WriteLine("dO you want to book the tickets(Y/N)");
                choice = Convert.ToChar(Console.ReadLine());
                if (choice == 'Y' || choice == 'Y')
                {
                    Console.WriteLine("Only {0} tickets are available", TotalTickets);
                    Console.WriteLine("enter the number of tickets you want to book");
                    count = Convert.ToInt32(Console.ReadLine());
                    if (count > TotalTickets)
                        throw (new TicketLimt("Tickets not available"));
                    else
                        TotalTickets -= count;
                }
                else
                    break;
            }
        }
    }
}

No comments: