C++ programing assigment , please include flow chart of the program!! A flowchar
ID: 3800049 • Letter: C
Question
C++ programing assigment , please include flow chart of the program!!
A flowchart of your program. Your C++ program with a heading comment (with proper spacing and indentation). Copy of a screenshot after your program is executed./* ELEN 1301 Programming Assignment #6. Name: Your name. Student ID: Your student ID #. Due date: Due date Purpose of the program: Create a program with a decision. Section 1: Enter 2 digits number (Any two digits number, Ex. 10, 84, 99, etc.). Section 2: If the number is an odd number, add the left digit and right digit. Section 3: If the number is an even number, multiply the left with right digit. */Please include the expected values in your flowchart as a test data. You should hand-calculate or use a calculator to verify the output from your program. You must include two output screenshots. (1) An odd number as the input. (2) An even number as the input. The input number must be single 2 digits number. Output examples:Explanation / Answer
#include <iostream>
using namespace std;
int main() {
int num,left,right;
cout<<"Please enter two digit number : ";
cin>>num;
left = num / 10;
right = num % 10;
if (num % 2 == 0){
cout<<endl<<num<<" is an even number ";
cout<<left<<" * "<<right<<" = "<<left*right<<endl;
}
else{
cout<<num<<" is an odd number ";
cout<<left<<" + "<<right<<" = "<<left+right<<endl;
}
return 0;
}
=================================
output1
=================================
Please enter two digit number : 58
58 is an even number
5 * 8 = 40
====================================
output2
====================================
Please enter two digit number : 57
57 is an odd number
5 + 7 = 12
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.