cclarinet123
14 years ago
I get two errors: "Unknown type name string" when I declare the class attribute "Brand" and in the declaration of the argument in the WriteOnPaper function prototype.
Also, I get a "expected ; after top level declarator" after the full declaration of the WriteOnPaper function.
#include
enum Color {blue, red, black, clear};
enum PenStyle {ballpoint, felt_tip, fountain_pen};
class Pen{
public:
Color inkColor;
Color shellColor;
Color capColor;
PenStyle style;
float length;
string Brand;
int inkLevelPercent;
void WriteOnPaper(string words);
void break_in_half();
void run_out_of_ink();
};
void WriteOnPaper(string words){
if(inkLevelPercent<=0){
cout<<"Oops! Out of ink"<
}
else{
cout<
}
}
void break_in_half(){
inkLevelPercent/=2;
length/=2;
}
void run_out_of_ink(){
inkLevelPercent=0;
}
any suggestions would be fantastic.
Thanks!