//main file
#include<iostream>
#include<fstream>
#include<iomanip>
#include"mid_term.h"
using namespace std;
void main()
{
//define variables
char aa;
char type;
char color;
char response;
float size;
float price;
char imported;
Mid_Term mt;
//cl /EHsc midtermDriver.cpp
//print title
cout<<"Rebecca Zbyradowski\nCIS326\nMidterm\n\n";
cout<<"Default Object\n\n"<<endl;
cout<<"Type: Cheerleading\nColor: White\nPrice: $39.99\nSize: 9\nThis shoe is imported"<<endl;
cout<<"-----------------------------------------"<<endl;
//set up loop so program can end
do{
cout<<"To Design your own footwear please enter values\n"<<endl;
cout<<"Please select type:\n\n";
//Print Type
cout<<"F:Flipflops\nS:Sandals\nD:Dress\nB:Boots\nT:Tennis\nH:Hiking\nK:Basketball\nC:Casual\nL:Cheadleader\nO:Football\n";
cin>>type;
mt.settype(type);
cout<<"\nPlease select Color:\n\n";
cout<<"W:White\nB:Black\nY:Yellow\nN:Brown\nR:Red\nG:Gray\nP:Purple\nS:Silver\n";
cin>>color;
mt.setcolor(color);
cout<<"\n\nWhat is the size?\n";
cin>>size;
cout<<"\n\nWhat is the price?\n";
cin>>price;
cout<<"Is this footwear imported?\n";
cin>>imported;
cout<<"*** Your footwear specifics***\n\n";
//char type1;
//type1=shoe.gettype();
switch (type)
{
case 'F':
case 'f':
cout<<"Type: Flipflop\n";
break;
case 'S':
case 's':
cout<<"Type: Sandals\n";
break;
case 'D':
case 'd':
cout<<"Type: Dress\n";
break;
case 'B':
case 'b':
cout<<"Type: Boots\n";
break;
case 'T':
case 't':
cout<<"Type: Tennis\n";
break;
case 'H':
case 'h':
cout<<"Type: Hiking\n";
break;
case 'K':
case 'k':
cout<<"Type: Basketball\n";
break;
case 'C':
case 'c':
cout<<"Type: Casual\n";
break;
case 'L':
case 'l':
cout<<"Type: Cheerleader\n";
break;
case 'O':
case 'o':
cout<<"Type: Football\n";
break;
default:
cout<< endl << endl;
cout<< "TYPE: Invalid Choice entered." << endl;
break;
}//end switch
//char color1;
//color1=shoe.getcolor();
switch (color)
{
case 'W':
case 'w':
cout<<"Color: White\n";
break;
case 'B':
case 'b':
cout<<"Color: Black\n";
break;
case 'Y':
case 'y':
cout<<"Color: Yellow\n";
break;
case 'N':
case 'n':
cout<<"Color: Brown\n";
break;
case 'R':
case 'r':
cout<<"Color: Red\n";
break;
case 'G':
case 'g':
cout<<"Color: Gray\n";
break;
case 'P':
case 'p':
cout<<"Color: Purple\n";
break;
case 'S':
case 's':
cout<<"Color: Silver\n";
break;
default:
cout<< endl << endl;
cout<<"COLOR: Invalid choice!"<< endl;
}
cout<<"Price: $"<<price<<endl;
cout<<"Size: "<<size<<endl;
if (imported == 'y')
{
cout<<"The shoe is imported.\n"<<endl;
}
else
{
cout<<"The shoe is made locally.\n"<<endl;
}
cout<<"Do you want to try again? (y/n)\n";
cin>>response;
}while (response != 'n');//end of do while loop
}//end main
I am getting an error when i trry to run it and i cant understand why..HELP
I have screen shot of error...
Last edited by bcky22309; May 13th, 2009 at 06:17 PM.
You are getting linker errors because something in the main function is trying to access something else that wasn't compiled. Did you compile the file containing the mid_term class definition? Aside from the code tags, it would be even easier if you would use the autoformat feature of your code editor to eliminate the unnecessary spacing and bracket alignment issues. Then copy and paste them and apply code tags.
You are getting linker errors because something in the main function is trying to access something else that wasn't compiled. Did you compile the file containing the mid_term class definition? Aside from the code tags, it would be even easier if you would use the autoformat feature of your code editor to eliminate the unnecessary spacing and bracket alignment issues. Then copy and paste them and apply code tags.
The image you posted indicates very clearly that the compiler has no idea what a Mid_Term class is since the constructor and all of its member functions are unresolved at link time. Are all of the files being compiled within the project? Is mid_term.cpp being compiled? Copy and paste the entire compiler output into a post. The picture is difficult to read. I don't see where it is showing the output of the compiler. I'm only seeing linker output.
The image you posted indicates very clearly that the compiler has no idea what a Mid_Term class is since the constructor and all of its member functions are unresolved at link time. Are all of the files being compiled within the project? Is mid_term.cpp being compiled? Copy and paste the entire compiler output into a post. The picture is difficult to read. I don't see where it is showing the output of the compiler. I'm only seeing linker output.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.