Wednesday, 24 April 2013

1. 2. 3. 4. Write a program that displays a menu as shown in the following figure. The program should implement the following features: If the user enters the option 1, the program should display "This application will allow you to create a pattern in pyramid structure.". If the user enters option 2, then the program should display "This application will allow you to add two primary colors and displays the third color.". If the user enters option 3, the program should display "This application will allow you to create a meaningful word from jumbled letters.". If the user enters option 4, the program should display "This application will allow you to create multiple words from a single word. Each correct word will increase your score by 1.". (Duration: 30 min)


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

namespace MenuApplication
{
    class menu
    {
        int no;
        public void displayMenu()
        {
            Console.WriteLine("\n\n\n");
            Console.WriteLine("\t\t***************APPLICATION MENU**********************");
            Console.WriteLine("\n");
            Console.WriteLine("\t\t\t1.CREATE PATTERNS\n\t\t\t4.PUZZLE COLORS\n\t\t\t3.JUMBLED WORDS\n\t\t\t4. PUZZLE");
            Console.WriteLine("\n************************************************");
        }
        public void AcceptData()
        {
            Console.WriteLine("\n\t\tPlease enter the application number for the details:");
            no = Convert.ToInt32(Console.ReadLine());
            switch (no)
            {

                case 1: Console.WriteLine("This application will allow you to create a primary in pyramid structure.");
                    break;
                case 2: Console.WriteLine("This application will allow you to add two primary colors and display the third color.");
                    break;
                case 3: Console.WriteLine("This application will allow you to create a meaningful word from jumbled letters.");
                    break;
                case 4: Console.WriteLine("This application will allow you to create multiple words from a single word.\nEach correct word will increase your score by 1.");
                    break;
                default: Console.WriteLine("Not a valid menu number");
                    break;
            }
        }
        static void Main(string[] args)
        {
            menu menu = new menu();
            menu.displayMenu();
            menu.AcceptData();
        }
    }
}

No comments:

Post a Comment