Respuesta :
Following are the program and the flowchart description to the given question:
Program Explanation:
- Defining header file.
- Defining the Main method.
- Defining an string variable "str" and an integer variable "x".
- Using x variable that holds length of string.
- Using a conditional statement that checks x value greater than 8, when the condition is true it will print "It's a long word", otherwise it will print "It's a short word".
Program:
#include <iostream>//header file
#include <string>//header file
using namespace std;
int main() //main method
{
//defining variables
string str;//string
int x;//integer
cin>>str;//input string value
x=str.length();//using integer variable to hold length
if(x>8)//using conditional statement to check length is greater than 8
{
cout <<"It's a long word";//print string value
}
else
{
cout <<"It's a short word";//print string value
}
return 0;
}
Output:
Please find the attached file.
Learn more:
brainly.com/question/20131960

