Hello All ,This is me again :icon_mrgreen:
I'm Making a programme which tell the user to input the name
of the product he wants to show its Price and Amount ,but i have a problem:
Here's The Code
#include <iostream>
#include <conio.h>
using namespace std;
struct Shop
{
int Price;
int Amount;
};
void PrintPrice (Shop Product);
void PrintAmount (Shop Product);
int main()
{
//For Input:
Shop FI;
//Products:
Shop Apple;
Shop Banana;
Shop Orange;
//Prices:
Apple.Price = 3;
Banana.Price = 5;
Orange.Price = 7;
//Amounts:
Apple.Amount = 5;
Banana.Amount = 10;
Orange.Amount = 15;
//Programme:
cout << "Enter The Product's Name: ";
cin >> FI;
PrintPrice(FI);
PrintAmount(FI);
//End Of Programme:
getch();
return 0;
}
void PrintPrice (Shop Product)
{
cout << "The Price Is: " << Product.Price <<endl;
}
void PrintAmount (Shop Product)
{
cout << "The Amount Is: " << Product.Amount;
}
I Know This Is Wrong:
cin >> FI;
so what can it be replaced by?
Hope you got it...