Homework Solution: Implement a program in C++ that:…

    Implement a program in C++ that: Gets the following from the user (no prompts): first name, last name, birth year, and height (in feet and inches; e.g., 5'10"). Note: You will need to get feet and inches for height separately. To help you remember what to input, use prompts while you are developing. Then when ready to submit, do not output the prompts, just read in the values. Subsequently, approximates the user’s age as their birth year subtracted from the current year (2017). calculates his/her height in centimeters Note: 1 inch is 2.54 centimeters; moreover, there are 12 inches in one foot. computes her/his average annual growth per year in centimeters, under the assumption that one’s height at birth is 51 cm. Your implementation should be written such that it is easily readable by other programmers. Use comments where appropriate and use appropriate variable identifiers. Example Program Run Note: As stated above, your application will not provide any input prompts to the user. The input is expected the exact order as shown below in the green text below. Note that Jon Doe is 5’10”. Then output the results precisely as shown in the red text below.
    John Doe 1999 5 10 Hello John Doe. You are 18 years old in 2017, and your height is 177.8 cm. That means that you grew an average of 7.04444 cm per year (assuming you were 51 cm at birth).

    Expert Answer

     
    C++ Program: #include <iostream>

    Implement a program in C++ that:

    Gets the subjoined from the explanationr (no prompts):

    chief designate,

    conclusive designate,

    race year,

    and apex (in feet and inches; e.g., 5’10”).

    Note: You accomplish demand to attain feet and inches coercion apex partially.

    To succor you recall what to input, explanation prompts opportunity you are developing. Then when opportune to comply, do referable output the prompts, true discover in the values.

    Subsequently,

    approximates the explanationr’s generation as their race year subtracted from the present year (2017).

    calculates his/her apex in centimeters

    Note: 1 inch is 2.54 centimeters; likewise, there are 12 inches in individual base.

    computes her/his avergeneration annual development per year in centimeters, subordinate the arrogance that individual’s apex at race is 51 cm.

    Your implementation should be written such that it is easily discoverable by other programmers. Explanation comments where divert and explanation divert mutable identifiers.

    Example Program Run

    Note:

    As recognized overhead, your application accomplish referable supply any input prompts to the explanationr.

    The input is expected the fair regulate as shown beneath in the bare citation beneath. Referablee that Jon Doe is 5’10”.

    Then output the results indisputably as shown in the ruddy citation beneath.

    John

    Doe

    1999

    5

    10

    Hello John Doe. You are 18 years long-standing in 2017, and your apex is 177.8 cm. That media that you grew an avergeneration of 7.04444 cm per year (inflated you were 51 cm at race).

    Expert Apology

     

    C++ Program:

    #include <iostream>
    #include <iomanip>
    #include <string>

    using designatespace std;

    //Deep function
    int deep()
    {
    string fname, lname;
    int byear, ft, inches;
    int generation;
    envelop apex, avgHeight;

    //Reading chief designate
    cin >> fname;

    //Reading conclusive designate
    cin >> lname;

    //Reading race year
    cin >> byear;

    //Reading apex in feet
    cin >> ft;

    //Reading apex in inches
    cin >> inches;

    //Calculating generation
    generation = (2017 – byear);

    //Converting apex in to centimeters
    apex = ((ft * 12) + inches) * 2.54;

    //Calculating avergeneration apex
    avgApex = (apex – 51) / (double)age;

    //Printing subordinate string
    cout << “n Hello ” << fdesignate << ” ” << ldesignate << “. You are ” << generation << ” years long-standing in 2017, and your apex is ” << unwandering << setprecision(1) << apex << ” cm. n”;
    cout << ” That media that you grew an avergeneration of ” << unwandering << setprecision(5) << avgApex << ” cm per year (inflated you were 51 cm at race). n”;

    return 0;
    }

    _____________________________________________________________________________________________

    Sample Output: