Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can someone help me with these problems? the coding language is C++ 7-3 461 Fne

ID: 3678946 • Letter: C

Question


Can someone help me with these problems? the coding language is C++

7-3 461 Fne an carrect the iogic ars i te ollowing code segments a. thee following code should print wtetter ar case d ee end b. the taliosing code should prist the ade integers oe 19 down srough 1 c. the folsming code shoukd print tha even Intigers from 2 ehrough sor ec end cout ie coune cx endl whle (count 100); ) (5) Denine an input fie and attach t to the aternal fie "myosta zet include code to best that the fle opened correctly t. Also %) (3) Define and open an output le named "myOutaotbt"

Explanation / Answer

7. a.

switch(value % 2)

{

case 0: cout << "Even" << endl; break;

case 1: cout << "Odd" << endl; break;

}

b.

for(int i = 19; i >= 1; i -= 2)

cout << i << endl;

c.

int count = 2;

do

{

cout << count << endl;

count += 2;

} while(count <= 100);

8.

ifstream input;

input.open(''myData.txt");

if(input.is_open())

cout << "File successfully opened.";

ofstream output;

output.open("myDataOut.txt");

If you need any refinements, just get back to me.