Solution Idea Code
<html> <head> <title>CS202 Assignment no 2</title> <style> body{ padding:0; margin:0; width:100%; } #mynav{ background-color:black; height:80px; } #mynav a:link, a:visited { background-color: red; color: white; padding: 14px 25px; text-align: center; text-decoration: none; display: inline-block; } #mynav a:hover, a:active { background-color: black; } #firstimage img{ width:100%; height:600px; fill:cover; margin: 0px auto; } #serviceheading{ padding-top:10px; padding-bottom:10px; } #serviceheading h2{ text-align:center; } .servicesection{ width:32%; float:left; padding-left:5px; margin-bottom:5px; } .servicesection img{ width:15%; height:100px; padding-left:80px; margin:2px; } .servicesection h2{ margin: 5px 20px; } #banner1{ background-color:#21E6E0; } #banner2{ background-color:#F91912; } #banner3{ background-color:#58F912; } #myfooter{ width:99%; margin-top:5px; background-color:black; float:left; padding-bottom:100px; } #footer1{ width:41%; margin-left:5px; float:left; } #footer1 h3{ color:Red; padding-left:150px; } #footer1 p{ color:white; } #footer2{ width:41%; margin-left:90px; float:left; } #footer2 h4{ color:green; font-size:25px; } #btn{ background-color:#F91912; } #btn:hover{ background-color:green; } </style> </head> <body> <form action=""> <div id="mynav"> <a href="Home.html">Home</a> <a href="service.html">Service</a> <a href="about.html">About</a> <a href="contactus.html">Contact us</a> </div> <div id="firstimage"> <img src="banner.jpg" alt="Banner Image"> </div> <div id="serviceheading"> <h2>Service</h2> <div class="servicesection" id="banner1"> <img src="camera.PNG" alt="Banner Image"> <h2>Photgraphy</h2> <p> orem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p> </div> <div class="servicesection" id="banner2"> <img src="video.PNG" alt="Banner Image"> <h2>VideoGraphy</h2> <p> orem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p> </div> <div class="servicesection" id="banner3"> <img src="web.PNG" alt="Banner Image"> <h2>Web Design</h2> <p> orem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p> </div> <div id="myfooter"> <div id="footer1"> <h3>About Us</h3> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop </p> </div> <div id= "footer2"> <h4>Contact Us</h4><br> <input type="text" placeholder="name"><br><br> <input type="text" placeholder="Email Addres"><br><br> <textarea rows="4" cols="50"> </textarea><br><br> <button id="btn"> Press Me</button> </div> </div> </form> </body> </html> cs202 assignment solution with internal css in head section.html Displaying cs202 assignment solution with internal css in head section.html.CS508 GDB 1 Solution and Discussion
-
Re: CS508 GDB.1 Solution and Discussion
Total Marks 5
Starting Date Monday, February 15, 2021
Closing Date Tuesday, February 16, 2021
Status Open
Question Title GDB
Question Description
In a programming world, Lambda Expression (i.e. lambda function) is essentially a block of code that can be assigned to a variable, passed as an argument, or returned from a function call. It has been part of several programming languages like Smalltalk, Lisp, Ruby, Scala, Python, Java and C# etc. for quite some time.In context of C# programming, a lambda can be used instead of an anonymous method/function where we do not need to provide access modifier, return type and even name of the method. For example, the following anonymous method checks if a student is teenager or not:
Listing 1: (anonymous method in C# to check if a student is teenager or not)
delegate(Student std) {
return std.Age > 12 && std.Age < 20;
}
While the same functionality can be achieved by using lambda as;
Listing 2: (checking if a student is teenager or not using lambda in C#)
std => std.Age > 12 && std.Age < 20;
Here, we can see that the code has been shortened (i.e. writability increased). However, it makes the code relatively difficult to understand as “std” in listing 2 is ambiguous (i.e. readability decreased). But what about Reliability?
Being a programming language expert, you are required to compare both approaches (i.e. code written with/without lambda) and state which one is better in terms of Reliability in C# programming language.
-
@ozair said in CS508 GDB 1 Solution and Discussion:
Re: CS508 GDB.1 Solution and Discussion
Total Marks 5
Starting Date Monday, February 15, 2021
Closing Date Tuesday, February 16, 2021
Status Open
Question Title GDB
Question Description
In a programming world, Lambda Expression (i.e. lambda function) is essentially a block of code that can be assigned to a variable, passed as an argument, or returned from a function call. It has been part of several programming languages like Smalltalk, Lisp, Ruby, Scala, Python, Java and C# etc. for quite some time.In context of C# programming, a lambda can be used instead of an anonymous method/function where we do not need to provide access modifier, return type and even name of the method. For example, the following anonymous method checks if a student is teenager or not:
Listing 1: (anonymous method in C# to check if a student is teenager or not)
delegate(Student std) {
return std.Age > 12 && std.Age < 20;
}
While the same functionality can be achieved by using lambda as;
Listing 2: (checking if a student is teenager or not using lambda in C#)
std => std.Age > 12 && std.Age < 20;
Here, we can see that the code has been shortened (i.e. writability increased). However, it makes the code relatively difficult to understand as “std” in listing 2 is ambiguous (i.e. readability decreased). But what about Reliability?
Being a programming language expert, you are required to compare both approaches (i.e. code written with/without lambda) and state which one is better in terms of Reliability in C# programming language.
Anonymous Method Limitations
It cannot contain jump statement like goto, break or continue.
It cannot access ref or out parameter of an outer method.
It cannot have or access unsafe code.
It cannot be used on the left side of the is operator. -
@ozair said in CS508 GDB 1 Solution and Discussion:
Re: CS508 GDB.1 Solution and Discussion
Total Marks 5
Starting Date Monday, February 15, 2021
Closing Date Tuesday, February 16, 2021
Status Open
Question Title GDB
Question Description
In a programming world, Lambda Expression (i.e. lambda function) is essentially a block of code that can be assigned to a variable, passed as an argument, or returned from a function call. It has been part of several programming languages like Smalltalk, Lisp, Ruby, Scala, Python, Java and C# etc. for quite some time.In context of C# programming, a lambda can be used instead of an anonymous method/function where we do not need to provide access modifier, return type and even name of the method. For example, the following anonymous method checks if a student is teenager or not:
Listing 1: (anonymous method in C# to check if a student is teenager or not)
delegate(Student std) {
return std.Age > 12 && std.Age < 20;
}
While the same functionality can be achieved by using lambda as;
Listing 2: (checking if a student is teenager or not using lambda in C#)
std => std.Age > 12 && std.Age < 20;
Here, we can see that the code has been shortened (i.e. writability increased). However, it makes the code relatively difficult to understand as “std” in listing 2 is ambiguous (i.e. readability decreased). But what about Reliability?
Being a programming language expert, you are required to compare both approaches (i.e. code written with/without lambda) and state which one is better in terms of Reliability in C# programming language.
Anonymous methods can be used as event handlers: Example: Anonymous Method as Event Handler saveButton.Click += delegate(Object o, EventArgs e) { System.Windows.Forms.MessageBox.Show("Save Successfully!"); };
-
@zaasmi said in CS508 GDB 1 Solution and Discussion:
@ozair said in CS508 GDB 1 Solution and Discussion:
Re: CS508 GDB.1 Solution and Discussion
Total Marks 5
Starting Date Monday, February 15, 2021
Closing Date Tuesday, February 16, 2021
Status Open
Question Title GDB
Question Description
In a programming world, Lambda Expression (i.e. lambda function) is essentially a block of code that can be assigned to a variable, passed as an argument, or returned from a function call. It has been part of several programming languages like Smalltalk, Lisp, Ruby, Scala, Python, Java and C# etc. for quite some time.In context of C# programming, a lambda can be used instead of an anonymous method/function where we do not need to provide access modifier, return type and even name of the method. For example, the following anonymous method checks if a student is teenager or not:
Listing 1: (anonymous method in C# to check if a student is teenager or not)
delegate(Student std) {
return std.Age > 12 && std.Age < 20;
}
While the same functionality can be achieved by using lambda as;
Listing 2: (checking if a student is teenager or not using lambda in C#)
std => std.Age > 12 && std.Age < 20;
Here, we can see that the code has been shortened (i.e. writability increased). However, it makes the code relatively difficult to understand as “std” in listing 2 is ambiguous (i.e. readability decreased). But what about Reliability?
Being a programming language expert, you are required to compare both approaches (i.e. code written with/without lambda) and state which one is better in terms of Reliability in C# programming language.
Anonymous methods can also be passed to a method that accepts the delegate as a parameter.
In the following example, PrintHelperMethod() takes the first parameters of the Print delegate:
Example: Anonymous Method as Parameter public delegate void Print(int value); class Program { public static void PrintHelperMethod(Print printDel,int val) { val += 10; printDel(val); } static void Main(string[] args) { PrintHelperMethod(delegate(int val) { Console.WriteLine("Anonymous method: {0}", val); }, 100); } }
Output:
Anonymous method: 110 -
@ozair said in CS508 GDB 1 Solution and Discussion:
Re: CS508 GDB.1 Solution and Discussion
Total Marks 5
Starting Date Monday, February 15, 2021
Closing Date Tuesday, February 16, 2021
Status Open
Question Title GDB
Question Description
In a programming world, Lambda Expression (i.e. lambda function) is essentially a block of code that can be assigned to a variable, passed as an argument, or returned from a function call. It has been part of several programming languages like Smalltalk, Lisp, Ruby, Scala, Python, Java and C# etc. for quite some time.In context of C# programming, a lambda can be used instead of an anonymous method/function where we do not need to provide access modifier, return type and even name of the method. For example, the following anonymous method checks if a student is teenager or not:
Listing 1: (anonymous method in C# to check if a student is teenager or not)
delegate(Student std) {
return std.Age > 12 && std.Age < 20;
}
While the same functionality can be achieved by using lambda as;
Listing 2: (checking if a student is teenager or not using lambda in C#)
std => std.Age > 12 && std.Age < 20;
Here, we can see that the code has been shortened (i.e. writability increased). However, it makes the code relatively difficult to understand as “std” in listing 2 is ambiguous (i.e. readability decreased). But what about Reliability?
Being a programming language expert, you are required to compare both approaches (i.e. code written with/without lambda) and state which one is better in terms of Reliability in C# programming language.
Anonymous methods can also be passed to a method that accepts the delegate as a parameter.
In the following example, PrintHelperMethod() takes the first parameters of the Print delegate:
Example: Anonymous Method as Parameter public delegate void Print(int value); class Program { public static void PrintHelperMethod(Print printDel,int val) { val += 10; printDel(val); } static void Main(string[] args) { PrintHelperMethod(delegate(int val) { Console.WriteLine("Anonymous method: {0}", val); }, 100); } }
-
@zaasmi said in CS508 GDB 1 Solution and Discussion:
@ozair said in CS508 GDB 1 Solution and Discussion:
Re: CS508 GDB.1 Solution and Discussion
Total Marks 5
Starting Date Monday, February 15, 2021
Closing Date Tuesday, February 16, 2021
Status Open
Question Title GDB
Question Description
In a programming world, Lambda Expression (i.e. lambda function) is essentially a block of code that can be assigned to a variable, passed as an argument, or returned from a function call. It has been part of several programming languages like Smalltalk, Lisp, Ruby, Scala, Python, Java and C# etc. for quite some time.In context of C# programming, a lambda can be used instead of an anonymous method/function where we do not need to provide access modifier, return type and even name of the method. For example, the following anonymous method checks if a student is teenager or not:
Listing 1: (anonymous method in C# to check if a student is teenager or not)
delegate(Student std) {
return std.Age > 12 && std.Age < 20;
}
While the same functionality can be achieved by using lambda as;
Listing 2: (checking if a student is teenager or not using lambda in C#)
std => std.Age > 12 && std.Age < 20;
Here, we can see that the code has been shortened (i.e. writability increased). However, it makes the code relatively difficult to understand as “std” in listing 2 is ambiguous (i.e. readability decreased). But what about Reliability?
Being a programming language expert, you are required to compare both approaches (i.e. code written with/without lambda) and state which one is better in terms of Reliability in C# programming language.
Anonymous methods can access variables defined in an outer function.
Example: Anonymous Method public delegate void Print(int value); static void Main(string[] args) { int i = 10; Print prnt = delegate(int val) { val += i; Console.WriteLine("Anonymous method: {0}", val); }; prnt(100); }
Anonymous method: 110
-
@ozair said in CS508 GDB 1 Solution and Discussion:
Re: CS508 GDB.1 Solution and Discussion
Total Marks 5
Starting Date Monday, February 15, 2021
Closing Date Tuesday, February 16, 2021
Status Open
Question Title GDB
Question Description
In a programming world, Lambda Expression (i.e. lambda function) is essentially a block of code that can be assigned to a variable, passed as an argument, or returned from a function call. It has been part of several programming languages like Smalltalk, Lisp, Ruby, Scala, Python, Java and C# etc. for quite some time.In context of C# programming, a lambda can be used instead of an anonymous method/function where we do not need to provide access modifier, return type and even name of the method. For example, the following anonymous method checks if a student is teenager or not:
Listing 1: (anonymous method in C# to check if a student is teenager or not)
delegate(Student std) {
return std.Age > 12 && std.Age < 20;
}
While the same functionality can be achieved by using lambda as;
Listing 2: (checking if a student is teenager or not using lambda in C#)
std => std.Age > 12 && std.Age < 20;
Here, we can see that the code has been shortened (i.e. writability increased). However, it makes the code relatively difficult to understand as “std” in listing 2 is ambiguous (i.e. readability decreased). But what about Reliability?
Being a programming language expert, you are required to compare both approaches (i.e. code written with/without lambda) and state which one is better in terms of Reliability in C# programming language.
Anonymous methods can access variables defined in an outer function.
Example: Anonymous Method public delegate void Print(int value); static void Main(string[] args) { int i = 10; Print prnt = delegate(int val) { val += i; Console.WriteLine("Anonymous method: {0}", val); }; prnt(100); }
-
@zaasmi said in CS508 GDB 1 Solution and Discussion:
@ozair said in CS508 GDB 1 Solution and Discussion:
In context of C# programming, a lambda can be used instead of an anonymous method/function where we do not need to provide access modifier, return type and even name of the method. For example, the following anonymous method checks if a student is teenager or not:
Example: Anonymous Method
public delegate void Print(int value); static void Main(string[] args) { Print print = delegate(int val) { Console.WriteLine("Inside Anonymous method. Value: {0}", val); }; print(100); } Try it
Inside Anonymous method. Value: 100
-
@ozair said in CS508 GDB 1 Solution and Discussion:
In context of C# programming, a lambda can be used instead of an anonymous method/function where we do not need to provide access modifier, return type and even name of the method. For example, the following anonymous method checks if a student is teenager or not:
Example: Anonymous Method
public delegate void Print(int value); static void Main(string[] args) { Print print = delegate(int val) { Console.WriteLine("Inside Anonymous method. Value: {0}", val); }; print(100); } Try it


100% Off on Your FEE Join US! Ask Me How?


