Part I – Write individual for( ) statements for the following cases: 1. Use a counter named p that has an initial value of 3, a final value of 18, and an increment of 1. 2. Use a counter named count...

1 answer below »
attached is a copy of the assignment


Part I – Write individual for( ) statements for the following cases: 1. Use a counter named p that has an initial value of 3, a final value of 18, and an increment of 1. 2. Use a counter named count that has an initial value of 1, a final value of 20, and an increment of 5. 3. Use a counter named j that has an initial value of 30, a final value of 10, and a decrement of 5. 4. Use a counter named price that has an initial value of 5, a final value of 15, and an increment of .5. 5. Use a counter named jcount that has an initial value of 20, a final value of 1, and a decrement of 2. PART II - What will be the output of the following segment of the program? 1. Output for( p=2; p<=10; p="" +="2)">< “p="" is="" now:="" ”="">< p="">< endl;="" 2.="" int="" total="50;" output="" for="" (="" i="1;" i=""><= 10;="" i="" +="2)" cout="">< i="">< endl;="" 3.="" int="" total="0;" output=""><10) {="" cout=""><” hello”="">< endl; total++; } 4. write a program that used a repetition structure to display all even numbers between 0 and 200. endl;="" total++;="" }="" 4.="" write="" a="" program="" that="" used="" a="" repetition="" structure="" to="" display="" all="" even="" numbers="" between="" 0="" and="">
Answered Same DayMar 11, 2021

Answer To: Part I – Write individual for( ) statements for the following cases: 1. Use a counter named p that...

Mohd answered on Mar 12 2021
138 Votes
Part I – Write individual for( ) statements for the following cases:
1. Use a counter named p that
has an initial value of 3, a final value of 18, and an increment of 1.
int p = 3;
for(p; p<18; p++);
cout<<“p: ”<2. Use a counter named count that has an initial value of 1, a final value of 20, and an increment of 5.
int count = 1;
for(count; count<20; count = count+5)
if(count == 1)
        count=0;    
cout<< “count: ” <3. Use a counter named j that has an initial value of 30, a final value of 10, and a decrement of 5.
int j =30;
    for(j; j>10; j = j-5);
cout<< “j: ” <4. Use a counter named price that has an initial value of 5, a final value of 15, and an increment of .5.
double price =5;
    for(price; price<15;...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here