SlideShare a Scribd company logo
C# Programming
Instructions are as follows.
I need to use the Console.ReadKey(); and Console.Clear(); in the code.
The program should take the input and then output the code similar to the way I have it written in
the code at the end of the program. The issue I have is understanding how to use
Console.ReadKey(); instead of Readline(); and then how to call the results from the name and
quote methods to display in the DisplayResults method.
Here is what I have so far, though Im sure some of it is wrong.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Chapter3Program1
{
/*
* Program: Favorite Saying
* Programmer: Laura Sturgill
* Purpose: To allow user to enter their name and favorite saying resulting in an output with
this info.
*
* */
class Ch3Program1
{
static void Main(string[] args)
{
string name, quote;
name = GetName();
quote = GetQuote();
DisplayResults();
}
static string GetName()
{
Console.WriteLine("Please enter your name:");
string name = Console.ReadLine();
return name;
}
static string GetQuote()
{
Console.WriteLine("Please enter your favorite quote:");
string quote = Console.ReadLine();
return quote;
}
static void DisplayResults()
{
Console.Clear();
Console.WriteLine("><><><><><><><><><><><><><><><><><><><><");
Console.WriteLine( GetName +"'s Favorite Quote");
Console.WriteLine(GetQuote);
Console.WriteLine("><><><><><><><><><><><><><><><><><><><><");
}
}
}
Solution
First thing, replacing ReadLine() by the ReadKey() ...
Here keys entered by the user can be read by the program using this ReadKey() function since
the user enters data at console, we need to use Console.ReadKey() function which will do same
as the ReadLine()
Console.ReadKey().Key returns the current entered key by the user
Now to make a call to the name and quote method to display results in the DisplayResults()
method, there are few ways to make it happen
Variables in the main method which stores the return values from the name and quote method are
sent as attributes to the DisplayResults() method hence it can display these values.....

More Related Content

Similar to C# ProgrammingInstructions are as follows.I need to use the Cons.pdf

C++ AND CATEGORIES OF SOFTWARE
C++ AND CATEGORIES OF SOFTWAREC++ AND CATEGORIES OF SOFTWARE
C++ AND CATEGORIES OF SOFTWARE
UNIVERSITY OF ENGINEERING AND TECHNOLOGY TAXILA
 
Unit-IV.pptx
Unit-IV.pptxUnit-IV.pptx
Unit-IV.pptx
Mehul Desai
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
Vikram Nandini
 
Basics1
Basics1Basics1
Basics1
phanleson
 
Overview of c#
Overview of c#Overview of c#
Overview of c#
Prasanna Kumar SM
 
C++ Constructs.pptx
C++ Constructs.pptxC++ Constructs.pptx
C++ Constructs.pptx
LakshyaChauhan21
 
1 CMPS 12M Introduction to Data Structures Lab La.docx
1 CMPS 12M Introduction to Data Structures Lab La.docx1 CMPS 12M Introduction to Data Structures Lab La.docx
1 CMPS 12M Introduction to Data Structures Lab La.docx
tarifarmarie
 
C language introduction geeksfor geeks
C language introduction   geeksfor geeksC language introduction   geeksfor geeks
C language introduction geeksfor geeks
AashutoshChhedavi
 
Structure of a C# Program
Structure of a C# ProgramStructure of a C# Program
Structure of a C# Program
Ali Hassan
 
Tutorial basic of c ++lesson 1 eng ver
Tutorial basic of c ++lesson 1 eng verTutorial basic of c ++lesson 1 eng ver
Tutorial basic of c ++lesson 1 eng ver
Qrembiezs Intruder
 
lecture1 pf.pptx
lecture1 pf.pptxlecture1 pf.pptx
lecture1 pf.pptx
MalikMFalakShairUnkn
 
C# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net FrameworkC# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net Framework
Dr.Neeraj Kumar Pandey
 
Session 1
Session 1Session 1
Session 1
pham vu
 
Session 1
Session 1Session 1
Session 1
pham vu
 
Introduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to itIntroduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to it
PushkarNiroula1
 
Building Simple C Program
Building Simple  C ProgramBuilding Simple  C Program
Building Simple C Program
JeraldPastorCejas
 
Srgoc dotnet_new
Srgoc dotnet_newSrgoc dotnet_new
Srgoc dotnet_new
Gaurav Singh
 
Let's us c language (sabeel Bugti)
Let's us c language (sabeel Bugti)Let's us c language (sabeel Bugti)
Let's us c language (sabeel Bugti)
Unviersity of balochistan quetta
 
Prog1-L1.pdf
Prog1-L1.pdfProg1-L1.pdf
Prog1-L1.pdf
valerie5142000
 
Unit-2.pptx
Unit-2.pptxUnit-2.pptx
Unit-2.pptx
sidhantkulkarni1
 

Similar to C# ProgrammingInstructions are as follows.I need to use the Cons.pdf (20)

C++ AND CATEGORIES OF SOFTWARE
C++ AND CATEGORIES OF SOFTWAREC++ AND CATEGORIES OF SOFTWARE
C++ AND CATEGORIES OF SOFTWARE
 
Unit-IV.pptx
Unit-IV.pptxUnit-IV.pptx
Unit-IV.pptx
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
Basics1
Basics1Basics1
Basics1
 
Overview of c#
Overview of c#Overview of c#
Overview of c#
 
C++ Constructs.pptx
C++ Constructs.pptxC++ Constructs.pptx
C++ Constructs.pptx
 
1 CMPS 12M Introduction to Data Structures Lab La.docx
1 CMPS 12M Introduction to Data Structures Lab La.docx1 CMPS 12M Introduction to Data Structures Lab La.docx
1 CMPS 12M Introduction to Data Structures Lab La.docx
 
C language introduction geeksfor geeks
C language introduction   geeksfor geeksC language introduction   geeksfor geeks
C language introduction geeksfor geeks
 
Structure of a C# Program
Structure of a C# ProgramStructure of a C# Program
Structure of a C# Program
 
Tutorial basic of c ++lesson 1 eng ver
Tutorial basic of c ++lesson 1 eng verTutorial basic of c ++lesson 1 eng ver
Tutorial basic of c ++lesson 1 eng ver
 
lecture1 pf.pptx
lecture1 pf.pptxlecture1 pf.pptx
lecture1 pf.pptx
 
C# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net FrameworkC# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net Framework
 
Session 1
Session 1Session 1
Session 1
 
Session 1
Session 1Session 1
Session 1
 
Introduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to itIntroduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to it
 
Building Simple C Program
Building Simple  C ProgramBuilding Simple  C Program
Building Simple C Program
 
Srgoc dotnet_new
Srgoc dotnet_newSrgoc dotnet_new
Srgoc dotnet_new
 
Let's us c language (sabeel Bugti)
Let's us c language (sabeel Bugti)Let's us c language (sabeel Bugti)
Let's us c language (sabeel Bugti)
 
Prog1-L1.pdf
Prog1-L1.pdfProg1-L1.pdf
Prog1-L1.pdf
 
Unit-2.pptx
Unit-2.pptxUnit-2.pptx
Unit-2.pptx
 

More from faxteldelhi

How dose the FAA provide oversight to insure compliance of the Safet.pdf
How dose the FAA provide oversight to insure compliance of the Safet.pdfHow dose the FAA provide oversight to insure compliance of the Safet.pdf
How dose the FAA provide oversight to insure compliance of the Safet.pdf
faxteldelhi
 
For Cooperative Diversity (CD) system, please talk about its potenti.pdf
For Cooperative Diversity (CD) system, please talk about its potenti.pdfFor Cooperative Diversity (CD) system, please talk about its potenti.pdf
For Cooperative Diversity (CD) system, please talk about its potenti.pdf
faxteldelhi
 
Dr. Kellie Leitch glanced at the data on wait times collected from t.pdf
Dr. Kellie Leitch glanced at the data on wait times collected from t.pdfDr. Kellie Leitch glanced at the data on wait times collected from t.pdf
Dr. Kellie Leitch glanced at the data on wait times collected from t.pdf
faxteldelhi
 
Arthur Burton established Astro Airlines in 1980; two years after th.pdf
Arthur Burton established Astro Airlines in 1980; two years after th.pdfArthur Burton established Astro Airlines in 1980; two years after th.pdf
Arthur Burton established Astro Airlines in 1980; two years after th.pdf
faxteldelhi
 
ASTRONOMY Martian polar caps, Dont Change with Martian the seas.pdf
ASTRONOMY Martian polar caps, Dont Change with Martian the seas.pdfASTRONOMY Martian polar caps, Dont Change with Martian the seas.pdf
ASTRONOMY Martian polar caps, Dont Change with Martian the seas.pdf
faxteldelhi
 
why penicilina cant be use for walking ammonia SolutionI gu.pdf
why penicilina cant be use for walking ammonia SolutionI gu.pdfwhy penicilina cant be use for walking ammonia SolutionI gu.pdf
why penicilina cant be use for walking ammonia SolutionI gu.pdf
faxteldelhi
 
Why is a monophasic recording a better representation of overall ner.pdf
Why is a monophasic recording a better representation of overall ner.pdfWhy is a monophasic recording a better representation of overall ner.pdf
Why is a monophasic recording a better representation of overall ner.pdf
faxteldelhi
 
Which of the following are state functions (Select all that apply.) .pdf
Which of the following are state functions (Select all that apply.) .pdfWhich of the following are state functions (Select all that apply.) .pdf
Which of the following are state functions (Select all that apply.) .pdf
faxteldelhi
 
Which of the following are NOT correctly matchedprotease lipid di.pdf
Which of the following are NOT correctly matchedprotease lipid di.pdfWhich of the following are NOT correctly matchedprotease lipid di.pdf
Which of the following are NOT correctly matchedprotease lipid di.pdf
faxteldelhi
 
When add NH4OH into the solution which contains Co2+, Ni2+, Cr3+, Fe.pdf
When add NH4OH into the solution which contains Co2+, Ni2+, Cr3+, Fe.pdfWhen add NH4OH into the solution which contains Co2+, Ni2+, Cr3+, Fe.pdf
When add NH4OH into the solution which contains Co2+, Ni2+, Cr3+, Fe.pdf
faxteldelhi
 
What is the role of PL SQL and why is it important Support your ans.pdf
What is the role of PL SQL and why is it important Support your ans.pdfWhat is the role of PL SQL and why is it important Support your ans.pdf
What is the role of PL SQL and why is it important Support your ans.pdf
faxteldelhi
 
What does it mean to be alive What environmental, economic, politic.pdf
What does it mean to be alive What environmental, economic, politic.pdfWhat does it mean to be alive What environmental, economic, politic.pdf
What does it mean to be alive What environmental, economic, politic.pdf
faxteldelhi
 
What do expect to find in the cells of lobsters to explain their imm.pdf
What do expect to find in the cells of lobsters to explain their imm.pdfWhat do expect to find in the cells of lobsters to explain their imm.pdf
What do expect to find in the cells of lobsters to explain their imm.pdf
faxteldelhi
 
Using empathy when encoding a message is the most important elem.pdf
Using empathy when encoding a message is the most important elem.pdfUsing empathy when encoding a message is the most important elem.pdf
Using empathy when encoding a message is the most important elem.pdf
faxteldelhi
 
This is a definition of which type of attack A technique used to ga.pdf
This is a definition of which type of attack A technique used to ga.pdfThis is a definition of which type of attack A technique used to ga.pdf
This is a definition of which type of attack A technique used to ga.pdf
faxteldelhi
 
The left and right ventricles are referred to as systemic and pulmona.pdf
The left and right ventricles are referred to as systemic and pulmona.pdfThe left and right ventricles are referred to as systemic and pulmona.pdf
The left and right ventricles are referred to as systemic and pulmona.pdf
faxteldelhi
 
the following is tnac ing two items 1-a Certificate of Deposit (CD),.pdf
the following is tnac ing two items 1-a Certificate of Deposit (CD),.pdfthe following is tnac ing two items 1-a Certificate of Deposit (CD),.pdf
the following is tnac ing two items 1-a Certificate of Deposit (CD),.pdf
faxteldelhi
 
The first fundamental form is an intrinsic quantity. Explain what thi.pdf
The first fundamental form is an intrinsic quantity. Explain what thi.pdfThe first fundamental form is an intrinsic quantity. Explain what thi.pdf
The first fundamental form is an intrinsic quantity. Explain what thi.pdf
faxteldelhi
 
The business cycle peak associated with the Great Recession was in Se.pdf
The business cycle peak associated with the Great Recession was in Se.pdfThe business cycle peak associated with the Great Recession was in Se.pdf
The business cycle peak associated with the Great Recession was in Se.pdf
faxteldelhi
 
4. Explain the effect of temperature on the solubility of CO2 in wate.pdf
4. Explain the effect of temperature on the solubility of CO2 in wate.pdf4. Explain the effect of temperature on the solubility of CO2 in wate.pdf
4. Explain the effect of temperature on the solubility of CO2 in wate.pdf
faxteldelhi
 

More from faxteldelhi (20)

How dose the FAA provide oversight to insure compliance of the Safet.pdf
How dose the FAA provide oversight to insure compliance of the Safet.pdfHow dose the FAA provide oversight to insure compliance of the Safet.pdf
How dose the FAA provide oversight to insure compliance of the Safet.pdf
 
For Cooperative Diversity (CD) system, please talk about its potenti.pdf
For Cooperative Diversity (CD) system, please talk about its potenti.pdfFor Cooperative Diversity (CD) system, please talk about its potenti.pdf
For Cooperative Diversity (CD) system, please talk about its potenti.pdf
 
Dr. Kellie Leitch glanced at the data on wait times collected from t.pdf
Dr. Kellie Leitch glanced at the data on wait times collected from t.pdfDr. Kellie Leitch glanced at the data on wait times collected from t.pdf
Dr. Kellie Leitch glanced at the data on wait times collected from t.pdf
 
Arthur Burton established Astro Airlines in 1980; two years after th.pdf
Arthur Burton established Astro Airlines in 1980; two years after th.pdfArthur Burton established Astro Airlines in 1980; two years after th.pdf
Arthur Burton established Astro Airlines in 1980; two years after th.pdf
 
ASTRONOMY Martian polar caps, Dont Change with Martian the seas.pdf
ASTRONOMY Martian polar caps, Dont Change with Martian the seas.pdfASTRONOMY Martian polar caps, Dont Change with Martian the seas.pdf
ASTRONOMY Martian polar caps, Dont Change with Martian the seas.pdf
 
why penicilina cant be use for walking ammonia SolutionI gu.pdf
why penicilina cant be use for walking ammonia SolutionI gu.pdfwhy penicilina cant be use for walking ammonia SolutionI gu.pdf
why penicilina cant be use for walking ammonia SolutionI gu.pdf
 
Why is a monophasic recording a better representation of overall ner.pdf
Why is a monophasic recording a better representation of overall ner.pdfWhy is a monophasic recording a better representation of overall ner.pdf
Why is a monophasic recording a better representation of overall ner.pdf
 
Which of the following are state functions (Select all that apply.) .pdf
Which of the following are state functions (Select all that apply.) .pdfWhich of the following are state functions (Select all that apply.) .pdf
Which of the following are state functions (Select all that apply.) .pdf
 
Which of the following are NOT correctly matchedprotease lipid di.pdf
Which of the following are NOT correctly matchedprotease lipid di.pdfWhich of the following are NOT correctly matchedprotease lipid di.pdf
Which of the following are NOT correctly matchedprotease lipid di.pdf
 
When add NH4OH into the solution which contains Co2+, Ni2+, Cr3+, Fe.pdf
When add NH4OH into the solution which contains Co2+, Ni2+, Cr3+, Fe.pdfWhen add NH4OH into the solution which contains Co2+, Ni2+, Cr3+, Fe.pdf
When add NH4OH into the solution which contains Co2+, Ni2+, Cr3+, Fe.pdf
 
What is the role of PL SQL and why is it important Support your ans.pdf
What is the role of PL SQL and why is it important Support your ans.pdfWhat is the role of PL SQL and why is it important Support your ans.pdf
What is the role of PL SQL and why is it important Support your ans.pdf
 
What does it mean to be alive What environmental, economic, politic.pdf
What does it mean to be alive What environmental, economic, politic.pdfWhat does it mean to be alive What environmental, economic, politic.pdf
What does it mean to be alive What environmental, economic, politic.pdf
 
What do expect to find in the cells of lobsters to explain their imm.pdf
What do expect to find in the cells of lobsters to explain their imm.pdfWhat do expect to find in the cells of lobsters to explain their imm.pdf
What do expect to find in the cells of lobsters to explain their imm.pdf
 
Using empathy when encoding a message is the most important elem.pdf
Using empathy when encoding a message is the most important elem.pdfUsing empathy when encoding a message is the most important elem.pdf
Using empathy when encoding a message is the most important elem.pdf
 
This is a definition of which type of attack A technique used to ga.pdf
This is a definition of which type of attack A technique used to ga.pdfThis is a definition of which type of attack A technique used to ga.pdf
This is a definition of which type of attack A technique used to ga.pdf
 
The left and right ventricles are referred to as systemic and pulmona.pdf
The left and right ventricles are referred to as systemic and pulmona.pdfThe left and right ventricles are referred to as systemic and pulmona.pdf
The left and right ventricles are referred to as systemic and pulmona.pdf
 
the following is tnac ing two items 1-a Certificate of Deposit (CD),.pdf
the following is tnac ing two items 1-a Certificate of Deposit (CD),.pdfthe following is tnac ing two items 1-a Certificate of Deposit (CD),.pdf
the following is tnac ing two items 1-a Certificate of Deposit (CD),.pdf
 
The first fundamental form is an intrinsic quantity. Explain what thi.pdf
The first fundamental form is an intrinsic quantity. Explain what thi.pdfThe first fundamental form is an intrinsic quantity. Explain what thi.pdf
The first fundamental form is an intrinsic quantity. Explain what thi.pdf
 
The business cycle peak associated with the Great Recession was in Se.pdf
The business cycle peak associated with the Great Recession was in Se.pdfThe business cycle peak associated with the Great Recession was in Se.pdf
The business cycle peak associated with the Great Recession was in Se.pdf
 
4. Explain the effect of temperature on the solubility of CO2 in wate.pdf
4. Explain the effect of temperature on the solubility of CO2 in wate.pdf4. Explain the effect of temperature on the solubility of CO2 in wate.pdf
4. Explain the effect of temperature on the solubility of CO2 in wate.pdf
 

Recently uploaded

Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 

Recently uploaded (20)

Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
 

C# ProgrammingInstructions are as follows.I need to use the Cons.pdf

  • 1. C# Programming Instructions are as follows. I need to use the Console.ReadKey(); and Console.Clear(); in the code. The program should take the input and then output the code similar to the way I have it written in the code at the end of the program. The issue I have is understanding how to use Console.ReadKey(); instead of Readline(); and then how to call the results from the name and quote methods to display in the DisplayResults method. Here is what I have so far, though Im sure some of it is wrong. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Chapter3Program1 { /* * Program: Favorite Saying * Programmer: Laura Sturgill * Purpose: To allow user to enter their name and favorite saying resulting in an output with this info. * * */ class Ch3Program1 { static void Main(string[] args) { string name, quote; name = GetName(); quote = GetQuote(); DisplayResults(); } static string GetName() { Console.WriteLine("Please enter your name:"); string name = Console.ReadLine();
  • 2. return name; } static string GetQuote() { Console.WriteLine("Please enter your favorite quote:"); string quote = Console.ReadLine(); return quote; } static void DisplayResults() { Console.Clear(); Console.WriteLine("><><><><><><><><><><><><><><><><><><><><"); Console.WriteLine( GetName +"'s Favorite Quote"); Console.WriteLine(GetQuote); Console.WriteLine("><><><><><><><><><><><><><><><><><><><><"); } } } Solution First thing, replacing ReadLine() by the ReadKey() ... Here keys entered by the user can be read by the program using this ReadKey() function since the user enters data at console, we need to use Console.ReadKey() function which will do same as the ReadLine() Console.ReadKey().Key returns the current entered key by the user Now to make a call to the name and quote method to display results in the DisplayResults() method, there are few ways to make it happen Variables in the main method which stores the return values from the name and quote method are sent as attributes to the DisplayResults() method hence it can display these values.....