Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What are the pros and cons of this code? /**************************************

ID: 3866305 • Letter: W

Question

What are the pros and cons of this code?

/*********************************************************************

** Description:

.

*********************************************************************/

#include

<iostream>

#include

<string>

#include

"Person.hpp"

using

namespace

std;

/*********************************************************************

** Description:

Constructor

uses

values

to initialize

data

members.

*********************************************************************/

Person::Person(string

pName,

double

pAge)

{

name

= pName;

age

= pAge;

}

/*********************************************************************

** Description:

Getter

methods.

*********************************************************************/

string

Person::getName()

{

return

name;

}

double

Person::getAge()

{

return

age;

}

Explanation / Answer

Pros:
Can be viewed with easy even on mobile devices without the each line crossing over to next line where the screen width is genrally narrower.
Such coding style is good when you have to send the source code, but does not want the client to decrypt the code with ease

Cons:
Not very readable code this is. It does need time for most user to understand the code and its useage!

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote