Wednesday, 30 December 2015

Asp.net & MVC Lab@16

1.As a part of the software development team, you have been assigned the task of deploying the Web application for GiftGallery on an IIS server. You have decided to test the deployment on the IIS server on your local machine and make any required change before deploying it to the production server. 

Prerequisite: To perform this activity, you must be logged on as the Administrator. In addition, to perform this activity, you need to use the GiftGallery.zip file.


Ans.https://drive.google.com/open?id=0B-yL1mP3zqTbZ3dfQlpGek4wOHc

2.As a part of the software development team, you have been assigned the task of deploying the Web application for GiftGallery on an IIS server by creating a deployment package.


 Prerequisite: To perform this activity, you must be logged on as the Administrator. In addition, you need to use the GiftGallery.zip file.


Ans.https://drive.google.com/open?id=0B-yL1mP3zqTbWnhEZkNCcWtNUms

Monday, 21 December 2015

C# Notes & Sum Projects.


  • Days_Week


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int num;
            Console.WriteLine("Enter a number between 1 to 7");
            num = Convert.ToInt32(Console.ReadLine());
            switch (num)
            {
                case 1:
                    Console.WriteLine("Monday");
                    break;
                case 2:
                    Console.WriteLine("Tuesday");
                    break;
                case 3:
                    Console.WriteLine("Wednesday");
                    break;
                case 4:
                    Console.WriteLine("Thursday");
                    break;
                case 5:
                    Console.WriteLine("Friday");
                    break;
                case 6:
                    Console.WriteLine("Saturday");
                    break;
                case 7:
                    Console.WriteLine("Sunday");
                    break;
                default:
                    Console.WriteLine("You have entered an invalid number");
                    break;
            }
            Console.ReadLine();

        }
    }
}

  • divisibleby 5 :-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int a ;
            Console.WriteLine("Enter any number");
            a = Convert.ToInt32(Console.ReadLine());
            if (a % 5 == 0)
            {
                Console.WriteLine("The number is divisible by 5");
            }

            else
                {
                    Console.WriteLine("The number is not divisible by 5");
            }

            Console.ReadLine();

        }
    }
}

  • Even_Odd


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int i, num;
            Console.WriteLine("Enter five numbers");
            for (i = 0; i <= 4; i++)
            {
                num = Convert.ToInt32(Console.ReadLine());
                if (num % 2 == 0)
                {
                    Console.WriteLine("This number is EVEN");
                }
                else
                {
                    Console.WriteLine("This number is ODD");
                }
            }
            Console.ReadLine();
        }
    }
}


  • Genric


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

namespace ConsoleApplication1
{
    public class classData<T>
    {
        public T data;
        public T value
        {
            get
            {
                return this.data;
            }
            set
            {
                this.data = value;
            }
        }
    }


    class Test
    {
        static void Main(string[] args)
        {
            classData<string> name = new classData<string>();
            name.value = ".net";
            classData <float> version = new classData<float>();
            version.value = 4.5F;
            Console.WriteLine(name.value);
            Console.WriteLine(version.value);
        }
    }
}

  • Hello Print :-

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello");
            Console.ReadLine();
        }
    }
}

  • inheritance


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

            class Base
            {
                public Base()
                {
                    Console.WriteLine("Constructor of base class");
                }
                ~Base()
                {
                    Console.WriteLine("Destructor of Base");
                }
            }
        class Derived : Base
        {
            public Derived()
            {
                Console.WriteLine("Constructor of Derived");
            }
            ~Derived()
            {
                Console.WriteLine("Destructor of Derived");
            }
        }
        class BaseDrived
        {
            static int Main(string[] args)
            {
                Derived obj = new Derived();
                return 0;
            }
        }


  • Largest_among_10Nums


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int i, num=0, large=0;
            Console.WriteLine("Enter 10 +ve numbers");
            for (i = 0; i <= 9; i++)
            {
                num = Convert.ToInt32(Console.ReadLine());
                if (num > large)
                {
                    large = num;
                }
            }
            Console.WriteLine("The largest number entered is = " + large);
            Console.ReadKey();
        }
    }
}


  • lyfcircle

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

namespace Destructors
{
    class Calculator
    {
        static int number1, number2, total;
        public void AddNumber()
        {
            total = number1 + number2;
            Console.WriteLine("The Result is {0}", total);
        }
        Calculator()
        {
            number1 = 20;
            number2 = 30;
            total = 0;
            Console.WriteLine("Constructor Invoked");
        }
        ~Calculator() 
        {
            Console.WriteLine("Destructor Invoked ");
        }
        static void Main(string[] args)
        {
            Calculator c1 = new Calculator();
            c1.AddNumber();
            Console.ReadLine();
        }
        Console.ReadKey();

    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int i, j, n;
            Console.WriteLine("Enter the number of rows");
            n = Convert.ToInt32(Console.ReadLine());
            for (i = 1; i <= n; i++)
            {
                for (j = 1; j <= i; j++)
                {
                    Console.Write("1");
                }
                Console.WriteLine();
            }
            Console.ReadLine();
        }
    }
}


  • Num_Pat2

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int i, j, n;
            Console.WriteLine("Enter the number of rows");
            n = Convert.ToInt32(Console.ReadLine());
            for (i = 1; i <= n; i++)
            {
                for (j = 1; j <= i; j++)
                {
                    Console.Write(j);
                }
                Console.WriteLine();
            }
            Console.ReadLine();
        }
    }
}


  • Num_Pat3

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int i, j, n, k = 1;
            Console.WriteLine("Enter the number of rows");
            n = Convert.ToInt32(Console.ReadLine());
            for (i = 1; i <= n; i++)
            {
                for (j = i; j <= 2 * i - 1; j++)
                {
                    Console.Write(k);
                    k++;

                }
                Console.WriteLine();
            }
            Console.ReadLine();
        }
    }
}




  • Num_Pat4


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int i, j, k, n,p=1;
            Console.WriteLine("Enter the number of rows");
            n = Convert.ToInt32(Console.ReadLine());
            for (i = 1; i <= n; i++)
            {
                for (j = 1; j <= n - i; j++)
                {
                    Console.Write(" ");
                }
                for (k = 1; k <= 2 * i - 1; k++)
                {
                    Console.Write(p);
                    p++;
                }
                Console.WriteLine();
            }
            Console.ReadLine();
        }
    }
}



  • object

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

namespace Calc
{
    class Calculator
    {
        int num1, num2, total;
        public void initialize()
        {
            num1 = 10;
            num2 = 20;
        }
        public void addnum()
        {
            total = num1 + num2;
        }
        public void displaynum()
        {
            Console.WriteLine(" The total is  :" + total);

        }

        static void Main(string[] args)
        {
            Calculator cl = new Calculator();
            cl.initialize();
            cl.addnum();
            cl.displaynum();
            Console.ReadLine();

        } 
    }
}


  • Pro_Div_Mod_2Nums


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, pro, div, mod;
            Console.WriteLine("Enter two numbers");
            a = Convert.ToInt32(Console.ReadLine());
            b = Convert.ToInt32(Console.ReadLine());
            pro = a * b;
            div = a / b;
            mod = a % b;
            Console.WriteLine("The Product of the numbers is = " + pro);
            Console.WriteLine("The Division of the numbers is = " + div);
            Console.WriteLine("The Modulus of the numbers is = " + mod);
            Console.ReadLine();
        }
    }
}


  • Sum_Avg_5Nums

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, c, d, e, sum;
            float avg;
            Console.WriteLine("Enter Five Numbers");
            a = Convert.ToInt32(Console.ReadLine());
            b = Convert.ToInt32(Console.ReadLine());
            c = Convert.ToInt32(Console.ReadLine());
            d = Convert.ToInt32(Console.ReadLine());
            e = Convert.ToInt32(Console.ReadLine());
            sum = a + b + c + d + e;
            avg = sum / 5;
            Console.WriteLine("The Sum of numbers is =" + sum);
            Console.WriteLine("The Average of numbers is =" + avg);
            Console.ReadLine();
        }
    }
}

Friday, 18 December 2015

LBEPS Notes 2

 1.Draw a flowchart to accept the principle, rate, and time values and display the simple interest.


Ans.




2.         Draw a flowchart that accepts a number and displays its cube.

Ans




3.         Draw a flowchart that accepts the length and breadth of a rectangle and displays its area and perimeter.


Ans



4.   Draw a flowchart that accepts a number and checks whether it’s positive, negative, or zero.

Ans





5.    Draw a flowchart that accepts a number and checks if the number is prime.


Ans





6.   Draw a flowchart that prints the following Fibonacci series: 0 1 1 2 3 5 8.


Ans




7.   Draw a flowchart that prints the following series: 1 2 4 8 16 32


Ans



LBEPS Notes 1


1..LBEPS_01_Let's Practice_Solution




1.          Identify the input, processing, and output phases in the following tasks:
l   Calculating the sum of two numbers using a calculator.

Solution:
w   Input:  
First number
‘+’ operator
Second number
‘=’ operator
w   Process:
Calculation of the sum
w   Output:
Sum of the two numbers

l   Obtaining the juice of a fruit using a juicer machine.

Solution:
w   Input:
Fruit
w   Process:
Extraction of the juice
w   Output:
The juice of the fruit

l   Creating knitwear.

Solution:
w   Input:
Knitting wool
w   Process:
Knitting the sweater
w   Output:
Sweater or knitwear

l   Baking bread.

Solution:
w   Input:
Flour, water, flat base, and rolling pin

w   Process:
Kneading the dough using flour and water
Rolling the bread
Baking the bread
w   Output:
Bread

l   Washing clothes in a washing machine.

Solution:
w   Input:
Dirty clothes
Detergent
Water
w   Process:
Washing the clothes
w   Output:
Clean clothes
1.2 Let’s Practice

1.          Write an algorithm to find out whether a number entered by a user is divisible by 5.

Solution:

Step 1: Start the algorithm.
Step 2: Accept a number.
Step 3: Divide the number by 5.
Step 4: If the remainder is 0, the number is divisible by 5.
Step 5: If the remainder is not 0, the number is not divisible by 5.
Step 6: End the algorithm.

2.         Write an algorithm to display the first 10 multiples of 9.

Solution:
Step 1: Start the algorithm.
Step 2: Display 9*1.
Step 3: Display 9*2.
Step 4: Display 9*3.
Step 5: Display 9*4.
Step 6: Display 9*5.
Step 7: Display 9*6.
Step 8: Display 9*7.
Step 9: Display 9*8.
Step 10: Display 9*9.
Step 11: Display 9*10.
Step 12: End the algorithm.

3.         Write an algorithm to find out whether a number entered by a user is even or odd.

Solution:
Step 1: Start the algorithm.
Step 2: Accept a number.
Step 3: Divide the number by 2.
Step 4: If the remainder is 0, the number is even.
Step 5: If the remainder is not 0, the number is odd.
Step 6: End the algorithm.

4.        Write an algorithm to accept two numbers from the user, subtract the first number from the second number, and display the result.

Solution:
Step 1: Start the algorithm.
Step 2: Get the first number.
Step 3: Get the second number.
Step 4: Subtract the first number from the second number.
Step 5: Display the result.

Step 6: End the algorithm.

Wednesday, 9 December 2015

LBEPS lab@Home 10

1. Write a pseudocode to display the following matrix.

11 15 12
6 9 32 12
34 23 54 78
 9 8 7 5 3
(Duration: 15 Minutes)


Ans


begin
numeric row , col
numeric array [4][4] = {
{11,15,12,6},
{9,32,12,34},
{23,54,78,9},
{8,7,5,3}
}

display "The matrix is:"
for (row=0;row<4;row=row+1)
begin
display newline
for (col=0;col<4;col=col+1)
begin
display array [row][col]
display ''
end
end
end


2.Write a pseudocode to print the element that occurs most frequently in a given array. (Duration: 15 Minutes)



Ans  

begin
numeric arr[]={1,3,4,5,1}
numeric i, counter=0,MostFrequent, val, j, maxfrequency=0

for(i=0;i<5;i=i+1)
begin
counter=0
val=arr[i]
for(j=i+1;j<5;j=j+1)
begin
if(arr[j]==val)
begin
counter=counter+1
end
end
if( counter>maxFrequency)
begin
maxFrequency=counter
Mostfrequent=val
end
end
display "The element that occurs most frequent is"
display Mostfrequent
end



3.Write a pseudocode to find the largest number from the following array: {2,8,4,3,7} (Duration: 10 Minutes)



Ans   begin
numeric array[5]= {2,8,4,3,7}
numeric maximum, size, c, lopcation=1;
maximum=array[0];
for ( c=1;c<5;c++)
begin
if( array[c]>maximum)
begin
maximum=arra[c];
location=c+1;
end
end
display "maximum element is present at location number"
display location
display "The value of the maximum element is"
display maximum
end




4.Write a pseudocode to count the duplicate values in an array of size 10. (Duration: 10 Minutes)



Ans     begin
numeric a[]={1,2,3,4,5,6,6,8,9,9}
numeric count=0
numeric i,k;
for( i=0;i<10,i++)

begin
for (k=i+1;k<10;k++)
begin
if(a[k]==a[i])
begin
display "duplicate element;"
dispaly a[k]
count=count+1
end
end
end
display "The number of duplicate values in the array are"
display count
end



5.Write a pseudocode to find the average of the elements in the following array: {3,4,5,6,7} (Duration: 10 Minutes)




Ans  begin
numeric array[5]={3,4,5,6,7}
numeric sum, average

for(i=0;i<5;i=i+1)
begin
sum=sum+array[i]
end
average=sum/5
display "The average of the elements in the given array is:"
display average
end



6.Write a pseudocode to display the fifth element of an array of size 10. (Duration: 10 Minutes)


Ans  begin
numeric array[10],i

display "Enter the elements of the array"
for(i=0;i<10;i=i+1)
begin
accept array[i]
end

display " The fifth element of the array is:"
display array[4]
end



7.Write a pseudocode to print all the numbers greater than the average of the numbers given in an array of size 10. (Duration: 15 Minutes)



Ans   begin
numeric array[10]
numeric sum, average,i

display "Enter the elements of the array"
for (i=0;i<10;i=i+1)
begin
accept array [i]
end
for (i=0;i<10;i=i+1);
begin
sum=sum+array[i];
end
average=sum/10;
display "The numbers greater than the average of the given array are:"
for (i=0;i<10;i++)
begin
if (array[i]>average)
begin
display array[i]
end
end
end



8.Write a pseudocode to concatenate two arrays containing elements in ascending order to create a new array containing elements in ascending order. (Duration: 15 Minutes)



Ans   begin
numeric x=0, y=0, z=0, i
numeric array1[]={1,2,3,4}
numeric array2[]={5,6,7,8}
numeric concatarray[8]
while(x<=3 && y<=3)
begin
if(array1[x]< array2[y])
begin
concatarray[z]=array1[x];
x=x+1
end
else
begin
concatarray[z]=array2[y],
y=y+1
end
z=z++
end
while(x<4)
begin
concatarray[z]=array1[x]
x++
Z++
end
while(y<4)
begin
concatarray[z]=zrray2[y]
y++
z++
end
display " The concatenated array is:"
for(i=0;i<8;i++)
begin
display concatearray[i]
end
end