Write C++ statements that accomplish the following. (6, 7)a. Declare int variables x and y. Initialize x to 25 and y to 18.b. Declare and initialize an int variable temp to 10 and a char variable ch to 'A'.c. Update the value of an int variable x by adding 5 to it.d. Declare and initialize a double variable payRate to 12.50.e. Copy the value of an int variable firstNum into an int variable temp Num.f. Swap the contents of the int variables x and y. (Declare additional variables, if necessary.)g. Suppose x and y are double variables. Output the contents of x, y, and the expression x + 12 / y - 18.h. Declare a char variable grade and set the value of grade to 'A'.i. Declare int variables to store four integers.j. Copy the value of a double variable z to the nearest integer into an int variable x.
Write C++ statements that accomplish the following. (6, 7)
a. Declare int variables x and y. Initialize x to 25 and y to 18.
b. Declare and initialize an int variable temp to 10 and a char variable ch to 'A'.
c. Update the value of an int variable x by adding 5 to it.
d. Declare and initialize a double variable payRate to 12.50.
e. Copy the value of an int variable firstNum into an int variable temp Num.
f. Swap the contents of the int variables x and y. (Declare additional variables, if necessary.)
g. Suppose x and y are double variables. Output the contents of x, y, and the expression x + 12 / y - 18.
h. Declare a char variable grade and set the value of grade to 'A'.
i. Declare int variables to store four integers.
j. Copy the value of a double variable z to the nearest integer into an int variable x.
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 5 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)