Solution:NIIT/GNIIT Sonugiri0032@gmail.com

Tuesday, January 05, 2016

Security Alarm System Project in C# for Beginners

Security Alarm System Project in C# for Beginners


This is the small interesting project for beginners to get motivation in programming. The program performs just like a security alarm system and generates different sounds and peeps on different situations.

Source Code 

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

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Magenta;
            Console.WriteLine("\t\t\tLEP SECURIETY SYSTEM - C#\n\n");
            Console.ForegroundColor = ConsoleColor.DarkGray;
            Console.WriteLine("\t1 : Police \n");
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("\t2: Fire Alarm \n");
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("\t3: Earthquake \n");
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("\t Press the Button for help\n");
            int s = int.Parse(System.Console.ReadLine());

            Console.ForegroundColor = ConsoleColor.DarkRed;
            switch (s) {
                case 1:
                    for (int i = 0; i < 10; i++) {
                            Console.Write("\a");
                            Console.Write("\tPlz Help us...\t");
            
                        }
                            break;
                case 2:
                    for (int i = 0; i < 10; i++) {
                        System.Media.SystemSounds.Exclamation.Play();
                        Console.Write("\tPlz Help us...\t");

                    }
                        break;
                case 3:
                        for (int i = 0; i < 10; i++)
                        {
                            System.Media.SystemSounds.Hand.Play();
                            Console.Write("\tPlz Help us...\t");
                        }
                        break;
                default: 
                    
                    break;
            }
            int s1 = Console.Read();
            Console.WriteLine("\a");
        }
    }
}

Output of the Program

security alarm system in C#
Share:

Related Posts:

0 comments:

GNIITSOLUTION GNIIT SOLUTION. Powered by Blogger.

Translate

Blog Archive

undefined