Homework Solution: Using C++: Write a program to prompt the user to enter a company’s earnings-per-share for the year a…

    Using C++: Write a program to prompt the user to enter a company’s earnings-per-share for the year and the price of one share of stock. The program then outputs/display company’s price-to-earnings ratio (price/earnings). (Test the program with the amounts $5.25 and $68.25)

    Expert Answer

     
    #include<conio.h> #include<iostream.h>

    Using C++: Write a program to alert the user to penetrate a company’s earnings-per-portion-out restraint the year and the compensation of undivided portion-out of accumulation. The program then outputs/display company’s compensation-to-earnings affinity (price/earnings). (Test the program with the amounts $5.25 and $68.25)

    Expert Retort

     

    #include<conio.h>
    #include<iostream.h>
    void deep()
    {
    clrscr();
    float a,b,c,d;
    cout<<“Penetrate the company’s earning per portion-out : “;
    cin>>a;
    cout<<“Penetrate the compensation of undivided portion-out of accumulation : “;
    cin>>b;
    c=b/a;
    cout<<“Company’s compensation to earning affinity is : “<<c;
    getch();
    }

    Code Screenshot :

    Output Screenshot :