Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C++ by fsdsdfsdf ( 12 years ago )
#include<iostream>
using namespace std;
int main()
{
int Quantity[10];
float Price[10];
float total[10];
cout << "Enter the Number of Quantity" << endl;
for (int a = 0; a < 10; a++)
{
cin >> Quantity[a];
}
cout << "Enter The Price" << endl;
for (int b = 0; b < 10; b++)
{
cin >> Price[b];
}
cout << "The Total : " << endl;
if (Quantity[0]>=10)
{
cout << (Quantity[0] * Price[0])*0.10 << endl;
}
else
{
cout << (Quantity[0] * Price[0])*0.05 << endl;
}
if (Quantity[1]>=10)
{
cout << (Quantity[1] * Price[1])*0.10 << endl;
}
else
{
cout << (Quantity[1] * Price[1])*0.05 << endl;
}
if (Quantity[2]>=10)
{
cout << (Quantity[2] * Price[2])*0.10 << endl;
}
else
{
cout << (Quantity[2] * Price[2])*0.05 << endl;
}
if (Quantity[3]>=10)
{
cout << (Quantity[3] * Price[3])*0.10 << endl;
}
else
{
cout << (Quantity[3] * Price[3])*0.05 << endl;
}
if (Quantity[4]>=10)
{
cout << (Quantity[4] * Price[4])*0.10 << endl;
}
else
{
cout << (Quantity[4] * Price[4])*0.05 << endl;
}
if (Quantity[5]>=10)
{
cout << (Quantity[5] * Price[5])*0.10 << endl;
}
else
{
cout << (Quantity[5] * Price[5])*0.05 << endl;
}
if (Quantity[6]>=10)
{
cout << (Quantity[6] * Price[6])*0.10 << endl;
}
else
{
cout << (Quantity[6] * Price[6])*0.05 << endl;
}
if (Quantity[7]>=10)
{
cout << (Quantity[7] * Price[7])*0.10 << endl;
}
else
{
cout << (Quantity[7] * Price[7])*0.05 << endl;
}
if (Quantity[8]>=10)
{
cout << (Quantity[8] * Price[8])*0.10 << endl;
}
else
{
cout << (Quantity[8] * Price[8])*0.05 << endl;
}
if (Quantity[9]>=10)
{
cout << (Quantity[9] * Price[9])*0.10 << endl;
}
else
{
cout << (Quantity[9] * Price[9])*0.05 << endl;
}
system("pause");
return 0;
}
Revise this Paste