I am almost done with the code i just need to figure out how to make the user input values for character and the height of the triangle using cout and cin thanks this is all my code hard coded.
I feel like i worded it wrong basically the program is supposed to draw a triangle using the function drawline i created below, when i compile and run it asks me to enter a user choice if i enter 1 it runs the code in the if (userChoice == 1){} basically i want a cin and cout code structure that allows them to input their values for lineLength and displayChar.
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
void drawLine (int lineLength, char displayChar);
void placePoint (int lineLength) ;
int main()
{
int userChoice = 0;
cout << "**********************************" << endl;
cout << "* 1 - DrawTriangle *" << endl;
cout << "* 2 - Plot Sine graph *" << endl;
cout << "* 3 - Exit *" << endl;
cout << "Enter a selection, please: " << endl;
cin >> userChoice;
int x,y,t =0;
char displayChar = ' ';
int lineLength = 0;
double sinVal= 0.00;
double rad = 0.00;
int plotPoint = 0;
if (userChoice == 1)
for (int x=1; x <= lineLength; x=x+1) {
drawLine ( x, displayChar);
}//end for
for (int y=lineLength-1; y >= 1; y=y-1) {
drawLine ( y, displayChar );
}//end for
}//end main at this point.
void drawLine (int lineLength, char displayChar)
{
for (int x=1; x <= lineLength; x=x+1) {
cout << displayChar;
}
cout << endl;
for (int y=y-1; y >= 1; y=y-1) {
cout << displayChar;
}
cout << endl;
} //end drawline