In: Computer Science
#include <iostream>
#include <string>
using namespace std;
int main ()
{
char Apples = 1.90;
char Bananas = 1.00;
char Oranges = 1.50;
char choice;
int total;
int a;
int b;
int c;
cout << " What would you like to Purchase " <<
endl;
cout << " 1. [A]pples 1.90/lb " << endl;
cout << " 2. [B]ananas 1.00/lb " << endl;
cout << " 3. [O]ranges 1.50/lb " << endl;
cin>>choice;
if ( choice=='A')
{
cout << " you select apple and the price is $1.90/lb "
<< endl;
cin >> a;
total= Apples*a;
}
else if (choice =='B')
{
cout << " you select banana and the price is $1.00/lb "
<< endl;
cin>>b;
total = Bananas*b;
}
else if (choice == 'O')
{
cout << " you select orange and the price is $1.50/lb "
<< endl;
cin>>c;
total = Oranges*c;
}
cout << "Thank you for selecting fruit of your choice. "
<< endl;
}