Question: 1) Write a C# program using Notepad (do not use Visual Studio IDE). You may use any statement you have learnt so far in C#.


1) Write a C# program using Notepad (do not use Visual Studio IDE). You may use any statement you have learnt so far in C#. For example: Try to declare some variables of different data types, demonstrate how you assign valid literals to them. Print the variables' values using format strings. Make sure to embed comments to explain what each data type mean and in what context you should use such variables, (Subm ation: Create a MS word document.cond paste the C# Sem in MS word You cea a usmg notep-7) After completing the C# program, open up Command Prompt(cmd) window. Compile your C sharp program and Execute it. Take the screen shots of the command prompt and paste in MS Word document. Also copy and paste the C# code in your Word document. Make sure that you paste the output screen below the C# code. ASSIGNMENT 1 CSD 2354 (C#) Question - 2) Create a C# Console application( DOT net framework) using Visual Studio IDE. Project name should include students' firstname(s) followed by Al(Example: HarleenHardeep_AI) In this project. Rename Program.cs to A1Q2.cs. In A1Q2.cs do the following tasks: Step 1) Declare variables of different data types ( at least 10 variables ). Step 2) Assign valid literals to those variables. Step 3) Print the values of the variables using format strings and placeholders in Console.Write() Console.WriteLine). Step 4) Print values of some variables in following formats: 1) Currency ii) Number i) Hexadecimal Iv) Percentage. Step 5) Embed comment lines before each Console.WriteLine and explain, how the format strings and placeholders work. Step 6) Perform some arithmetic operations on the variables you declared in step 1. You should demonstrate the use of following arithmetic operations +,-./, and % Step 7) Demonstrate the use of increment(++) and decrement(--) operators with example, explain them, by embedding comments in the program. Step 8) Demonstrate the use of comparison operators. Question - 3) Using Visual studio demonstrate types of Errors in C#: (Submission Instruction: Take the screenshots of those errors and paste in the MS Word file and explain the cause of errors and how you can fix them) You may use the same project which you used in Question to show how can errors may occur and how you fix them. Types of errors you should demonstrate are : Syntax errors Runtime Errors Logical Errors [
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
