Docsity

CS508 Spring 2012 Assignment 4: Developing a C# Web Mail Script with Alstrasoft, Exercises of Programming Languages

Toggle sidebar
bg1
Modern Programming Languages (CS508)
SPRING 2012
Solution Assignment No. 4
Total Marks: 20 Dead line: June 27, 2012
Purpose of Assignment:
Intended purpose of this assignment is to give students an exercise using C#
programming languages and to provide students with the knowledge and skills they need
to develop C# applications for the Microsoft .NET Platform After attempting this
assignment students will be able to:
Familiarize with the basic syntax in C# language.
Learn about the Enumeration data type used in C# and its importance.
Students will get understanding of basic Arrays syntax and declaration in C#.
Application:
AlstraSoft Web Mail Script Enterprise Application:
Scenario:
Suppose you are developing a Web Mail Script Enterprise at Alstrasoft Pvt Ltd that
strives to be the premier provider of web-based software solutions for businesses
worldwide. As a web development and software company, Alstrasoft specialize mainly in
web design and software programming.
Evaluation:
Working in this web development environment a web based mail scripting application is
required where users need an easy, safe and reliable method of eliminating spam emails
by offering disposable email address that expires after a certain time limit. Web Email
Script not only provides disposable email service but it is also a C# web mail script with
"gmail style" interface.
Now being a Software Developer at this company, you are required to answer following
questions keeping in view the above constraints.
docsity.com
pf3

Partial preview of the text

Download CS508 Spring 2012 Assignment 4: Developing a C# Web Mail Script with Alstrasoft and more Exercises Programming Languages in PDF only on Docsity!

Modern Programming Languages (CS508)

SPRING 2012

Solution Assignment No. 4

Total Marks: 20 Dead line: June 27, 2012

Purpose of Assignment:

Intended purpose of this assignment is to give students an exercise using C# programming languages and to provide students with the knowledge and skills they need to develop C# applications for the Microsoft .NET Platform After attempting this assignment students will be able to:

 Familiarize with the basic syntax in C# language.

 Learn about the Enumeration data type used in C# and its importance.

 Students will get understanding of basic Arrays syntax and declaration in C#.

Application:

AlstraSoft Web Mail Script Enterprise Application:

Scenario:

Suppose you are developing a Web Mail Script Enterprise at Alstrasoft Pvt Ltd that strives to be the premier provider of web-based software solutions for businesses worldwide. As a web development and software company, Alstrasoft specialize mainly in web design and software programming.

Evaluation:

Working in this web development environment a web based mail scripting application is required where users need an easy, safe and reliable method of eliminating spam emails by offering disposable email address that expires after a certain time limit. Web Email Script not only provides disposable email service but it is also a C# web mail script with "gmail style" interface.

Now being a Software Developer at this company, you are required to answer following questions keeping in view the above constraints.

Part a)

Solution:

In order to get this code to compile, you would have to make explicit casts both ways (even converting from TEXT to int), i.e.:

int s= (int)TEXT.Bold; TEXT t= (TEXT)i;

Corrected code Version:

public class Textstyle { enum TEXT { Bold=1, Underlined, Italicized, HyperLink, };

int s=(int)TEXT.Bold;

TEXT t=(TEXT)s; If(s=TEXT.Bold) { Console.writeline(“Text is Bold”); } If(s=TEXT.Underlined) { Console.writeline(“Text is Underlined”); }

Part b)

Solution:

1 ‐If(s=Text.Bold) { Console.writeline(“Text is Bold”); }

First statement will return TRUE because value for variable‘s’