• Forum
  • Lounge
  • can you help me guys?? there's still mor

 
can you help me guys?? there's still more errors


#include <iostream>
#include <cstdlib>
#include <string>
#include <cctype>
using namespace std;

int main()
{
string stop, flavor, chocolate, choc, vanilla, van, strawberry, str, mint, mt, rocky_road, rrd, mocha, mc;
int chocCount = 0, vanCount = 0, strCount = 0, mtCount = 0, rrdCount = 0, mochaCount = 0, flavorI, count = 0;

cout << "Welcome to Frozen Tongue Ice Cream Shop\n"<<endl;
cout << "Please enter the flavor of icecream sold or 'STOP' to exit.\n"<<endl;
cout << "Flavors avaliable:\n"<<endl;
cout << "chocolate\n"<<endl;
cout << "valnilla\n"<<endl;
cout << "strawberry\n"<<endl;
cout << "mint\n"<<endl;
cout << "rocky road\n"<<endl;
cout << "mocha\n"<<endl;
cout << "Enter flavor : ";
getline (cin, flavor) >> flavor;

flavor = "tolower (flavor)";

choc = chocolate;
van = vanilla;
str = strawberry;
mt = mint;
rrd = rocky_road;
mc = mocha;

cout <<"Now enter number of scoops sold\n"<<endl;
cin >> count;


flavorI = atoi("flavor");


if ( flavor != "STOP" || flavor != "stop")

switch (flavor)

{
case 'choc' :
chocCount + count;
break;
case 'van':
vanCount + count;
break;
case 'str':
strCount + count;
break;
case 'mt':
mtCount + count;
break;
case 'rrd':
rrdCount + count;
break;
case 'mc':
mochaCount + count;
break;
default:
cout<<"You have entered an unavaliable flavor. The program will now end."<<endl;
exit(1);
}
}

else
{


cout<<"You have chosen to exit the program. Thank you."<<endl;
exit(1);
}

cout << "\nDAILY SCOOP REPORT: \n"<<endl;
cout << "chocolate :"<<chocCount<<"\n"<<endl;
cout << "vanilla :"<<vanCount<<"\n"<<endl;
cout << "strawberry :"<<strCount<<"\n"<<endl;
cout << "mint :"<<mtCount<<"\n"<<endl;
cout << "rocky road :"<<rrdCount<<"\n"<<endl;
cout << "mocha :"<<mochaCount<<"\n"<<endl;

return 0;
}



There are so many compiler errors that say what is wrong..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
flavor = "tolower (flavor)"; //why are there double quotes?
//tolower takes a parameter of a character not a string.


//all these are missing quotes on the strings
choc = chocolate;
van = vanilla;
str = strawberry;
mt = mint;
rrd = rocky_road;
mc = mocha;

switch (flavor) //takes parameter of int/char not a string

case 'choc' :
//all of your cases are wrong. First of all it takes an int/char not a string
//secondly a character is different than a string(list) of characters

chocCount + count;
//this does nothing
//all of these should be ++variable; (increment by one) 


Anyways you didn't even ask a question can you please read this:
http://www.cplusplus.com/forum/beginner/1/

Then edit your post and use code tags
[code]//code here[/code]
and change it from lounge to beginners thread.

After this please ask a question with what you need help on.




Topic archived. No new replies allowed.