Welcome to awslagi.com – Sharing AWS, Anthropic, Google Cloud, Microsoft Azure IT Exams. It's free for all!

MCSD Programming in C

Program in C for professional application development.

4.8★★★★★(159 ratings)
16,667 studentsIntermediate
Develop a strong foundation in C programming concepts such as syntax, object-oriented design, and debugging. The exam helps you build the coding skills needed for software development and problem solving. This certification is useful for aspiring developers who want practical programming fluency. It supports progression into more advanced application development and software engineering roles.

What you'll learn

  • Write C code- Apply OOP principles- Debug applications- Manage program flow- Work with data structures

70-483

Lectures1
Questions42
Duration30 week
Students16,667

$20.00

Full Free Question Bank (42 Questions)

MCSD Programming in C (70-483) Practice Questions & Verified Answers

Click any option to test your knowledge, or reveal the verified answer and detailed explanation below each question.

Question #1Part 1

You are developing an application that includes a class named Order. The application will store a collection of Order objects. The collection must meet the following requirements: ✑ Use strongly typed members. ✑ Process Order objects in first-in-first-out order. ✑ Store values for each Order object. ✑ Use zero-based indices. You need to use a collection type that meets the requirements. Which collection type should you use?

AQueue
BSortedList
CLinkedList
DHashTable
EArray
Question #2Part 1

You are developing an application. The application contains the following code segment (line numbers are included for reference only): When you run the code, you receive the following error message: "Cannot implicitly convert type 'object'' to 'int'. An explicit conversion exists (are you missing a cast?)." You need to ensure that the code can be compiled. Which code should you use to replace line 05?

Avar2 = arrayl[0] as int;
Bvar2 = ((List)arrayl) [0];
Cvar2 = arrayl[0].Equals(typeof(int));
Dvar2 = (int) arrayl [0];
Question #3Part 1

You are developing an application. The application calls a method that returns an array of integers named employeeIds. You define an integer variable named employeeIdToRemove and assign a value to it. You declare an array named filteredEmployeeIds. You have the following requirements: ✑ Remove duplicate integers from the employeeIds array. ✑ Sort the array in order from the highest value to the lowest value. Remove the integer value stored in the employeeIdToRemove variable from the employeeIds array. You need to create a LINQ query to meet the requirements. Which code segment should you use?

AOption A
BOption B
COption C
DOption D
Question #4Part 1

You need to write a method that retrieves data from a Microsoft Access 2013 database. The method must meet the following requirements: ✑ Be read-only. ✑ Be able to use the data before the entire data set is retrieved. ✑ Minimize the amount of system overhead and the amount of memory usage. Which type of object should you use in the method?

ASqlDataAdapter
BDataContext
CDbDataAdapter
DOleDbDataReader
Question #5Part 1Select 2

You are developing an application that includes the following code segment. (Line numbers are included for reference only.) The GetAnimals() method must meet the following requirements: ✑ Connect to a Microsoft SQL Server database. ✑ Create Animal objects and populate them with data from the database. ✑ Return a sequence of populated Animal objects. You need to meet the requirements. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

AInsert the following code segment at line 16: while(sqlDataReader.NextResult())
BInsert the following code segment at line 13: sqlConnection.Open();
CInsert the following code segment at line 13: sqlConnection.BeginTransaction();
DInsert the following code segment at line 16: while(sqlDataReader.Read())
EInsert the following code segment at line 16: while(sqlDataReader.GetValues())
Question #6Part 1

You have the following code: You need to retrieve all of the numbers from the items variable that are greater than 80. Which code should you use?

AOption A
BOption B
COption C
DOption D
Question #7Part 1

You are developing an application that uses the Microsoft ADO.NET Entity Framework to retrieve order information from a Microsoft SQL Server database. The application includes the following code. (Line numbers are included for reference only.) The application must meet the following requirements: ✑ Return only orders that have an OrderDate value other than null. ✑ Return only orders that were placed in the year specified in the OrderDate property or in a later year. You need to ensure that the application meets the requirements. Which code segment should you insert at line 08?

AWhere order.OrderDate.Value != null && order.OrderDate.Value.Year >= year
BWhere order.OrderDate.Value == null && order.OrderDate.Value.Year == year
CWhere order.OrderDate.HasValue && order.OrderDate.Value.Year == year
DWhere order.OrderDate.Value.Year == year
Question #8Part 1

You are developing an application. The application includes a method named ReadFile that reads data from a file. The ReadFile() method must meet the following requirements: ✑ It must not make changes to the data file. ✑ It must allow other processes to access the data file. ✑ It must not throw an exception if the application attempts to open a data file that does not exist. You need to implement the ReadFile() method. Which code segment should you use?

Avar fs = File.Open(Filename, FileMode.OpenOrCreate, FileAccess.Read,FileShare.ReadWrite);
Bvar fs = File.Open(Filename, FileMode.Open, FileAccess.Read,FileShare.ReadWrite);
Cvar fs = File.Open(Filename, FileMode.OpenOrCreate, FileAccess.Read,FileShare.Write);
Dvar fs = File.ReadAllLines(Filename);
Evar fs = File.ReadAllBytes(Filename);
Question #9Part 1

You are implementing a method named ProcessReports that performs a long-running task. The ProcessReports() method has the following method signature: public void ProcessReports(List values,CancellationTokenSource cts, CancellationToken ct) If the calling code requests cancellation, the method must perform the following actions: ✑ Cancel the long-running task. Set the task status to TaskStatus.Canceled. You need to ensure that the ProcessReports() method performs the required actions. Which code segment should you use in the method body?

Aif (ct.IsCancellationRequested)return;
Bct.ThrowIfCancellationRequested() ;
Ccts.Cancel();
Dthrow new AggregateException();
Question #10Part 1

An application receives JSON data in the following format: The application includes the following code segment. (Line numbers are included for reference only.) You need to ensure that the ConvertToName() method returns the JSON input string as a Name object. Which code segment should you insert at line 10?

AReturn ser.ConvertToType(json);
BReturn ser.DeserializeObject(json);
CReturn ser.Deserialize(json);
DReturn (Name)ser.Serialize(json);
Question #11Part 1

You are developing an application that will be deployed to multiple computers. You set the assembly name. You need to create a unique identity for the application assembly. Which two assembly identity attributes should you include in the source code? (Each correct answer presents part of the solution. Choose two.)

AAssemblyTitleAttribute
BAssemblyCultureAttribute
CAssemblyVersionAttribute
DAssemblyKeyNameAttribute
EAssemblyFileVersion
Question #12Part 1

You are developing an application. The application converts a Location object to a string by using a method named WriteObject. The WriteObject() method accepts two parameters, a Location object and an XmlObjectSerializer object. The application includes the following code. (Line numbers are included for reference only.) You need to serialize the Location object as a JSON object. Which code segment should you insert at line 20?

ANew DataContractSerializer(typeof(Location))
BNew XmlSerializer(typeof(Location))
CNew NetDataContractSenalizer()
DNew DataContractJsonSerializer(typeof(Location))
Question #13Part 1

You are developing an application. You need to declare a delegate for a method that accepts an integer as a parameter, and then returns an integer. Which type of delegate should you use?

AAction
BAction
CFunc
DFunc
Question #14Part 1

You are developing an application by using C#. The application includes the following code segment. (Line numbers are included for reference only.) The DoWork() method must not throw any exceptions when converting the obj object to the IDataContainer interface or when accessing the Data property. You need to meet the requirements. Which code segment should you insert at line 07?

Avar dataContainer = (IDataContainer)obj;
Bdynamic dataContainer = obj;
Cvar dataContainer = obj is IDataContainer;
Dvar dataContainer = obj as IDataContainer;
Question #15Part 1

You are writing the following method (line numbers are included for reference only): You need to ensure that CreateObject compiles successfully. What should you do?

AInsert the following code at line 02: where T : new()
BReplace line 01 with the following code: public void CreateObject()
CReplace line 01 with the following code: public Object CreateObject()
DInsert the following code at line 02: where T : Object
Question #16Part 1

You are creating an application that manages information about zoo animals. The application includes a class named Animal and a method named Save. The Save() method must be strongly typed. It must allow only types inherited from the Animal class that uses a constructor that accepts no parameters. You need to implement the Save() method. Which code segment should you use?

AOption A
BOption B
COption C
DOption D
Question #17Part 1

You are developing an application that includes the following code segment. (Line numbers are included for reference only.) You need to ensure that the DoWork(Widget widget) method runs. With which code segment should you replace line 24?

ADoWork((Widget)o);
BDoWork(new Widget(o));
CDoWork(o is Widget);
DDoWork((ItemBase)o);
Question #18Part 1

An application uses X509 certificates for data encryption and decryption. The application stores certificates in the Personal certificates collection of the Current User store. On each computer, each certificate subject is unique. The application includes a method named LoadCertificate. The LoadCertificate() method includes the following code. (Line numbers are included for reference only.) The LoadCertificate() method must load only certificates for which the subject exactly matches the searchValue parameter value. You need to ensure that the LoadCertificate() method loads the correct certificates. Which code segment should you insert at line 06?

AOption A
BOption B
COption C
DOption D
Question #19Part 1

You are developing an application. The application includes classes named Employee and Person and an interface named IPerson. The Employee class must meet the following requirements: ✑ It must either inherit from the Person class or implement the IPerson interface. ✑ It must be inheritable by other classes in the application. You need to ensure that the Employee class meets the requirements. Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

AOption A
BOption B
COption C
DOption D
Question #20Part 1

You are developing a class named Scorecard. The following code implements the Scorecard class. (Line numbers are included for reference only.) You create the following unit test method to test the Scorecard class implementation: You need to ensure that the unit test will pass. What should you do?

AOption A
BOption B
COption C
DOption D
Question #21Part 1

You are developing an application that will convert data into multiple output formats. The application includes the following code. (Line numbers are included for reference only.) You are developing a code segment that will produce tab-delimited output. All output routines implement the following interface: You need to minimize the completion time of the GetOutput() method. Which code segment should you insert at line 06?

AOption A
BOption B
COption C
DOption D
Question #22Part 1

You are developing an application that will parse a large amount of text. You need to parse the text into separate lines and minimize memory use while processing data. Which object type should you use?

ADataContractSerializer
BStringBuilder
CStringReader
DJsonSerializer
Question #23Part 1

You are developing an application by using C#. The application includes an object that performs a long running process. You need to ensure that the garbage collector does not release the object's resources until the process completes. Which garbage collector method should you use?

AReRegisterForFinalize()
BSuppressFinalize()
CCollect()
DWaitForFullGCApproach()
Question #24Part 1

You are developing code for an application that retrieves information about Microsoft .NET Framework assemblies. The following code segment is part of the application (line numbers are included for reference only): You need to insert code at line 04. The code must load the assembly. Once the assembly is loaded, the code must be able to read the assembly metadata, but the code must be denied access from executing code from the assembly. Which code segment should you insert at line 04?

AAssembly.ReflectionOnlyLoadFrom(bytes);
BAssembly.ReflectionOniyLoad(bytes);
CAssembly.Load(bytes);
DAssembly.LoadFrom(bytes);
Question #25Part 1

You are creating a class named Employee. The class exposes a string property named EmployeeType. The following code segment defines the Employee class. (Line numbers are included for reference only.) The EmployeeType property value must be accessed and modified only by code within the Employee class or within a class derived from the Employee class. You need to ensure that the implementation of the EmployeeType property meets the requirements. Which two actions should you perform? (Each correct answer represents part of the complete solution. Choose two.)

AReplace line 05 with the following code segment:protected get;
BReplace line 06 with the following code segment:private set;
CReplace line 03 with the following code segment:public string EmployeeType
DReplace line 05 with the following code segment:private get;
EReplace line 03 with the following code segment:protected string EmployeeType
Question #26Part 1

You are developing a method named GenerateHash that will create the hash value for a file. The method includes the following code. (Line numbers are included for reference only.) You need to return the cryptographic hash of the bytes contained in the fileBuffer variable. Which code segment should you insert at line 05?

AOption A
BOption B
COption C
DOption D
Question #27Part 1

You are implementing a method named Calculate that performs conversions between value types and reference types. The following code segment implements the method. (Line numbers are included for reference only.) You need to ensure that the application does not throw exceptions on invalid conversions. Which code segment should you insert at line 04?

Aint balance = (int) (float)amountRef;
Bint balance = (int)amountRef;
Cint balance = amountRef;
Dint balance = (int) (double) amountRef;
Question #28Part 1

You are modifying an existing application that manages employee payroll. The application includes a class named PayrollProcessor. The PayrollProcessor class connects to a payroll database and processes batches of paychecks once a week. You need to ensure that the PayrollProcessor class supports iteration and releases database connections after the batch processing completes. Which two interfaces should you implement? (Each correct answer presents part of the complete solution. Choose two.)

AIEquatable
BIEnumerable
CIDisposable
DIComparable
Question #29Part 1

You are creating a console application by using C#. You need to access the application assembly. Which code segment should you use?

AAssembly.GetAssembly(this);
Bthis.GetType();
CAssembly.Load();
DAssembly.GetExecutingAssembly();
Question #30Part 1

You are developing an application that will read data from a text file and display the file contents. You need to read data from the file, display it, and correctly release the file resources. Which code segment should you use?

AOption A
BOption B
COption C
DOption D
Question #31Part 1

You use the Task.Run() method to launch a long-running data processing operation. The data processing operation often fails in times of heavy network congestion. If the data processing operation fails, a second operation must clean up any results of the first operation. You need to ensure that the second operation is invoked only if the data processing operation throws an unhandled exception. What should you do?

ACreate a TaskCompletionSource object and call the TrySetException() method of the object.
BCreate a task by calling the Task.ContinueWith() method.
CExamine the Task.Status property immediately after the call to the Task.Run() method.
DCreate a task inside the existing Task.Run() method by using the AttachedToParent option.
Question #32Part 1

You are modifying an application that processes leases. The following code defines the Lease class. (Line numbers are included for reference only.) Leases are restricted to a maximum term of 5 years. The application must send a notification message if a lease request exceeds 5 years. You need to implement the notification mechanism. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

AOption A
BOption B
COption C
DOption D
EOption E
Question #33Part 1

You are developing an application that uses structured exception handling. The application includes a class named ExceptionLogger. The ExceptionLogger class implements a method named LogException by using the following code segment: public static void LogException(Exception ex) You have the following requirements: ✑ Log all exceptions by using the LogException() method of the ExceptionLogger class. ✑ Rethrow the original exception, including the entire exception stack. You need to meet the requirements. Which code segment should you use?

AOption A
BOption B
COption C
DOption D
Question #34Part 1

You are developing an application that includes a class named UserTracker. The application includes the following code segment. (Line numbers are included for reference only.) You need to add a user to the UserTracker instance. What should you do?

AOption A
BOption B
COption C
DOption D
Question #35Part 1

You are adding a public method named UpdateScore to a public class named ScoreCard. The code region that updates the score field must meet the following requirements: ✑ It must be accessed by only one thread at a time. It must not be vulnerable to a deadlock situation. You need to implement the UpdateScore() method. What should you do?

AOption A
BOption B
COption C
DOption D
Question #36Part 1

You are developing a C# application that has a requirement to validate some string input data by using the Regex class. The application includes a method named ContainsHyperlink. The ContainsHyperlink() method will verify the presence of a URI and surrounding markup. The following code segment defines the ContainsHyperlink() method. (Line numbers are included for reference only.) The expression patterns used for each validation function are constant. You need to ensure that the expression syntax is evaluated only once when the Regex object is initially instantiated. Which code segment should you insert at line 04?

AOption A
BOption B
COption C
DOption D
Question #37Part 1

You are developing an application by using C#. You have the following requirements: ✑ Support 32-bit and 64-bit system configurations. ✑ Include pre-processor directives that are specific to the system configuration. ✑ Deploy an application version that includes both system configurations to testers. ✑ Ensure that stack traces include accurate line numbers. You need to configure the project to avoid changing individual configuration settings every time you deploy the application to testers. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

AUpdate the platform target and conditional compilation symbols for each application configuration.
BCreate two application configurations based on the default Release configuration.
COptimize the application through address rebasing in the 64-bit configuration.
DCreate two application configurations based on the default Debug configuration.
Question #38Part 1

You are developing a method named CreateCounters that will create performance counters for an application. The method includes the following code. (Line numbers are included for reference only.) You need to ensure that Counter1 is available for use in Windows Performance Monitor (PerfMon). Which code segment should you insert at line 16?

ACounterType = PerformanccCounterType.RawBase
BCounterType = PerformanceCounterType.AverageBase
CCounterType = PerformanceCounterType.SampleBase
DCounterType = PerformanceCounterType.CounterMultiBase
Question #39Part 1

You are developing an application that will transmit large amounts of data between a client computer and a server. You need to ensure the validity of the data by using a cryptographic hashing algorithm. Which algorithm should you use?

AHMACSHA256
BRNGCryptoServiceProvider
CDES
DAes
Question #40Part 1

You are developing an assembly that will be used by multiple applications. You need to install the assembly in the Global Assembly Cache (GAC). Which two actions can you perform to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

AUse the Assembly Registration tool (regasm.exe) to register the assembly and to copy the assembly to the GAC.
BUse the Strong Name tool (sn.exe) to copy the assembly into the GAC.
CUse Microsoft Register Server (regsvr32.exe) to add the assembly to the GAC.
DUse the Global Assembly Cache tool (gacutil.exe) to add the assembly to the GAC.
EUse Windows Installer 2.0 to add the assembly to the GAC.
Question #41Part 1

You are debugging an application that calculates loan interest. The application includes the following code. (Line numbers are included for reference only.) You need to ensure that the debugger breaks execution within the CalculateInterest() method when the loanAmount variable is less than or equal to zero in all builds of the application. What should you do?

AInsert the following code segment at line 03:Trace.Assert(loanAmount > 0);
BInsert the following code segment at line 03:Debug.Assert(loanAmount > 0);
CInsert the following code segment at line 05:Debug.Write(loanAmount > 0);
DInsert the following code segment at line 05:Trace.Write(loanAmount > 0);
Question #42Part 1

You are developing an application that accepts the input of dates from the user. Users enter the date in their local format. The date entered by the user is stored in a string variable named inputDate. The valid date value must be placed in a DateTime variable named validatedDate. You need to validate the entered date and convert it to Coordinated Universal Time (UTC). The code must not cause an exception to be thrown. Which code segment should you use?

AOption A
BOption B
COption C
DOption D

📢 Unlock Full Access to Success!

"The content displayed here is a promotional preview and contains only 50% of the actual exam database. To access the complete set of updated questions, please upgrade to the Full Version."

👉 Click the button and follow the instructions to secure your full access immediately!