RedDucati748
MIS
I’m working on a comparison program to take a look at three numbers that are pre-identified in the program. The user will have the ability to select the largest or smallest number by using the (S for Small, B for Biggest). The output to the user will be the smallest or biggest depending on their request. Have the following code below, but can’t get the thing to run.
Thanks-
#include <iostream.h>
void int biggest (char & task_to_do)
{
cout<<"Enter the number you would like to see: B
for Biggest, S for Smallest";
cin>>task_to_do;
while (Task_to_do != 'B' && Task_to_do != 'S')
{
cout<<"Incorrect Input, must be B or S, re-enter: ";
cin>>task_to_do;
}
}
double biggest
{
double n1, n2, n3;
n1 = 14;
n2 = 26;
n3 = 5;
x = n1;
while (x <= n3)
{
if n1>n2>n3
{
return n1;
}
else if n2>n1>n3
{
return n2;
}
else n3>n1>n2
{
return n3;
}
cout<<endl;
}
count<<endl;
}
double smallest
{
double n1, n2, n3;
n1 = 14;
n2 = 26;
n3 = 5;
x = n1;
while (x <= n3)
{
if n1<n2<n3
{
return n1;
}
else if n2<n1<n3
{
return n2;
}
else n3<n1<n2
{
return n3;
}
cout<<endl;
}
count<<endl;
}
void main()
{
int biggest
char task_to_do;
more = 'Y';
while (more == 'Y')
{
int biggest ( task_to_do);
if (task_to_do == 'B')
{
cout<<"The biggest number in the comparison is:
"<<number<<endl<<endl;
}
else
{
cout<<"The smallest number in the comparison is:
"<<number<<endl<<endl;
}
cout<<"Do another comparison? (Y/N): ";
cin>>more;
}
cout<<endl<<endl<<"******End
Program******"<<endl<<endl;
}
Thanks-
#include <iostream.h>
void int biggest (char & task_to_do)
{
cout<<"Enter the number you would like to see: B
for Biggest, S for Smallest";
cin>>task_to_do;
while (Task_to_do != 'B' && Task_to_do != 'S')
{
cout<<"Incorrect Input, must be B or S, re-enter: ";
cin>>task_to_do;
}
}
double biggest
{
double n1, n2, n3;
n1 = 14;
n2 = 26;
n3 = 5;
x = n1;
while (x <= n3)
{
if n1>n2>n3
{
return n1;
}
else if n2>n1>n3
{
return n2;
}
else n3>n1>n2
{
return n3;
}
cout<<endl;
}
count<<endl;
}
double smallest
{
double n1, n2, n3;
n1 = 14;
n2 = 26;
n3 = 5;
x = n1;
while (x <= n3)
{
if n1<n2<n3
{
return n1;
}
else if n2<n1<n3
{
return n2;
}
else n3<n1<n2
{
return n3;
}
cout<<endl;
}
count<<endl;
}
void main()
{
int biggest
char task_to_do;
more = 'Y';
while (more == 'Y')
{
int biggest ( task_to_do);
if (task_to_do == 'B')
{
cout<<"The biggest number in the comparison is:
"<<number<<endl<<endl;
}
else
{
cout<<"The smallest number in the comparison is:
"<<number<<endl<<endl;
}
cout<<"Do another comparison? (Y/N): ";
cin>>more;
}
cout<<endl<<endl<<"******End
Program******"<<endl<<endl;
}