Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the PDF file that will contain your screen shots, write the statements that corresponds to what is done and also write it using combined

In the PDF file that will contain your screen shots, write the statements that corresponds to what is done and also write it using combined assignment operators to perform the following (A and 'B' are shown as examples):

Statement:

Combined:

A) Add 6 to x.

x = x + 6

x += 6

B) Subtract 4 from amount.

amount = amount 4

amount -=4

C) Multiply y by 4.

D) Divide total by 27.

E) Store in x the remainder of x divided by 7.

F) Add y * 5 to x.

G) Subtract discount times 4 from total.

H) Multiply increase by salesRep times 5.

I) Divide profit by shares minus 1000.

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

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

cout<<"The total amount is "<setprecision(2)<endl;

The combination of "fixed<" specifies that we are using 2 decimal places, if we wanted 3 decimal places we would change the number to three and so on.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2018 Dublin Ireland September 10 14 2018 Proceedings Part 1 Lnai 11051

Authors: Michele Berlingerio ,Francesco Bonchi ,Thomas Gartner ,Neil Hurley ,Georgiana Ifrim

1st Edition

3030109240, 978-3030109240

More Books

Students also viewed these Databases questions