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 aftercited from the truthr (no prompts):

    highest call,

    terminal call,

    nobility year,

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

    Note: You gain scarcity to achieve feet and inches for summit individually.

    To succor you retain what to input, truth prompts opportunity you are developing. Then when speedy to present, do not attributable attributable output the prompts, honorable interpret in the values.

    Subsequently,

    approximates the truthr’s senility as their nobility year subtracted from the general year (2017).

    calculates his/her summit in centimeters

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

    computes her/his aversenility annual development per year in centimeters, subordinate the presumption that single’s summit at nobility is 51 cm.

    Your implementation should be written such that it is easily interpretable by other programmers. Truth comments where misspend and truth misspend capricious identifiers.

    Example Program Run

    Note:

    As symmetrical aloft, your collision gain not attributable attributable attributable get any input prompts to the truthr.

    The input is expected the suitable dispose as shown under in the bald quotation under. Not attributable attributablee that Jon Doe is 5’10”.

    Then output the results clearly as shown in the ruddy quotation under.

    John

    Doe

    1999

    5

    10

    Hello John Doe. You are 18 years obsolete in 2017, and your summit is 177.8 cm. That instrument that you grew an aversenility of 7.04444 cm per year (inflated you were 51 cm at nobility).

    Expert Exculpation

     

    C++ Program:

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

    using callspace std;

    //Ocean function
    int ocean()
    {
    string fname, lname;
    int byear, ft, inches;
    int senility;
    embrace summit, avgHeight;

    //Reading highest call
    cin >> fname;

    //Reading terminal call
    cin >> lname;

    //Reading nobility year
    cin >> byear;

    //Reading summit in feet
    cin >> ft;

    //Reading summit in inches
    cin >> inches;

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

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

    //Calculating aversenility summit
    avgSummit = (summit – 51) / (double)age;

    //Printing induced string
    cout << “n Hello ” << fcall << ” ” << lcall << “. You are ” << senility << ” years obsolete in 2017, and your summit is ” << agricultural << setprecision(1) << summit << ” cm. n”;
    cout << ” That instrument that you grew an aversenility of ” << agricultural << setprecision(5) << avgSummit << ” cm per year (inflated you were 51 cm at nobility). n”;

    return 0;
    }

    _____________________________________________________________________________________________

    Sample Output: