I'm taking this intro class, and this is one of the last things we have to do, but I can't seem to figure it out, and it's due tomorrow. Can some one fix whatevers wrong with this? I thought it was fine, but apparently it "function does not take 0 arguments"
#include "stdafx.h"
#include "math.h"
#include <iostream>
#include <iomanip>
#include <cctype>
usingnamespace std;
int n, Twid, Rhei, Rwid;
int triangle(int &b, int &ch)
{
cout << "\nYou have selected a triangle.\nPlease choose your base width.\nValue must be >1 and <20";
cout << "Height:"; cin >> ch ;
cout << "Width:"; cin >> b;
if ( ch > 1 )
cout << ch << "and" << b;
return b;
}
int rectangle(int &c, char &dk)
{
cout << "\nYou have selected a rectangle.\nPlease enter your height and width.\nAlso enter +, -, or * for shape type.\nHeight:";
cin >> c ;
cout << "Width:"; cin >> dk;
if (islower(dk))
cout << static_cast<char>(toupper(dk)) << c;
return c;
} // this must match the header that starts your function definition below
int _tmain(int argc, _TCHAR* argv[])
{
do
{
cout << "Please choose a figure:\nRectangle = 1\nTriangle = 2\n";
cin >> n;
if ( n == 1 )
{ triangle(); }
elseif ( n == 2 ) {rectangle(); }
elseif ( n != 1 || n != 2 ) { cout << "Invalid selection, try again."; }
}
while ( n > 0 )
;
return 0;
}