Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Option III 1. What will be the output of the following code fragment static asyne Task Main(string[ args) { Task result1 = LongProcess10; Task result2

image text in transcribed

Option III 1. What will be the output of the following code fragment static asyne Task Main(string[ args) \{ Task result1 = LongProcess10; Task result2 = LongProcess20; Console.Write("After two long processes;"); int val = await result1; DisplayResult(val); val = await result2; DisplayResult(val); Console.ReadKey0; \} static async Task LongProcess10 \{ Console.Write("LongProcess 1 Started;"); await Task.Delay(4000); Console.Write("LongProcess 1 Completed;"); return 10; \} static async Task LongProcess20 \{ Console.Write("LongProcess 2 Started;"); await Task.Delay(4000); Console.Write("LongProcess 2 Completed;"); return 20; \} static void DisplayResult(int val) Console.Write(\$" (val);"); \} a) LongProcess 1 Started;LongProcess 2 Started;After two long processes;LongProcess 2 Completed;LongProcess 1 Completed;10;20; b) LongProcess 2 Started;LongProcess 1 Started;After two long processes;LongProcess 2 Completed;LongProcess 1 Completed;10;20; c) LongProcess 1 Started;LongProcess 2 Started;After two long processes;LongProcess 1 Completed;LongProcess 1 Completed;10;20; d) LongProcess 2 Started;LongProcess 2 Started;After two long processes; LongProcess 2 Completed;LongProcess 1 Completed;20;10; e) None of the above 2. Create function which will create Directory (directory name should be "My Final Exam") on C drive, create a file in the Directory above (file name should be "Final Exam.txt"), write current date in that file 3. Create class Customer which will have the following properties: FirstName, LastName, Balance and CreateDate, create a constructor which will receive FirstName, LastName, Balance and CreateDate for Customer class and initialise these properties in class, create function "Getlnfo" in class Customer, which will not receive anything but print the FirstName + LastName + Balance . Now create an object of that class using reflection and call "GetInfo" method using reflection. 4. Create a TcpListener instance to send the message using socket technology, in the same class create a function to receive that message and print in the console window

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

Aware of the role of HRM in multinational corporations.

Answered: 1 week ago