SlideShare a Scribd company logo
//Declares String Variables "firstName" and "lastName" 
string firstName = "John"; 
string lastName = "Doe"; 
//Writes the values of "firstName" and "lastName" on the screen 
Console.WriteLine("Name:" + firstName + " " + lastName); 
//Asks for new value for "firstName" 
Console.WriteLine("Please enter a new first name:"); 
firstName = Console.ReadLine(); 
//Asks for new value for "firstName" 
Console.WriteLine("Please enter a new last name:"); 
lastName = Console.ReadLine(); 
//Writes down the new first name 
Console.WriteLine("New first name: " + firstName); 
//Writes down the new last name 
Console.WriteLine("New last name: " + lastName); 
Console.WriteLine("Name: " + firstName + " " + lastName); 
//Takes the value of a two variables "Number1" and "Number2" 
Console.WriteLine("Enter a number:"); 
string _Number1 = Console.ReadLine(); 
Double Number1 = Convert.ToDouble(_Number1); 
Console.WriteLine("Enter another number:"); 
string _Number2 = Console.ReadLine(); 
Double Number2 = Convert.ToDouble(_Number2); 
//Add Number 1 to Number 2 and store value as a double variable "SUM" 
Double SUM = Number2 + Number1; 
//Print Result SUM 
Console.WriteLine("The sum is " + SUM); 
//Subtract Number 1 with Number 2 and store value as a double variable "DIFF" 
(Insert code below) 
//Print Result SUM 
Console.WriteLine("The difference is " + DIFF); 
//Multiply Number 1 with Number 2 and store value as a double variable "PROD" 
(Insert code below) 
//Print Result PROD (Insert code below) 
//Divide Number 1 with Number 2 and store value as a double variable "QUOT" 
(Insert code below) 
//Print Result QUOT (Insert code below) 
Console.WriteLine("Tap ENTER Key to close program"); 
Console.Read();

More Related Content

PDF
Devtools Tips & Tricks
PDF
Crystal Rocks
PPTX
Type script in practice
TXT
nltkExamples
TXT
Database script
PDF
Javascript - The basics
PPTX
Perl: Coro asynchronous
PPTX
node.js workshop- node.js middleware
Devtools Tips & Tricks
Crystal Rocks
Type script in practice
nltkExamples
Database script
Javascript - The basics
Perl: Coro asynchronous
node.js workshop- node.js middleware

What's hot (12)

PDF
Introduction to rust: a low-level language with high-level abstractions
PDF
Продвинутая отладка JavaScript с помощью Chrome Dev Tools
PPTX
node.js workshop- node.js basics
DOCX
RedHat/CentOs Commands for administrative works
PPTX
Linux Shell Scripts and Shell Commands✌️
PDF
Unleash your build with nuke
RTF
RegistryModClass
KEY
Tres Gemas De Ruby
PPTX
Visualizing ORACLE performance data with R @ #C16LV
PPTX
Ns2 ns3 training in mohali
PDF
PSGI REST API
PPT
Action script 101
Introduction to rust: a low-level language with high-level abstractions
Продвинутая отладка JavaScript с помощью Chrome Dev Tools
node.js workshop- node.js basics
RedHat/CentOs Commands for administrative works
Linux Shell Scripts and Shell Commands✌️
Unleash your build with nuke
RegistryModClass
Tres Gemas De Ruby
Visualizing ORACLE performance data with R @ #C16LV
Ns2 ns3 training in mohali
PSGI REST API
Action script 101
Ad

Similar to Var and Ops quiz (17)

PPT
Wlkthru vb netconsole-inputoutput
PPT
04 Console input output-
DOCX
Bodlogiin code
PDF
Bookstore-Project
PPTX
Everyday's JS
PDF
Bologna Developer Zone - About Kotlin
PDF
Back to the Future with TypeScript
PPTX
04. Console Input Output
PDF
Fb cheatsheet12b
PDF
The Ring programming language version 1.5.2 book - Part 14 of 181
PDF
Integration Project Inspection 3
PPTX
Powerpoint presentation final requirement in fnd prg
PDF
Solution manual of shell programming assignment 2
PDF
recap-js-and-ts.pdf
PDF
15646254 c-balaguruswamy-solved-programs
PDF
The Ring programming language version 1.10 book - Part 22 of 212
PDF
Javascript essentials
Wlkthru vb netconsole-inputoutput
04 Console input output-
Bodlogiin code
Bookstore-Project
Everyday's JS
Bologna Developer Zone - About Kotlin
Back to the Future with TypeScript
04. Console Input Output
Fb cheatsheet12b
The Ring programming language version 1.5.2 book - Part 14 of 181
Integration Project Inspection 3
Powerpoint presentation final requirement in fnd prg
Solution manual of shell programming assignment 2
recap-js-and-ts.pdf
15646254 c-balaguruswamy-solved-programs
The Ring programming language version 1.10 book - Part 22 of 212
Javascript essentials
Ad

More from "Filniño Edmar Ambos" (8)

PPTX
Computer class rules
PPTX
Math Class (System.Math)
PPTX
Banner Design Tips
PPTX
Introduction to Desktop Applications In C#
PPTX
Photoshop Poster Color Tips for M1 Class
PPTX
Lesson 3: Variables and Expressions
PPTX
Lesson 2: Introduction to C#
PPTX
Lesson1: Introduction to Programming
Computer class rules
Math Class (System.Math)
Banner Design Tips
Introduction to Desktop Applications In C#
Photoshop Poster Color Tips for M1 Class
Lesson 3: Variables and Expressions
Lesson 2: Introduction to C#
Lesson1: Introduction to Programming

Recently uploaded (20)

PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Classroom Observation Tools for Teachers
PDF
Pre independence Education in Inndia.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Complications of Minimal Access Surgery at WLH
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Computing-Curriculum for Schools in Ghana
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Anesthesia in Laparoscopic Surgery in India
human mycosis Human fungal infections are called human mycosis..pptx
Supply Chain Operations Speaking Notes -ICLT Program
Final Presentation General Medicine 03-08-2024.pptx
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Classroom Observation Tools for Teachers
Pre independence Education in Inndia.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Microbial disease of the cardiovascular and lymphatic systems
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
102 student loan defaulters named and shamed – Is someone you know on the list?
Complications of Minimal Access Surgery at WLH
O5-L3 Freight Transport Ops (International) V1.pdf
O7-L3 Supply Chain Operations - ICLT Program
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Computing-Curriculum for Schools in Ghana

Var and Ops quiz

  • 1. //Declares String Variables "firstName" and "lastName" string firstName = "John"; string lastName = "Doe"; //Writes the values of "firstName" and "lastName" on the screen Console.WriteLine("Name:" + firstName + " " + lastName); //Asks for new value for "firstName" Console.WriteLine("Please enter a new first name:"); firstName = Console.ReadLine(); //Asks for new value for "firstName" Console.WriteLine("Please enter a new last name:"); lastName = Console.ReadLine(); //Writes down the new first name Console.WriteLine("New first name: " + firstName); //Writes down the new last name Console.WriteLine("New last name: " + lastName); Console.WriteLine("Name: " + firstName + " " + lastName); //Takes the value of a two variables "Number1" and "Number2" Console.WriteLine("Enter a number:"); string _Number1 = Console.ReadLine(); Double Number1 = Convert.ToDouble(_Number1); Console.WriteLine("Enter another number:"); string _Number2 = Console.ReadLine(); Double Number2 = Convert.ToDouble(_Number2); //Add Number 1 to Number 2 and store value as a double variable "SUM" Double SUM = Number2 + Number1; //Print Result SUM Console.WriteLine("The sum is " + SUM); //Subtract Number 1 with Number 2 and store value as a double variable "DIFF" (Insert code below) //Print Result SUM Console.WriteLine("The difference is " + DIFF); //Multiply Number 1 with Number 2 and store value as a double variable "PROD" (Insert code below) //Print Result PROD (Insert code below) //Divide Number 1 with Number 2 and store value as a double variable "QUOT" (Insert code below) //Print Result QUOT (Insert code below) Console.WriteLine("Tap ENTER Key to close program"); Console.Read();