SlideShare a Scribd company logo
1 of 1
Download to read offline
C++ Briefly explain what is bad, though syntactically correct, about the design of the following
code to get input from a user by way of a keyboard. Class CUserInput () {public: CUserInput
(); void AcceptUserlnputFromKeyboard(); starting GetUserlnput() const; private: string
m_sUser;
Solution
1) The code for getting input to be included.
2) If possible it is recommended to get input from the constructor.
3)No need of extra two functions for same functionality.

More Related Content

More from abhinavbhatnagar201

Will’s Widget Company (WWC) incorporated near the end of 2017. Opera.pdf
Will’s Widget Company (WWC) incorporated near the end of 2017. Opera.pdfWill’s Widget Company (WWC) incorporated near the end of 2017. Opera.pdf
Will’s Widget Company (WWC) incorporated near the end of 2017. Opera.pdf
abhinavbhatnagar201
 
Which of the following statements is true about the interaction of e.pdf
Which of the following statements is true about the interaction of e.pdfWhich of the following statements is true about the interaction of e.pdf
Which of the following statements is true about the interaction of e.pdf
abhinavbhatnagar201
 
2 a. RNA polymerase II that is actively transcribing a gene (activel.pdf
2 a. RNA polymerase II that is actively transcribing a gene (activel.pdf2 a. RNA polymerase II that is actively transcribing a gene (activel.pdf
2 a. RNA polymerase II that is actively transcribing a gene (activel.pdf
abhinavbhatnagar201
 
the reason of going infrastructure undergroundthe reason of goin.pdf
the reason of going infrastructure undergroundthe reason of goin.pdfthe reason of going infrastructure undergroundthe reason of goin.pdf
the reason of going infrastructure undergroundthe reason of goin.pdf
abhinavbhatnagar201
 

More from abhinavbhatnagar201 (20)

Capture-Recapture The bear population in a certain wildlife reserve.pdf
Capture-Recapture The bear population in a certain wildlife reserve.pdfCapture-Recapture The bear population in a certain wildlife reserve.pdf
Capture-Recapture The bear population in a certain wildlife reserve.pdf
 
b. What are the three types of structures formed when amphipathic mo.pdf
b. What are the three types of structures formed when amphipathic mo.pdfb. What are the three types of structures formed when amphipathic mo.pdf
b. What are the three types of structures formed when amphipathic mo.pdf
 
A mother with blood type A has a child with blood type A. Give all p.pdf
A mother with blood type A has a child with blood type A. Give all p.pdfA mother with blood type A has a child with blood type A. Give all p.pdf
A mother with blood type A has a child with blood type A. Give all p.pdf
 
Assume f has period 2pi. Sketch the graph of f in the interval [-4pi.pdf
Assume f has period 2pi. Sketch the graph of f in the interval [-4pi.pdfAssume f has period 2pi. Sketch the graph of f in the interval [-4pi.pdf
Assume f has period 2pi. Sketch the graph of f in the interval [-4pi.pdf
 
1.S. cerevisiae can switch mating types. Which of the following stat.pdf
1.S. cerevisiae can switch mating types. Which of the following stat.pdf1.S. cerevisiae can switch mating types. Which of the following stat.pdf
1.S. cerevisiae can switch mating types. Which of the following stat.pdf
 
You produce an interference pattern by projecting a blue laser with .pdf
You produce an interference pattern by projecting a blue laser with .pdfYou produce an interference pattern by projecting a blue laser with .pdf
You produce an interference pattern by projecting a blue laser with .pdf
 
You are working with the file directory of a Windows XP computer fro.pdf
You are working with the file directory of a Windows XP computer fro.pdfYou are working with the file directory of a Windows XP computer fro.pdf
You are working with the file directory of a Windows XP computer fro.pdf
 
You deposit $1,000 in a fund earning 5.75. How long will it take to .pdf
You deposit $1,000 in a fund earning 5.75. How long will it take to .pdfYou deposit $1,000 in a fund earning 5.75. How long will it take to .pdf
You deposit $1,000 in a fund earning 5.75. How long will it take to .pdf
 
Will’s Widget Company (WWC) incorporated near the end of 2017. Opera.pdf
Will’s Widget Company (WWC) incorporated near the end of 2017. Opera.pdfWill’s Widget Company (WWC) incorporated near the end of 2017. Opera.pdf
Will’s Widget Company (WWC) incorporated near the end of 2017. Opera.pdf
 
Which of the following would be useful and good sources of surveybou.pdf
Which of the following would be useful and good sources of surveybou.pdfWhich of the following would be useful and good sources of surveybou.pdf
Which of the following would be useful and good sources of surveybou.pdf
 
Which of the following statements is true about the interaction of e.pdf
Which of the following statements is true about the interaction of e.pdfWhich of the following statements is true about the interaction of e.pdf
Which of the following statements is true about the interaction of e.pdf
 
Which of the following identifies an underlying principle of the com.pdf
Which of the following identifies an underlying principle of the com.pdfWhich of the following identifies an underlying principle of the com.pdf
Which of the following identifies an underlying principle of the com.pdf
 
Which of the following is not a mechanism of evolution [select all t.pdf
Which of the following is not a mechanism of evolution [select all t.pdfWhich of the following is not a mechanism of evolution [select all t.pdf
Which of the following is not a mechanism of evolution [select all t.pdf
 
What is the use of discrete gates with the use of an FPGA.Soluti.pdf
What is the use of discrete gates with the use of an FPGA.Soluti.pdfWhat is the use of discrete gates with the use of an FPGA.Soluti.pdf
What is the use of discrete gates with the use of an FPGA.Soluti.pdf
 
What is the difference between the structure of DNA and proteins The.pdf
What is the difference between the structure of DNA and proteins The.pdfWhat is the difference between the structure of DNA and proteins The.pdf
What is the difference between the structure of DNA and proteins The.pdf
 
what are the basic methods to isolate nucleic acidsSolutionTh.pdf
what are the basic methods to isolate nucleic acidsSolutionTh.pdfwhat are the basic methods to isolate nucleic acidsSolutionTh.pdf
what are the basic methods to isolate nucleic acidsSolutionTh.pdf
 
What are the three major differences between the protists and bacter.pdf
What are the three major differences between the protists and bacter.pdfWhat are the three major differences between the protists and bacter.pdf
What are the three major differences between the protists and bacter.pdf
 
Whare are some real-world uses for composition functionsSoluti.pdf
Whare are some real-world uses for composition functionsSoluti.pdfWhare are some real-world uses for composition functionsSoluti.pdf
Whare are some real-world uses for composition functionsSoluti.pdf
 
2 a. RNA polymerase II that is actively transcribing a gene (activel.pdf
2 a. RNA polymerase II that is actively transcribing a gene (activel.pdf2 a. RNA polymerase II that is actively transcribing a gene (activel.pdf
2 a. RNA polymerase II that is actively transcribing a gene (activel.pdf
 
the reason of going infrastructure undergroundthe reason of goin.pdf
the reason of going infrastructure undergroundthe reason of goin.pdfthe reason of going infrastructure undergroundthe reason of goin.pdf
the reason of going infrastructure undergroundthe reason of goin.pdf
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 

C++ Briefly explain what is bad, though syntactically correct, about.pdf

  • 1. C++ Briefly explain what is bad, though syntactically correct, about the design of the following code to get input from a user by way of a keyboard. Class CUserInput () {public: CUserInput (); void AcceptUserlnputFromKeyboard(); starting GetUserlnput() const; private: string m_sUser; Solution 1) The code for getting input to be included. 2) If possible it is recommended to get input from the constructor. 3)No need of extra two functions for same functionality.