Anda di halaman 1dari 41

Hands On Data Type and Control Flow

Problem 1:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Problem_1
{
class Program
{
string name;
public string Name
{
get { return name; }
set { name = value; }
}
string address;
public string Address
{
get { return address; }
set { address = value; }
}
double contact;
public double Contact
{
get { return contact; }
set { contact = value; }
}
string email;
public string Email
{
get { return email; }
set { email = value; }
}
string proof_type;
public string Proof_type
{
get { return proof_type; }
set { proof_type = value; }
}
string proof_id;
public string Proof_id
{
get { return proof_id; }
set { proof_id = value; }
}
public void Register()
{

Console.WriteLine();
Console.WriteLine("Welcome {0}.", this.Name);
Console.WriteLine("Here are your details");
Console.WriteLine("Address: {0}", this.Address);
Console.WriteLine("Contact Number: {0}", this.Contact);
Console.WriteLine("E-Mail ID: {0}", this.Email);
Console.WriteLine("Proof type: {0}", this.Proof_type);
Console.WriteLine("Proof id: {0}", this.Proof_id);
Console.WriteLine("\nThank you for registering. Your id is 1..");

}
static void Main(string[] args)
{
Program user = new Program();
Console.WriteLine("Registration\n");
Console.WriteLine("Enter your name");
user.Name = Console.ReadLine();
Console.WriteLine("Enter your address");
user.Address = Console.ReadLine();
Console.WriteLine("Contact Number");
user.Contact = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("E-Mail ID");
user.Email = Console.ReadLine();
Console.WriteLine("Enter proof type");
user.Proof_type = Console.ReadLine();
Console.WriteLine("Enter proof id");
user.Proof_id = Console.ReadLine();
user.Register();
}
}

Problem 2:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Problem_2
{
class Program
{
string ac;
public string Ac
{
get { return ac; }
set { ac = value; }
}
string cot;
public string Cot
{
get { return cot; }
set { cot = value; }
}
string cable;

public string Cable


{
get { return cable; }
set { cable = value; }
}
string wifi;
public string Wifi
{
get { return wifi; }
set { wifi = value; }
}
string laundry;
public string Laundry
{
get { return laundry; }
set { laundry = value; }
}
DateTime date;
public DateTime Date
{
get { return date; }
set { date = value; }
}
public void Book()
{
int price = 0;
if(Ac.Equals("AC"))
{price = price + 1000;
else
{price = price + 750;}

if(Cot.Equals("Single"))
{price = price + 0;}
else
{price = price + 350;}
if(Cable.Equals("C"))
{price = price + 50;}
else
{price = price + 0;}
if(Wifi.Equals("W"))
{price = price + 200;}
else
{price = price + 0;}
if(Laundry.Equals("L"))
{price = price + 100;}
else
{price = price + 0;}
Console.WriteLine("The total charge is Rs.{0}.",price);
Console.WriteLine("The services chosen are");

if (Cot.Equals("Single"))
{ Console.Write("Single cot "); }
else
{ Console.Write("Double cot "); }
if (Ac.Equals("AC"))
{ Console.Write("AC room\n"); }
else
{ Console.Write("non-AC room\n"); }
if (Cable.Equals("C"))
{ Console.WriteLine("Cable connection enabled"); }
else
{ Console.WriteLine("Cable connection disabled"); }
if (Wifi.Equals("W"))
{ Console.WriteLine("Wi-Fi enabled"); }
else
{ Console.WriteLine("Wi-Fi disabled"); }
if (Laundry.Equals("L"))
{ Console.WriteLine("with laundry service\n"); }
else
{ Console.WriteLine("without laundry service\n"); }
}
static void Main(string[] args)
{
string choice;
Console.WriteLine("Booking:\n");
do
{
Program cus = new Program();
Console.WriteLine("Please choose the services required.");
Console.WriteLine("AC/non-AC(AC/nAC)");
cus.Ac = Console.ReadLine();
Console.WriteLine("Cot(Single/Double)");
cus.Cot = Console.ReadLine();
Console.WriteLine("With cable connection/without cable
connection(C/nC)");
cus.Cable = Console.ReadLine();
Console.WriteLine("Wi-Fi needed or not(W/nW)");
cus.Wifi = Console.ReadLine();
Console.WriteLine("Laundry service needed or not(L/nL)\n");
cus.Laundry = Console.ReadLine();
cus.Book();
Console.WriteLine("Do you want to proceed?(yes/no)\n");
choice = Console.ReadLine();
} while (choice.Equals("no"));
Console.WriteLine("Thank you for booking. Your room number is
1.");
}
}
}

Problem 3:
using
using
using
using

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

namespace Problem_3
{
class Program
{
string ac;
public string Ac
{
get { return ac; }
set { ac = value; }
}
string cot;
public string Cot
{
get { return cot; }
set { cot = value; }
}
string cable;
public string Cable
{
get { return cable; }
set { cable = value; }
}
string wifi;
public string Wifi
{
get { return wifi; }
set { wifi = value; }
}
string laundry;
public string Laundry
{
get { return laundry; }
set { laundry = value; }
}
DateTime date;
public DateTime Date
{
get { return date; }
set { date = value; }
}
int bookedRooms;
public int BookedRooms
{

get { return bookedRooms; }


set { bookedRooms = value; }
}
static int i = 0;
public int val()
{
i = i + 1;
return i;
}
public void CheckAvailabilityStatus()
{
if (bookedRooms <= i)
{ Console.WriteLine("Room number {0} is booked.", bookedRooms); }
else
{ Console.WriteLine("Room number {0} is not booked.",
bookedRooms); }
}
public void Book()
{
int price = 0;
if (Ac.Equals("AC"))
{ price = price + 1000; }
else
{ price = price + 750; }
if (Cot.Equals("Single"))
{ price = price + 0; }
else
{ price = price + 350; }
if (Cable.Equals("C"))
{ price = price + 50; }
else
{ price = price + 0; }
if (Wifi.Equals("W"))
{ price = price + 200; }
else
{ price = price + 0; }
if (Laundry.Equals("L"))
{ price = price + 100; }
else
{ price = price + 0; }
Console.WriteLine("The total charge is Rs.{0}.", price);
Console.WriteLine("The services chosen are");
if (Cot.Equals("Single"))
{ Console.Write("Single cot "); }
else
{ Console.Write("Double cot "); }

if (Ac.Equals("AC"))
{ Console.Write("AC room\n"); }
else
{ Console.Write("non-AC room\n"); }
if (Cable.Equals("C"))
{ Console.WriteLine("Cable connection enabled"); }
else
{ Console.WriteLine("Cable connection disabled"); }
if (Wifi.Equals("W"))
{ Console.WriteLine("Wi-Fi enabled"); }
else
{ Console.WriteLine("Wi-Fi disabled"); }
if (Laundry.Equals("L"))
{ Console.WriteLine("with laundry service"); }
else
{ Console.WriteLine("without laundry service"); }
}
static void Main(string[] args)
{
int main_choice = 1;
while (main_choice < 3)
{
Console.WriteLine("Menu");
Console.WriteLine("1. Book\n2. Check Status\n3. Exit");
Console.WriteLine("Enter your choice");
main_choice = Convert.ToInt16(Console.ReadLine());
Program cus = new Program();
if (main_choice == 1)
{
string choice;
Console.WriteLine("Booking:");
do
{
Console.WriteLine("Please choose the services
required.");
Console.WriteLine("AC/non-AC(AC/nAC)");
cus.Ac = Console.ReadLine();
Console.WriteLine("Cot(Single/Double)");
cus.Cot = Console.ReadLine();
Console.WriteLine("With cable connection/without cable
connection(C/nC)");
cus.Cable = Console.ReadLine();
Console.WriteLine("Wi-Fi needed or not(W/nW)");
cus.Wifi = Console.ReadLine();
Console.WriteLine("Laundry service needed or
not(L/nL)");
cus.Laundry = Console.ReadLine();
cus.Book();
Console.WriteLine("Do you want to proceed?(yes/no)");
choice = Console.ReadLine();
}

while (choice.Equals("no"));
if (choice.Equals("yes"))
Console.WriteLine("Thank you for booking. Your room
number is {0}.", cus.val());
}
else if (main_choice == 2)
{
Console.WriteLine("Check Status:");
Console.WriteLine("Enter room number");
cus.bookedRooms = Convert.ToInt16(Console.ReadLine());
cus.CheckAvailabilityStatus();
}
}
}
}
}

Problem 4:
using
using
using
using

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

namespace Problem_4
{
class Program
{
string name;
public string Name
{
get { return name; }
set { name = value; }
}
string address;
public string Address
{
get { return address; }
set { address = value; }
}
double contact;
public double Contact
{
get { return contact; }
set { contact = value; }
}
string email;
public string Email
{
get { return email; }
set { email = value; }
}

string proof_type;
public string Proof_type
{
get { return proof_type; }
set { proof_type = value; }
}
string proof_id;
public string Proof_id
{
get { return proof_id; }
set { proof_id = value; }
}
public void Register()
{
Console.WriteLine("Address: {0}", this.Address);
Console.WriteLine("Contact Number: {0}", this.Contact);
Console.WriteLine("E-Mail ID: {0}", this.Email);
Console.WriteLine("Proof type: {0}", this.Proof_type);
Console.WriteLine("Proof id: {0}", this.Proof_id);
}
static void Main(string[] args)
{
string choice;
Program user = new Program();
Console.WriteLine("Registration\n");
Console.WriteLine("Enter your name");
user.Name = Console.ReadLine();
Console.WriteLine("Enter your address");
user.Address = Console.ReadLine();
Console.WriteLine("Contact Number");
user.Contact = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("E-Mail ID");
user.Email = Console.ReadLine();
Console.WriteLine("Enter proof type");
user.Proof_type = Console.ReadLine();
Console.WriteLine("Enter proof id");
user.Proof_id = Console.ReadLine();
Console.WriteLine("\nWelcome {0}.",user.Name);
Console.WriteLine("Here are your details");
user.Register();
Console.WriteLine("\nThank you for registering. Your id is

1..\n");

Console.WriteLine("Do you want to update the email id?(yes/no)");


choice = Console.ReadLine();
if (choice.Equals("yes"))
{
Console.WriteLine("\nUpdate Email:");
Console.WriteLine("Enter new Email id");
user.Email = Console.ReadLine();
Console.WriteLine("\nEmail updated\n");
Console.WriteLine("Your details are as follows");
Console.WriteLine("Name: {0}", user.Name);
user.Register();

}
else
{

Console.WriteLine("Thank you");

}
}

Problem 5: Not accepted


Problem 6:
using
using
using
using

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

namespace Problem_6
{
class Program
{
string name;
public string Name
{
get { return name; }
set { name = value; }
}
string address;
public string Address
{
get { return address; }
set { address = value; }
}
double contact;
public double Contact
{
get { return contact; }
set { contact = value; }
}
string email;
public string Email
{
get { return email; }
set { email = value; }
}
string proof_type;
public string Proof_type
{
get { return proof_type; }

set { proof_type = value; }


}
string proof_id;
public string Proof_id
{
get { return proof_id; }
set { proof_id = value; }
}
static int i = 0;
public int val()
{
i = i + 1;
return i;
}
//Creating lists to store values

//View Customers in a table format - method


public void ViewCustomers(IDictionary<int, Program > res)
{
string header = String.Format("{0,-15}{1,-15}", "Customer ID",
"Customer name");
Console.WriteLine(header);
foreach (int j in res.Keys)
{
Console.WriteLine("{0,-15}{1,-15}", j, res[j].Name);
}

static void Main(string[] args)


{
Dictionary<int, Program> result = new Dictionary<int, Program>();
string choice;
Program user1 = new Program();
do
{
Program user = new Program();
Console.WriteLine("Registration");
Console.WriteLine("Enter your name");
user.Name = Console.ReadLine();
Console.WriteLine("Enter your address");
user.Address = Console.ReadLine();
Console.WriteLine("Contact Number");
user.Contact = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("E-Mail ID");
user.Email = Console.ReadLine();
Console.WriteLine("Enter proof type");
user.Proof_type = Console.ReadLine();
Console.WriteLine("Enter proof id");
user.Proof_id = Console.ReadLine();

Console.WriteLine("Thank you for registering. Your id is


{0}.",user.val());
result.Add(i, user);
Console.WriteLine("Do you want to continue registration
(y/n)?");
choice = Console.ReadLine();
} while (choice.Equals("y"));

Console.WriteLine("Customers list");
Console.WriteLine("The registered customers are");
//Calling Function for display
user1.ViewCustomers(result);
Console.WriteLine("Thank You");

}
}

Hands On Classes and Objects


Problem 1:
Customer.cs :
using
using
using
using

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

namespace Access_Specifiers_1
{
class Customer
{
//variables for user registration
string firstName;
public string FirstName
{
get { return firstName; }
set { firstName = value; }
}
string lastName;
public string LastName
{
get { return lastName; }
set { lastName = value; }
}
int contactNumber;
public int ContactNumber
{
get { return contactNumber; }
set { contactNumber = value; }
}
string eMail;

public string EMail


{
get { return eMail; }
set { eMail = value; }
}
string proofType;
public string ProofType
{
get { return proofType; }
set { proofType = value; }
}
string proofId;
public string ProofId
{
get { return proofId; }
set { proofId = value; }
}
public void registerCustomer()
{}
public void display()
{
Console.WriteLine("The customer details are as follows");
Console.WriteLine("The customer details are:");
Console.WriteLine("First Name : {0}",FirstName);
Console.WriteLine("Last Name : {0}",LastName);
Console.WriteLine("Contact Number : {0}",ContactNumber);
Console.WriteLine("E-Mail : {0}", EMail);
Console.WriteLine("Proof Type : {0}", ProofType);
Console.WriteLine("Proof ID : {0}", ProofId);
}
public void updateEmail(String eMail1)
{
this.eMail = eMail1;
Console.WriteLine("Email updated.");
display();
}
}

Program.cs:
using
using
using
using

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

namespace Access_Specifiers_1
{
class Program
{
static void Main(string[] args)
{
Customer user = new Customer();
Console.WriteLine("Registration:\n");

}
}

Console.WriteLine("Enter the customer details:");


Console.WriteLine("Enter the first name:");
user.FirstName = Console.ReadLine();
Console.WriteLine("Enter the last name:");
user.LastName = Console.ReadLine();
Console.WriteLine("Enter the contact number:");
user.ContactNumber = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the e-mail id:");
user.EMail = Console.ReadLine();
Console.WriteLine("Enter the proof type:");
user.ProofType = Console.ReadLine();
Console.WriteLine("Enter the proof id:");
user.ProofId = Console.ReadLine();
Console.WriteLine("Thank you for registering. Your id is 1..");
user.display();
Console.WriteLine("Do you want to update email?(y/n)");
string choice = Console.ReadLine();
if (choice.Equals("y"))
{
string email;
Console.WriteLine("Enter the new email:");
email = Console.ReadLine();
user.updateEmail(email);
}
Console.WriteLine("Thank You");

Problem 2:
Program.cs:
using
using
using
using

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

namespace Access_Specifiers_2
{
class Program
{
static void Main(string[] args)
{
string choice;
Hotel obj = new Hotel();
Console.WriteLine("Enter the Hotel details:");
Console.WriteLine("Enter the Hotel Name:");
obj.Hotel_name1 = Console.ReadLine();
Console.WriteLine("Enter the Hotel ID:");
obj.Hotel_id = Console.ReadLine();
Console.WriteLine("Enter the Hotel Address:");
obj.Address1 = Console.ReadLine();
Console.WriteLine("Enter the Room Details:");
do
{

Console.WriteLine("Enter the Room Id:");


int _rid = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter the Room Number:");
int _rno = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter the Room Type:");
Console.WriteLine("1)Normal\n2)Delux\n3)Super Delux");
int _rtyp = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter the Room Capacity:(1/2/3/4)");
int _rcap = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("AC Service (true/false):");
bool _ac = Convert.ToBoolean(Console.ReadLine());
Console.WriteLine("Wi-Fi Service (true/false):");
bool _wifi = Convert.ToBoolean(Console.ReadLine());
Console.WriteLine("Cable Service (true/false):");
bool _cable = Convert.ToBoolean(Console.ReadLine());
Console.WriteLine("Laundry Service (true/false):");
bool _laundry = Convert.ToBoolean(Console.ReadLine());
Room obj1 = new Room(_rid, _rno, _rtyp, _rcap, _ac, _wifi,
_cable, _laundry);
obj.addRoom(obj1);
Console.WriteLine("Do you want to add Another Room
(yes/no):");
choice = Console.ReadLine();
} while (choice.Equals("yes"));
obj.display();
}

Hotel.cs
using
using
using
using

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

namespace Access_Specifiers_2
{
class Hotel
{
private string Hotel_name;
public string Hotel_name1
{
get { return Hotel_name; }
set { Hotel_name = value; }
}
private string Address;
public string Address1
{
get { return Address; }
set { Address = value; }
}
private string hotel_id;

public string Hotel_id


{
get { return hotel_id; }
set { hotel_id = value; }
}
private List<Room> room_list = new List<Room>();

}
}

public void addRoom(Room R)


{
try
{
room_list.Add(R);
}
catch(Exception e)
{
Console.WriteLine(e.Message);
}
}
public void display()
{
Console.WriteLine("Thank you for booking !!");
Console.WriteLine("The rooms Details in {0} :", Hotel_name);
Console.WriteLine("Hotel Name:{0}.", Hotel_name);
Console.WriteLine("Hotel ID:{0}.", hotel_id);
Console.WriteLine("Hotel Address:{0}.\n", Address);
Console.WriteLine("Room Details:");
foreach (Room s in room_list)
{
Console.WriteLine("\nRoom Number :{0}", s.Room_number);
string room_type_name="";
switch (s.Room_type)
{
case 1:
room_type_name = "Normal";
break;
case 2:
room_type_name = "Delux";
break;
case 3:
room_type_name = "Super Delux";
break;
}
Console.WriteLine("Room Type :{0}", room_type_name);
Console.WriteLine("Services Available:");
if (s.Ac) Console.WriteLine("AC");
if (s.Wifi) Console.WriteLine("Wifi");
if (s.Cable) Console.WriteLine("Cable Connection");
if (s.Laundry) Console.WriteLine("Laundry");
}
}

Room.cs:
using
using
using
using

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

namespace Access_Specifiers_2
{
class Room
{
int room_id;
public int Room_id
{
get { return room_id; }
set { room_id = value; }
}
int room_number;
public int Room_number
{
get { return room_number; }
set { room_number = value; }
}
int room_type;
public int Room_type
{
get { return room_type; }
set { room_type = value; }
}
int room_capacity;
public int Room_capacity
{
get { return room_capacity; }
set { room_capacity = value; }
}
bool ac;
public bool Ac
{
get { return ac; }
set { ac = value; }
}
bool wifi;
public bool Wifi
{
get { return wifi; }
set { wifi = value; }
}
bool cable;
public bool Cable
{

get { return cable; }


set { cable = value; }
}
bool laundry;
public bool Laundry
{
get { return laundry; }
set { laundry = value; }
}
public Room(int ri, int rn, int rt, int rc, bool a, bool w, bool c,
bool l)

{
room_id = ri;
room_number = rn;
room_type = rt;
room_capacity = rc;
ac = a;
wifi = w;
cable = c;
laundry = l;
}

Problem 3:
Not accepted

Hands On Generics and Collection


Problem 1:
using
using
using
using
using

System;
System.Collections.Generic;
System.Linq;
System.Text;
System.Threading.Tasks;

namespace Genericscollection1
{
class Program
{
string fn;
string ln;
int cn;
string email;
string pr_ty;
string pr_id;

public string Fn
{
get
{
return fn;
}
set
{
}

fn = value;

public string Ln
{
get
{
return ln;
}
set
{
}

ln = value;

}
public int Cn
{
get
{
return cn;
}
set
{
}

cn = value;

public string Email


{
get
{
return email;
}
set
{
}
}

email = value;

public string Pr_ty


{
get
{
return pr_ty;
}
set
{
}

pr_ty = value;

public string Pr_id


{
get
{
return pr_id;
}
set
{
}

pr_id = value;

}
public void ViewCustomers(SortedDictionary<string, Program>
alias_name)
{
Console.WriteLine("The customer details are as follows");
foreach (string j in alias_name.Keys)
{
Console.WriteLine("The customer details are:");
Console.WriteLine("First Name : {0}",
alias_name[j].Fn);
Console.WriteLine("Last Name : {0}",
alias_name[j].Ln);
Console.WriteLine("Contact Number : {0}",
alias_name[j].Cn);
Console.WriteLine("E-Mail : {0}",
alias_name[j].Email);
Console.WriteLine("Proof Type : {0}",
alias_name[j].Pr_ty);
Console.WriteLine("Proof ID : {0}\n",
alias_name[j].Pr_id);
}
}
//Main Program
static void Main(string[] args)
{

SortedDictionary<string, Program> dictionary_name = new


SortedDictionary<string, Program>();
string ch;
Program user1 = new Program();
Console.WriteLine("Customer Registration:\n");
do
{
Console.WriteLine("Enter the customer details:");
Program user = new Program();
Console.WriteLine("Enter the first name:");
user.Fn = Console.ReadLine();
Console.WriteLine("Enter the last name:");
user.Ln = Console.ReadLine();
Console.WriteLine("Enter the contact number:");
user.Cn = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the e-mail id:");
user.Email = Console.ReadLine();
Console.WriteLine("Enter the proof type:");
user.Pr_ty = Console.ReadLine();
Console.WriteLine("Enter the proof id:");
user.Pr_id = Console.ReadLine();
dictionary_name.Add(user.Fn, user);
Console.WriteLine("Do you want to add new customer?
(y/n)");
ch = Console.ReadLine();
} while (ch.Equals("y"));
user1.ViewCustomers(dictionary_name);
}
}
}
Problem 2:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Generics_and_collection_2
{
class Program
{
//Hotel variables
string name;
string hotel_id;
string address;
public string Name
{
get
{

}
set
{
}

return name;

name = value;

public string Hotel_id


{
get
{
return hotel_id;
}
set
{
}

hotel_id = value;

}
public string Address
{
get
{
return address;
}
set
{
}

address = value;

//Hotel display function


public void display()
{
Console.WriteLine("Thank you for booking !!");
Console.WriteLine("The rooms Details in {0} :", Name);
Console.WriteLine("Hotel Name:{0}.", Name);
Console.WriteLine("Hotel ID:{0}.", Hotel_id);
Console.WriteLine("Hotel Address:{0}.\n", Address);
}
//Room variables
int room_Id;
int roomType;
int room_Number;
int room_Capacity;
Boolean room_ac;

Boolean room_Wifi;
Boolean room_Cable;
Boolean room_Laundry;
public int Room_Id
{
get
{
return room_Id;
}
set
{
}

room_Id = value;

public int RoomType


{
get
{
return roomType;
}
set
{
}

roomType = value;

}
public int Room_Number
{
get
{
return room_Number;
}
set
{
}

room_Number = value;

public int Room_Capacity


{
get
{
return room_Capacity;
}
set
{

room_Capacity = value;

}
public bool Room_ac
{
get
{
return room_ac;
}
set
{
}

room_ac = value;

public bool Room_Wifi


{
get
{
return room_Wifi;
}
set
{
}

room_Wifi = value;

}
public bool Room_Cable
{
get
{
return room_Cable;
}
set
{
}

room_Cable = value;

public bool Room_Laundry


{
get
{
return room_Laundry;
}
set
{

room_Laundry = value;

}
//Room display function
public void ViewRoom(SortedDictionary<int, Program>
alias_name)
{
Console.WriteLine("Room Details:");
foreach (int i in alias_name.Keys)
{
Console.WriteLine();
Console.WriteLine("Room Number :{0}",
alias_name[i].Room_Number);
string type_display;
if (alias_name[i].RoomType == 1) type_display =
"Normal";
else if (alias_name[i].RoomType == 2) type_display =
"Delux";
else type_display = "Super Delux";
Console.WriteLine("Room Type :{0}", type_display);
Console.WriteLine("Services Available:");
if (alias_name[i].Room_ac)
{ Console.WriteLine("AC"); }
if (alias_name[i].Room_Wifi) { Console.WriteLine("WiFi"); }
if (alias_name[i].Room_Cable)
{ Console.WriteLine("Cable Connection"); }
if (alias_name[i].Room_Laundry)
{ Console.WriteLine("Laundry"); }
}
}
//Main Program
static void Main(string[] args)
{
SortedDictionary<int, Program> dictionary_name = new
SortedDictionary<int, Program>();
String ch;
Program h = new Program();
Console.WriteLine("Enter the Hotel details:");
Console.WriteLine("Enter the Hotel Name:");
h.Name = Console.ReadLine();
Console.WriteLine("Enter the Hotel ID:");
h.Hotel_id = Console.ReadLine();
Console.WriteLine("Enter the Hotel Address");
h.Address = Console.ReadLine();
do
{
Program r = new Program();
Console.WriteLine("Enter the Room Details:");

Console.WriteLine("Enter the Room Id:");


r.Room_Id = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter the Room Number:");
r.Room_Number = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter the Room Type:");
Console.WriteLine("1)Normal\n2)Delux\n3)Super Delux");
r.RoomType = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter the Room Capacity:
(1/2/3/4)");

r.Room_Capacity = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("AC Service (true/false):");
r.Room_ac = Convert.ToBoolean(Console.ReadLine());
Console.WriteLine("Wi-Fi Service (true/false):");
r.Room_Wifi = Convert.ToBoolean(Console.ReadLine());
Console.WriteLine("Cable Service (true/false):");
r.Room_Cable = Convert.ToBoolean(Console.ReadLine());
Console.WriteLine("Laundry Service (true/false):");
r.Room_Laundry =
Convert.ToBoolean(Console.ReadLine());
dictionary_name.Add(r.Room_Number, r);
Console.WriteLine("Do you want to add Another Room
(yes/no):");
ch = Console.ReadLine();
} while (ch.Equals("yes"));
h.display();
//Call dictionary
h.ViewRoom(dictionary_name);
}
}
}
HandsOn Exception Handling
Problem 1:
Program.cs:
using
using
using
using
using

System;
System.Collections.Generic;
System.Linq;
System.Text;
System.Threading.Tasks;

namespace Generics_and_collection_2
{
class Program
{
//Hotel variables
string name;
string hotel_id;
string address;
public string Name
{
get
{

}
set
{
}

return name;

name = value;

public string Hotel_id


{
get
{
return hotel_id;
}
set
{
}

hotel_id = value;

}
public string Address
{
get
{
return address;
}
set
{
}

address = value;

//Hotel display function


public void display()
{
Console.WriteLine("Thank you for booking !!");
Console.WriteLine("The rooms details:");
Console.WriteLine("Hotel Name:{0}.", Name);
Console.WriteLine("Hotel ID:{0}.", Hotel_id);
Console.WriteLine("Hotel Address:{0}.\n", Address);
}
//Room variables
int room_Id;
int roomType;
int room_Number;
int room_Capacity;
Boolean room_ac;
Boolean room_Wifi;
Boolean room_Cable;
Boolean room_Laundry;
public int Room_Id

get
{

return room_Id;

}
set
{
}

room_Id = value;

}
public int RoomType
{
get
{
return roomType;
}
set
{
}

roomType = value;

public int Room_Number


{
get
{
return room_Number;
}
set
{
}

room_Number = value;

}
public int Room_Capacity
{
get
{
return room_Capacity;
}
set
{
}

room_Capacity = value;

public bool Room_ac


{
get
{
return room_ac;
}

set
{
}

room_ac = value;

public bool Room_Wifi


{
get
{
return room_Wifi;
}
set
{
}

room_Wifi = value;

}
public bool Room_Cable
{
get
{
return room_Cable;
}
set
{
}

room_Cable = value;

public bool Room_Laundry


{
get
{
return room_Laundry;
}
set
{
}

room_Laundry = value;

}
//Room display function
public void ViewRoom(Dictionary<int, Program> alias_name)
{
foreach (int i in alias_name.Keys)
{
Console.WriteLine("Room Number :{0}",
alias_name[i].Room_Number);
string type_display;
if (alias_name[i].RoomType == 1) type_display = "Normal";
else if (alias_name[i].RoomType == 2) type_display = "Delux";

else type_display = "Super Delux";


Console.WriteLine("Room Type :{0}", type_display);
Console.WriteLine("Services Available:");
if (alias_name[i].Room_ac) { Console.WriteLine("AC"); }
if (alias_name[i].Room_Wifi) { Console.WriteLine("Wi-Fi"); }
if (alias_name[i].Room_Cable) { Console.WriteLine("Cable
Connection"); }

if (alias_name[i].Room_Laundry)
{ Console.WriteLine("Laundry"); }
}
}
//Main Program
static void Main(string[] args)
{
Dictionary<int, Program> dictionary_name = new Dictionary<int,
Program>();
String ch;
Program h = new Program();
Console.WriteLine("Enter the Hotel details:");
Console.WriteLine("Enter the Hotel Name:");
h.Name = Console.ReadLine();
Console.WriteLine("Enter the Hotel ID:");
h.Hotel_id = Console.ReadLine();
Console.WriteLine("Enter the Hotel Address");
h.Address = Console.ReadLine();
do
{
Program r = new Program();
Console.WriteLine("Enter the Room Details:");
Console.WriteLine("Enter the Room Id:");
r.Room_Id = Convert.ToInt16(Console.ReadLine());
lop1:
Console.WriteLine("Enter the Room Number:");
r.Room_Number = Convert.ToInt16(Console.ReadLine());
bool Caught = true;
while (Caught)
{
if (r.Room_Number <= 0)
{
Caught = true;
Console.WriteLine("Invalid Room Number");
Console.WriteLine("Re-enter Room Number");
goto lop1;
}
else
{
Caught = false;
}
//try
//{
//
Console.WriteLine("Enter the Room Number:");
//
r.Room_Number =
Convert.ToUInt16(Console.ReadLine());
//
Caught = false;
//}
//catch (Exception e)

//{
//
//
//
//
//}

Console.WriteLine("Invalid Room Number");


Console.WriteLine("Re-enter Room Number");
Console.WriteLine(e.Message);
Caught = true;

}
Console.WriteLine("Enter the Room Type:");
Console.WriteLine("1)Normal\n2)Delux\n3)Super Delux");
r.RoomType = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Enter the Room Capacity:(1/2/3/4)");
r.Room_Capacity = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("AC Service (true/false):");
r.Room_ac = Convert.ToBoolean(Console.ReadLine());
Console.WriteLine("Wi-Fi Service (true/false):");
r.Room_Wifi = Convert.ToBoolean(Console.ReadLine());
Console.WriteLine("Cable Service (true/false):");
r.Room_Cable = Convert.ToBoolean(Console.ReadLine());
Console.WriteLine("Laundry Service (true/false):");
r.Room_Laundry = Convert.ToBoolean(Console.ReadLine());
dictionary_name.Add(r.Room_Id, r);
Console.WriteLine("Do you want to add Another Room
(yes/no):");

ch = Console.ReadLine();
} while (ch.Equals("yes"));
h.display();
//Call dictionary
h.ViewRoom(dictionary_name);

Problem 2:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using System.Text.RegularExpressions;
namespace Problem_1
{
class Program
{
string fname;
public string Fname
{
get { return fname; }
set { fname = value; }
}
string lname;
public string Lname
{

get { return lname; }


set { lname = value; }
}
double contact;
public double Contact
{
get { return contact; }
set { contact = value; }
}
string email;
public string Email
{
get { return email; }
set { email = value; }
}
string proof_type;
public string Proof_type
{
get { return proof_type; }
set { proof_type = value; }
}
string proof_id;
public string Proof_id
{
get { return proof_id; }
set { proof_id = value; }
}
public void Register()
{
Console.WriteLine("The customer details are as follows");
Console.WriteLine("The customer details are:");
Console.WriteLine("First Name : {0}", this.Fname);
Console.WriteLine("Last Name : {0}", this.Lname);
Console.WriteLine("Contact Number : {0}", this.Contact);
Console.WriteLine("E-Mail : {0}", this.Email);
Console.WriteLine("Proof Type : {0}", this.Proof_type);
Console.WriteLine("Proof ID : {0}", this.Proof_id);
}
static void Main(string[] args)
{
Program user = new Program();
Console.WriteLine("Customer Registration:\n");
Console.WriteLine("Enter the customer details:");
Console.WriteLine("Enter the first name:");
user.Fname = Console.ReadLine();
Console.WriteLine("Enter the last name:");
user.Lname = Console.ReadLine();
Console.WriteLine("Enter the contact number:");
user.Contact = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter the e-mail id:");
lop1:
user.Email = Console.ReadLine();

}
}

bool Caught = true;


while (Caught)
{
if ((user.Email.Contains('@')) && (user.Email.Contains('.')))
{
Caught = false;
}
else
{
Console.WriteLine("Invalid Email ID");
Console.WriteLine("Re-enter Email ID");
Caught = true;
goto lop1;
}
}
Console.WriteLine("Enter the proof type:");
user.Proof_type = Console.ReadLine();
Console.WriteLine("Enter the proof id:");
user.Proof_id = Console.ReadLine();
Console.WriteLine("Thank you for registering. Your id is 1..");
user.Register();

File Handling :
Problem 1 Not accepted
using
using
using
using
using

System;
System.Collections.Generic;
System.Linq;
System.Text;
System.Xml;

namespace XML_using_Csh
{
class Program
{
static void Main(string[] args)
{
XmlTextReader reader = new XmlTextReader("customer.xml");
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Element:
//Console.WriteLine("<"+reader.Name+">");
break;
case XmlNodeType.Text:
Console.WriteLine(reader.Value);
break;
case XmlNodeType.EndElement:
//Console.Write("</" + reader.Name);
//Console.WriteLine(">");
break;
}

}
Console.ReadLine();
}

XML File:
Customer.xml
Save the file in the bin of the project
<?xml version="1.0" encoding="utf-8"?>
<Root>
<Customers>
<Customer CustomerID="GREAL">
<CompanyName>Great Lakes Food Market</CompanyName>
<ContactName>Howard Snyder</ContactName>
<ContactTitle>Marketing Manager</ContactTitle>
<Phone>(503) 555-7555</Phone>
<FullAddress>
<Address>2732 Baker Blvd.</Address>
<City>Eugene</City>
<Region>OR</Region>
<PostalCode>97403</PostalCode>
<Country>USA</Country>
</FullAddress>
</Customer>
<Customer CustomerID="HUNGC">
<CompanyName>Hungry Coyote Import Store</CompanyName>
<ContactName>Yoshi Latimer</ContactName>
<ContactTitle>Sales Representative</ContactTitle>
<Phone>(503) 555-6874</Phone>
<Fax>(503) 555-2376</Fax>
<FullAddress>
<Address>City Center Plaza 516 Main St.</Address>
<City>Elgin</City>
<Region>OR</Region>
<PostalCode>97827</PostalCode>
<Country>USA</Country>
</FullAddress>
</Customer>
<Customer CustomerID="LAZYK">
<CompanyName>Lazy K Kountry Store</CompanyName>
<ContactName>John Steel</ContactName>
<ContactTitle>Marketing Manager</ContactTitle>
<Phone>(509) 555-7969</Phone>
<Fax>(509) 555-6221</Fax>
<FullAddress>
<Address>12 Orchestra Terrace</Address>
<City>Walla Walla</City>
<Region>WA</Region>
<PostalCode>99362</PostalCode>
<Country>USA</Country>
</FullAddress>
</Customer>
<Customer CustomerID="LETSS">
<CompanyName>Let's Stop N Shop</CompanyName>

<ContactName>Jaime Yorres</ContactName>
<ContactTitle>Owner</ContactTitle>
<Phone>(415) 555-5938</Phone>
<FullAddress>
<Address>87 Polk St. Suite 5</Address>
<City>San Francisco</City>
<Region>CA</Region>
<PostalCode>94117</PostalCode>
<Country>USA</Country>
</FullAddress>
</Customer>
</Customers>
<Orders>
<Order>
<CustomerID>GREAL</CustomerID>
<EmployeeID>6</EmployeeID>
<OrderDate>1997-05-06T00:00:00</OrderDate>
<RequiredDate>1997-05-20T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1997-05-09T00:00:00">
<ShipVia>2</ShipVia>
<Freight>3.35</Freight>
<ShipName>Great Lakes Food Market</ShipName>
<ShipAddress>2732 Baker Blvd.</ShipAddress>
<ShipCity>Eugene</ShipCity>
<ShipRegion>OR</ShipRegion>
<ShipPostalCode>97403</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>GREAL</CustomerID>
<EmployeeID>8</EmployeeID>
<OrderDate>1997-07-04T00:00:00</OrderDate>
<RequiredDate>1997-08-01T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1997-07-14T00:00:00">
<ShipVia>2</ShipVia>
<Freight>4.42</Freight>
<ShipName>Great Lakes Food Market</ShipName>
<ShipAddress>2732 Baker Blvd.</ShipAddress>
<ShipCity>Eugene</ShipCity>
<ShipRegion>OR</ShipRegion>
<ShipPostalCode>97403</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>GREAL</CustomerID>
<EmployeeID>1</EmployeeID>
<OrderDate>1997-07-31T00:00:00</OrderDate>
<RequiredDate>1997-08-28T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1997-08-05T00:00:00">
<ShipVia>2</ShipVia>
<Freight>116.53</Freight>
<ShipName>Great Lakes Food Market</ShipName>
<ShipAddress>2732 Baker Blvd.</ShipAddress>
<ShipCity>Eugene</ShipCity>
<ShipRegion>OR</ShipRegion>

<ShipPostalCode>97403</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>GREAL</CustomerID>
<EmployeeID>4</EmployeeID>
<OrderDate>1997-07-31T00:00:00</OrderDate>
<RequiredDate>1997-08-28T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1997-08-04T00:00:00">
<ShipVia>2</ShipVia>
<Freight>18.53</Freight>
<ShipName>Great Lakes Food Market</ShipName>
<ShipAddress>2732 Baker Blvd.</ShipAddress>
<ShipCity>Eugene</ShipCity>
<ShipRegion>OR</ShipRegion>
<ShipPostalCode>97403</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>GREAL</CustomerID>
<EmployeeID>6</EmployeeID>
<OrderDate>1997-09-04T00:00:00</OrderDate>
<RequiredDate>1997-10-02T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1997-09-10T00:00:00">
<ShipVia>1</ShipVia>
<Freight>57.15</Freight>
<ShipName>Great Lakes Food Market</ShipName>
<ShipAddress>2732 Baker Blvd.</ShipAddress>
<ShipCity>Eugene</ShipCity>
<ShipRegion>OR</ShipRegion>
<ShipPostalCode>97403</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>GREAL</CustomerID>
<EmployeeID>3</EmployeeID>
<OrderDate>1997-09-25T00:00:00</OrderDate>
<RequiredDate>1997-10-23T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1997-09-30T00:00:00">
<ShipVia>3</ShipVia>
<Freight>76.13</Freight>
<ShipName>Great Lakes Food Market</ShipName>
<ShipAddress>2732 Baker Blvd.</ShipAddress>
<ShipCity>Eugene</ShipCity>
<ShipRegion>OR</ShipRegion>
<ShipPostalCode>97403</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>GREAL</CustomerID>
<EmployeeID>4</EmployeeID>
<OrderDate>1998-01-06T00:00:00</OrderDate>
<RequiredDate>1998-02-03T00:00:00</RequiredDate>

<ShipInfo ShippedDate="1998-02-04T00:00:00">
<ShipVia>2</ShipVia>
<Freight>719.78</Freight>
<ShipName>Great Lakes Food Market</ShipName>
<ShipAddress>2732 Baker Blvd.</ShipAddress>
<ShipCity>Eugene</ShipCity>
<ShipRegion>OR</ShipRegion>
<ShipPostalCode>97403</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>GREAL</CustomerID>
<EmployeeID>3</EmployeeID>
<OrderDate>1998-03-09T00:00:00</OrderDate>
<RequiredDate>1998-04-06T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1998-03-18T00:00:00">
<ShipVia>2</ShipVia>
<Freight>33.68</Freight>
<ShipName>Great Lakes Food Market</ShipName>
<ShipAddress>2732 Baker Blvd.</ShipAddress>
<ShipCity>Eugene</ShipCity>
<ShipRegion>OR</ShipRegion>
<ShipPostalCode>97403</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>GREAL</CustomerID>
<EmployeeID>3</EmployeeID>
<OrderDate>1998-04-07T00:00:00</OrderDate>
<RequiredDate>1998-05-05T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1998-04-15T00:00:00">
<ShipVia>2</ShipVia>
<Freight>25.19</Freight>
<ShipName>Great Lakes Food Market</ShipName>
<ShipAddress>2732 Baker Blvd.</ShipAddress>
<ShipCity>Eugene</ShipCity>
<ShipRegion>OR</ShipRegion>
<ShipPostalCode>97403</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>GREAL</CustomerID>
<EmployeeID>4</EmployeeID>
<OrderDate>1998-04-22T00:00:00</OrderDate>
<RequiredDate>1998-05-20T00:00:00</RequiredDate>
<ShipInfo>
<ShipVia>3</ShipVia>
<Freight>18.84</Freight>
<ShipName>Great Lakes Food Market</ShipName>
<ShipAddress>2732 Baker Blvd.</ShipAddress>
<ShipCity>Eugene</ShipCity>
<ShipRegion>OR</ShipRegion>
<ShipPostalCode>97403</ShipPostalCode>
<ShipCountry>USA</ShipCountry>

</ShipInfo>
</Order>
<Order>
<CustomerID>GREAL</CustomerID>
<EmployeeID>4</EmployeeID>
<OrderDate>1998-04-30T00:00:00</OrderDate>
<RequiredDate>1998-06-11T00:00:00</RequiredDate>
<ShipInfo>
<ShipVia>3</ShipVia>
<Freight>14.01</Freight>
<ShipName>Great Lakes Food Market</ShipName>
<ShipAddress>2732 Baker Blvd.</ShipAddress>
<ShipCity>Eugene</ShipCity>
<ShipRegion>OR</ShipRegion>
<ShipPostalCode>97403</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>HUNGC</CustomerID>
<EmployeeID>3</EmployeeID>
<OrderDate>1996-12-06T00:00:00</OrderDate>
<RequiredDate>1997-01-03T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1996-12-09T00:00:00">
<ShipVia>2</ShipVia>
<Freight>20.12</Freight>
<ShipName>Hungry Coyote Import Store</ShipName>
<ShipAddress>City Center Plaza 516 Main St.</ShipAddress>
<ShipCity>Elgin</ShipCity>
<ShipRegion>OR</ShipRegion>
<ShipPostalCode>97827</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>HUNGC</CustomerID>
<EmployeeID>1</EmployeeID>
<OrderDate>1996-12-25T00:00:00</OrderDate>
<RequiredDate>1997-01-22T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1997-01-03T00:00:00">
<ShipVia>3</ShipVia>
<Freight>30.34</Freight>
<ShipName>Hungry Coyote Import Store</ShipName>
<ShipAddress>City Center Plaza 516 Main St.</ShipAddress>
<ShipCity>Elgin</ShipCity>
<ShipRegion>OR</ShipRegion>
<ShipPostalCode>97827</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>HUNGC</CustomerID>
<EmployeeID>3</EmployeeID>
<OrderDate>1997-01-15T00:00:00</OrderDate>
<RequiredDate>1997-02-12T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1997-01-24T00:00:00">
<ShipVia>1</ShipVia>

<Freight>0.2</Freight>
<ShipName>Hungry Coyote Import Store</ShipName>
<ShipAddress>City Center Plaza 516 Main St.</ShipAddress>
<ShipCity>Elgin</ShipCity>
<ShipRegion>OR</ShipRegion>
<ShipPostalCode>97827</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>HUNGC</CustomerID>
<EmployeeID>4</EmployeeID>
<OrderDate>1997-07-16T00:00:00</OrderDate>
<RequiredDate>1997-08-13T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1997-07-21T00:00:00">
<ShipVia>1</ShipVia>
<Freight>45.13</Freight>
<ShipName>Hungry Coyote Import Store</ShipName>
<ShipAddress>City Center Plaza 516 Main St.</ShipAddress>
<ShipCity>Elgin</ShipCity>
<ShipRegion>OR</ShipRegion>
<ShipPostalCode>97827</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>HUNGC</CustomerID>
<EmployeeID>8</EmployeeID>
<OrderDate>1997-09-08T00:00:00</OrderDate>
<RequiredDate>1997-10-06T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1997-10-15T00:00:00">
<ShipVia>1</ShipVia>
<Freight>111.29</Freight>
<ShipName>Hungry Coyote Import Store</ShipName>
<ShipAddress>City Center Plaza 516 Main St.</ShipAddress>
<ShipCity>Elgin</ShipCity>
<ShipRegion>OR</ShipRegion>
<ShipPostalCode>97827</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>LAZYK</CustomerID>
<EmployeeID>1</EmployeeID>
<OrderDate>1997-03-21T00:00:00</OrderDate>
<RequiredDate>1997-04-18T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1997-04-10T00:00:00">
<ShipVia>3</ShipVia>
<Freight>7.48</Freight>
<ShipName>Lazy K Kountry Store</ShipName>
<ShipAddress>12 Orchestra Terrace</ShipAddress>
<ShipCity>Walla Walla</ShipCity>
<ShipRegion>WA</ShipRegion>
<ShipPostalCode>99362</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>

<Order>
<CustomerID>LAZYK</CustomerID>
<EmployeeID>8</EmployeeID>
<OrderDate>1997-05-22T00:00:00</OrderDate>
<RequiredDate>1997-06-19T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1997-06-26T00:00:00">
<ShipVia>2</ShipVia>
<Freight>11.92</Freight>
<ShipName>Lazy K Kountry Store</ShipName>
<ShipAddress>12 Orchestra Terrace</ShipAddress>
<ShipCity>Walla Walla</ShipCity>
<ShipRegion>WA</ShipRegion>
<ShipPostalCode>99362</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>LETSS</CustomerID>
<EmployeeID>1</EmployeeID>
<OrderDate>1997-06-25T00:00:00</OrderDate>
<RequiredDate>1997-07-23T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1997-07-04T00:00:00">
<ShipVia>2</ShipVia>
<Freight>13.73</Freight>
<ShipName>Let's Stop N Shop</ShipName>
<ShipAddress>87 Polk St. Suite 5</ShipAddress>
<ShipCity>San Francisco</ShipCity>
<ShipRegion>CA</ShipRegion>
<ShipPostalCode>94117</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>LETSS</CustomerID>
<EmployeeID>8</EmployeeID>
<OrderDate>1997-10-27T00:00:00</OrderDate>
<RequiredDate>1997-11-24T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1997-11-05T00:00:00">
<ShipVia>2</ShipVia>
<Freight>51.44</Freight>
<ShipName>Let's Stop N Shop</ShipName>
<ShipAddress>87 Polk St. Suite 5</ShipAddress>
<ShipCity>San Francisco</ShipCity>
<ShipRegion>CA</ShipRegion>
<ShipPostalCode>94117</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>LETSS</CustomerID>
<EmployeeID>6</EmployeeID>
<OrderDate>1997-11-10T00:00:00</OrderDate>
<RequiredDate>1997-12-08T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1997-11-21T00:00:00">
<ShipVia>2</ShipVia>
<Freight>45.97</Freight>
<ShipName>Let's Stop N Shop</ShipName>

<ShipAddress>87 Polk St. Suite 5</ShipAddress>


<ShipCity>San Francisco</ShipCity>
<ShipRegion>CA</ShipRegion>
<ShipPostalCode>94117</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
<Order>
<CustomerID>LETSS</CustomerID>
<EmployeeID>4</EmployeeID>
<OrderDate>1998-02-12T00:00:00</OrderDate>
<RequiredDate>1998-03-12T00:00:00</RequiredDate>
<ShipInfo ShippedDate="1998-02-13T00:00:00">
<ShipVia>2</ShipVia>
<Freight>90.97</Freight>
<ShipName>Let's Stop N Shop</ShipName>
<ShipAddress>87 Polk St. Suite 5</ShipAddress>
<ShipCity>San Francisco</ShipCity>
<ShipRegion>CA</ShipRegion>
<ShipPostalCode>94117</ShipPostalCode>
<ShipCountry>USA</ShipCountry>
</ShipInfo>
</Order>
</Orders>
</Root>

Problem 2: Not accepted:

Anda mungkin juga menyukai