Declare variables of different data types (at least 10 variables ). Assign valid literals to those variables. Print the values of the variables using format strings and placeholders in Console.Write() Console.WriteLine(). 21 Page ASSIGNMENT 1 CSD 2354 (C#) Step 4) Print values of some variables in following formats: i) Currency ii) Number iii) 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. Step 1) Step 2) Step 3)

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter10: Classes And Objects
Section: Chapter Questions
Problem 8E
icon
Related questions
Question
Question - 2) Create a C# Console application(DOT net framework) using Visual Studio IDE.
Project name should include students' firstname(s) followed by A1(Example:
HarleenHardeep_A1)
(Submission Instruction: sumbit the Zipped project folder)
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).
Assign valid literals to those variables.
Step 2)
Step 3)
Print the values of the variables using format strings and placeholders in
Console.Write() Console.WriteLine().
2 | Page
ASSIGNMENT 1
CSD 2354 (C#)
Print values of some variables in following formats:
i)
Currency
Number
Hexadecimal,
iv)
Percentage.
Embed comment lines before each Console.WriteLine and explain, how the
format strings and placeholders work.
Perform some arithmetic operations on the variables you declared in step 1.
You should demonstrate the use of following arithmetic operations
+,-,/, * and %
Demonstrate the use of increment(++) and decrement(--) operators with
example, explain them, by embedding comments in the program.
Demonstrate the use of comparison operators.
Step 4)
Step 5)
Step 6)
Step 7)
Step 8)
Transcribed Image Text:Question - 2) Create a C# Console application(DOT net framework) using Visual Studio IDE. Project name should include students' firstname(s) followed by A1(Example: HarleenHardeep_A1) (Submission Instruction: sumbit the Zipped project folder) 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). Assign valid literals to those variables. Step 2) Step 3) Print the values of the variables using format strings and placeholders in Console.Write() Console.WriteLine(). 2 | Page ASSIGNMENT 1 CSD 2354 (C#) Print values of some variables in following formats: i) Currency Number Hexadecimal, iv) Percentage. Embed comment lines before each Console.WriteLine and explain, how the format strings and placeholders work. Perform some arithmetic operations on the variables you declared in step 1. You should demonstrate the use of following arithmetic operations +,-,/, * and % Demonstrate the use of increment(++) and decrement(--) operators with example, explain them, by embedding comments in the program. Demonstrate the use of comparison operators. Step 4) Step 5) Step 6) Step 7) Step 8)
class Program
{
O references
static void Main(string[] args)
{
int i = 3;
bool result;
result = (32> 87);
Console.WriteLine(" (32> 87) is {0}", result);
result =
(-20 == -20);
===
-20) is {0}", result);
Console.WriteLine(" (-20
result = -20 == -20;
Console.WriteLine("-20 == -20 is {0}", result);
result = -20 == -10- 10;
Console.WriteLine(" -20 == -10 10 is {0}", result);
Console.WriteLine(" 16 <= 54 is {0}", (16 <= 54));
Console.WriteLine(" i != 3 is {0}", (i != 3));
Console.ReadKey();
Transcribed Image Text:class Program { O references static void Main(string[] args) { int i = 3; bool result; result = (32> 87); Console.WriteLine(" (32> 87) is {0}", result); result = (-20 == -20); === -20) is {0}", result); Console.WriteLine(" (-20 result = -20 == -20; Console.WriteLine("-20 == -20 is {0}", result); result = -20 == -10- 10; Console.WriteLine(" -20 == -10 10 is {0}", result); Console.WriteLine(" 16 <= 54 is {0}", (16 <= 54)); Console.WriteLine(" i != 3 is {0}", (i != 3)); Console.ReadKey();
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
JQuery and Javascript
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT