Write one single short C++ program that contains all of the following commands,s
ID: 3670540 • Letter: W
Question
Write one single short C++ program that contains all of the following commands,statements,operators...etc :
1- At least 1 (while or do while) loop.
2- At least 1 logical operators (&& or || or !).
3- At least 1 (char) variable
4 -At least 1 array.
5- At least 1 (string) variable.
B) explain in one or two lines what your program does (use // or */ ).
Please only using these libaries (#include <iostream> - using namespace std;)
Please do not use ( #include <iomanip> - using std::setw; - or others )
please cover everything
A grading program is a good idea
Explanation / Answer
This is a sample one, please look :
#include <iostream>
using namespace std;
int main ()
{
int c,i;
String s = "success";
chat stop='s';
char n[ 10 ];
cout <<"Enter chas; enter s to stop:"<<endl;
i=0;
while(true){
cin >>c;
n[i]= c;
if( c==stop && i>=10) {
break;
}
}
if(i>=10){
cout<<s<<endl;
}
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.