Likes

C# LAB at HoM 12

Create a class, Height with two attributes, Feet and Inches. Include the functionality in the class to add two objects of the Height class, as shown in the following example: Height3= Height1 + Height2; Suppose, the object, Height1 contains the value, 5 feet 6 inches and the object, Height2 contains the value, 4 feet 8 inches; then the object Height3 should have the value, 10 feet 2 inches.


using System;
class Height
{
    double feet;
    double inches;
    public Height()
    {
        feet = 0.0;
        inches = 0.0;
    }
    public Height(double feet, double inches)
    {
        this.feet = feet;
        this.inches = inches;
    }
    public static Height operator +(Height d1, Height d2)
    {
        Height h = new Height();
        h.feet = d1.feet + d2.feet;
        h.inches = d1.inches + d2.inches;
        while (h.inches >= 12.0)
        {
            h.feet++;
            h.inches = h.inches - 12.0;
        }
        return h;
    }
    static void Main(string[] args)
    {
        Height d1 = new Height(12.0, 6.8);
        Height d2 = new Height(10, 18.9);
        Height d3 = new Height();
        d3 = d1 + d2;
        Console.WriteLine("feet:" + d3.feet);
        Console.WriteLine("Inches:" + d3.inches);
        Console.ReadLine();
    }
}




John is an accountant at SmartTech Inc., where he performs his day-to-day activities with the help of a computer running the Windows 7 operating system on it. While using this computer, he finds that the appearance of the desktop is not attractive. In addition, if he wants to set a collection of pictures as the background of the desktop, he has to change the pictures manually. Therefore, he wants to apply the Landscapes Aero theme to change the appearance of the desktop. Further, he wants that the background picture of the desktop should change every minute. Further, while using the computer, John has to open multiple applications, such as Notepad, Calculator, Internet Explorer, and Paint. However, he finds it difficult to switch among these applications. Help John to change the appearance of the desktop with the specified theme and to switch among the multiple applications running simultaneously. Hint 1: Use the Personalization link in the Control Panel window to apply the Aero theme. Hint 2: Use the Change picture drop-down list to set the time interval to change the background picture of the desktop.


 1. click start.
2. Go to control panel .
3. In category slect large Icons.
4.Select personalization.
5. The charge the visual and sounds on our computer page is displayed.
6.Select landscape under the aero theme (7).
7.Click the desktop background.
8.The choose your desktop background paes is display.
9.Ensure that check boxes of all the images under teh landscapes(6) section are selected.
10. Ensure that fill is selected.
11.Select 1 min from the change.
12.Click save changes.
13.Close the control pannel window.
14.Selcet start.
15.Select all program.
16.Select Accesories.
17.Select notepad.
18.Click minimize button.
19.Again selcet all program-> select Accessories Select calculator select mininize button.
20.Select Acessories select paint. select minimize.
21.Select enternet exploler, click minimize.
22.Move the cursor to the icon of an application on the task bar.
23.click the icon of aplication on the task bar to maximize it.
24.close all the application.

No comments: