Likes

C# LAB at HoM 18.

Ryan wants to make his desktop comfortable to work. For this, he wants the following settings on his computer: The Paint icon should appear on the taskbar. The taskbar should not be visible when the user is working on the applications. Two recently used program icons should be displayed on the Start menu. The Start menu should have the System administrative tools option. Icons of his favorite games, FreeCell and Solitaire, should be available on top of the Start menu so that he does not have to locate them in the All Programs menu. Help Ryan to accomplish the preceding tasks. Hint 1: Change the settings of the taskbar by opening the Taskbar and Start Menu Properties dialog box. Hint 2: Open the Customize Start menu dialog box through the Taskbar and Start Menu Properties dialog box.


Right-click the taskbar.

1.Select properties.
  the taskbar and start menu properties dialog box is displayed.
2.select the Auto-hide the taskbar check box.
3.click the Apply button.
4.Ensure that the Always combine, hide labels option is selected in
   the Taskbar buttons drop-down list.
5.click the Start Menu teb.
6.click the Customize button.
  the Customize Start Menu dialog box is displayed.
7.Type 2 in the Number of recent programs to display spin box.
  Scroll to the end of the list to locate the System administrative
  tools category.
8.select the Display on the All programs menu and the Start menu option.
9.click the OK button.
10.click the OK button.
11.select Start.
12.select All programs.
13.select Accessories.
14.select Paint and then drag it to the taskbar.
     (this is the paint to pin to Taskbar copy stor to dastop to icon to paint paste)
15.You can see the Paint icon on the Taskbar.
16.select Start.
17.select Control Panel.
    the All Control Panel Items window is displayed.
18.Ensure that Category is selected in the view by drop-down list.
19.click the programs link.
    the programs window is displayed.
20.click the Turn Windows features on or off link.
     The Windows Features window is displayed.
21.select the Games check box.
22.click the OK button.
     The Microsoft windows message box is displayed showing the progress bar.
23.close the programs window.
24.select Start.
25.select the All programs.
26.select games.
27.Right-click the FreeCell icon.
28.select pin to start Menu.
29.Right-click the Solitaire icon.
30.select pin to Start Menu.
31.click the Back button.
    the freeCell and Solitaire icons are Displayed
     on the Start menu.





Write a program, to create two custom attributes, BugFixingAttribute and DescriptionAttribute, to be assigned to class members. Add the two attributes together in a single application.


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

namespace Attribute_example
{
        [AttributeUsage(AttributeTargets.Class|AttributeTargets.Constructor|AttributeTargets.Field|AttributeTargets.Method|AttributeTargets.Property,AllowMultiple=true)]
        public class BugFixingAttribute:System.Attribute
        {
            private int bugNo;
            private string developer;
            private string dataFixed;
            public string remarks;
            public BugFixingAttribute(int BugNo,string Developer,string DataFixed)
            {
                this.bugNo=BugNo;
                this.developer=Developer;
                this.dataFixed=DataFixed;
            }
            public int BugNo
            {
                get
                {
                    return bugNo;
                }
            }
            public string DataFixed
            {
                get
                {
                    return dataFixed;
                }
            }
            public string Developer
            {
                get
                {
                    return Developer;
                }
            }
            public string Remarks
            {
                get
                {
                    return remarks;
                }
               set
                {
                    remarks= value;
                }
            }
        }
        [BugFixingAttribute(125,"Sara Levo","18/06/2012",Remarks="Return object not specified")]
        public class Calculator
        {
            public double Add(Double num1,Double num2)
            {
                return num1+num2;
            }
            public double subtract(Double num1,Double num2)
            {
                return num1-num2;
            }
            [BugFixingAttribute(155,"Sara Levo","20/06/2012")]
            public double Divide(Double num1,Double num2)
            {
                return num1*num2;
                ;
            }
            [BugFixingAttribute(156, "Sara Levo", "20/06/2012")]
            public double divide(Double num1, Double num2)
            {
                return num1 / num2;
            }
        }
        public class EntryPoint
        {
       public static void Main()
        {
            Calculator Myobj=new Calculator();
            Console.WriteLine("The sum of specified two nos are:{0}",Myobj.Add(15,20.5));
            Console.ReadLine();
        }
    }
}

No comments: