Menu

(Solved) : Pdf File Contain Screen Shots Write Statements Corresponds Done Also Write Using Combined Q30716894 . . .

In the PDF file thatwill contain your screen shots, write the statements thatcorresponds to what is done and also write it using combinedassignment operators to perform the following (‘A’ and ‘B’ areshown as examples):

Statement:

Combined:

A) Add 6 to x.

x = x + 6

x += 6

B) Subtract 4 fromamount.

amount = amount –4

amount -=4

C) Multiply y by4.

D) Divide total by27.

E) Store in x theremainder of x divided by 7.

F) Add y * 5 to x.

G) Subtract discounttimes 4 from total.

H) Multiply increaseby salesRep times 5.

I) Divide profit byshares minus 1000.

We cannot use an if/else statement. Has to be decimalformatting which is explained by …

Assume the variable total has the dollar amount stored in it andyou want to print that to the screen, you will need to have:

cout<<“The total amount is”<<fixed<<setprecision(2)<<total<<<total<<endl;

The combination of”fixed<<setprecision(2)” specifies that weare using 2 decimal places, if we wanted 3 decimal places we wouldchange the number to three and so on.

Expert Answer


Answer to Pdf File Contain Screen Shots Write Statements Corresponds Done Also Write Using Combined Q30716894 . . .

OR