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 on Google Plus

About Asad

Asad Niazi is Software Engineer , Programmer, Web Developer and a young mentor of BloggersTown and PProgramming. Asad Love to writes about Technology, Programming, Blogging and make money online.

14 comments:

  1. Replies
    1. Thanks Bro for appreciating. Keep us visiting to connect with programming world.

      Delete
  2. Great post!

    Useful information worthy of thanks ,

    http://ixgram.com

    ReplyDelete
    Replies
    1. Thanks Poul for showing your interest in our website. Keep us visiting to get more stuff about programming.

      Delete
  3. This content creates a new hope and inspiration with in me. Thanks for sharing article like this. The way you have stated everything above is quite awesome. Keep blogging like this. Thanks.


    SAP training in Chennai

    ReplyDelete
    Replies
    1. Thanks Nainika for your kind words about our blog. Keep us visiting to get more stuff about programming and stay updates.

      Delete
  4. how can i create this program using c programming

    Thank you

    ReplyDelete
    Replies
    1. You just need to change the syntax according to c programming. Logic will remain same to generate the output. Thanks

      Delete
  5. Junaid you can explore the site to get info about the loops in C programming.

    ReplyDelete
  6. Thanks Priya for appreciation.

    ReplyDelete
  7. the LDR so that the voltage across the 6.8k Ohm resistor increases when the voltage across the LDR decreases.Complete Alarms & CCTV

    ReplyDelete
  8. Very informative.Infact cleared several questions and doubts,Thanks.
    home automation mumbai

    ReplyDelete
  9. Smart technology makes easy our life and gives peace of mind. I consider you to choose best and secure smart burglar alarm to protect your home and family from burglaries. It best solution to add smart innovations in home security. Its helpful for every home.

    ReplyDelete
  10. Smart Outsourcing Solutions is the leading web development, ecommerce solution, offshore outsourcing development and freelancing training company in Dhaka Bangladesh please
    visit us: Seo Training In Dhaka
    Seo Training In Bangladesh

    ReplyDelete