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)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education