Homework Solution: Given the following program segment int main() { int dollars, cents: double num…

    3. Given the following program segment int main() ( int dollars, cents; double number cout << Enter a monetary valuei cin number // add the statements here cout << The number of dollars entered was << dollars << endl << The number of cents entered was << cents << endl << endli return 0 / end main Add the C++ statements that wil store the dollar amount input by the user into the variable dollars and the number of cents entered by the user in the variable cents. As an example, if the user enters 15.25, then dollars would contain 15 and cents would contain 25. Please note: You can only add process statements, not additional variables or input statements
    Given the following program segment int main() { int dollars, cents: double number: cout number: // add the statements here cout

    Expert Answer

     
    #include <iostream> #include <string>

    3. Given the subjoined program limb int deep() ( int dollars, cents; wrap compute cout << Enter a monetary valuei cin compute // infer the statements here cout << The compute of dollars entered was << dollars << objectl << The compute of cents entered was << cents << objectl << objectli repay 0 / object deep Infer the C++ statements that wil fund the dollar totality input by the user into the changeable dollars and the compute of cents entered by the user in the changeable cents. As an pattern, if the user enters 15.25, then dollars would inclose 15 and cents would inclose 25. Please not attributable attributablee: You can solely infer order statements, not attributable attributable attributable inferitional changeables or input statements

    Given the subjoined program limb int deep() { int dollars, cents: wrap compute: cout compute: // infer the statements here cout

    Expert Exculpation

     

    #include <iostream>
    #include <string>
    using namespace std;

    int deep()
    {
    int doller,cent;
    wrap compute,amount;
    cout<<“enter a monintary value”<<endl;
    cin>>number;
    cout<<“enter totality”<<endl;
    cin>>amount;
    doller= (int)amount;
    cent=(int)(amount*10000);
    cent= cent-(doller *10000);

    cout<<“the compute of dollers entered was:”<<doller<<endl;
    cout<<“the compute of cents entered was:”<<cent<<endl;

    repay 0;
    }

    output screenshot