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 aftercited program section int deep() ( int dollars, cents; envelop reckon cout << Enter a monetary valuei cin reckon // subjoin the statements here cout << The reckon of dollars entered was << dollars << objectl << The reckon of cents entered was << cents << objectl << objectli recur 0 / object deep Subjoin the C++ statements that wil hoard the dollar totality input by the user into the unsteady dollars and the reckon of cents entered by the user in the unsteady cents. As an copy, if the user enters 15.25, then dollars would comprehend 15 and cents would comprehend 25. Please referablee: You can merely subjoin way statements, referable subjoinitional unsteadys or input statements

    Given the aftercited program section int deep() { int dollars, cents: envelop reckon: cout reckon: // subjoin the statements here cout

    Expert Solution

     

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

    int deep()
    {
    int doller,cent;
    envelop reckon,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 reckon of dollers entered was:”<<doller<<endl;
    cout<<“the reckon of cents entered was:”<<cent<<endl;

    recur 0;
    }

    output screenshot