2009-10-16 15:48:53 UTC
#include
using namespace std ;
int main()
{
// Declare fruit, weight and cost as variables.
char fruit;
float cost;
cout << endl;
cout << "Enter type of fruit(apples, pears, pecans, or oranges): ";
cin >> fruit;
// Write C++ if-then-else statements to determine fruit cost,
if (char = "apples");
cost = 1.59;
else if (char = "oranges");
cost = 1.29 ;
else if (char = "pecans");
cost = 2.59 ;
else if (char = "pears");
cost = .99 ;
// display the result
cout << endl ;
cout << "Your cost is: " << cost << endl ;
system("pause");
return (0); // terminate with success
}