Hello, I am trying to use code that will multiply a quantity from 1 through 5 by a price (that is currently set to one to test) to give me a total so the way it is now it should just give me the quantity I selected from the drop down box. I tried using else if statements and if statements. If I use the else if statement it will always give me a one and if I use if statements it will always give me a five. I think it's something simple but can't figure out how to make it work. I did a similar program in perl and had no problem but with this one in C++ I just can't get it to work. If anyone can help me it would be greatly appreciated because this is really driving me crazy at this point.
The site this is on is:
http://157.62.23.204/~smithc0/New%20folder/newcpp.cgiAnd the Code is:
CODE
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
float Total =0.00;
float Price =1.00;
char Flower;
int Quanity =0;
if ("quanity = 1")
Quanity = 1;
else if ("quanity = 2")
Quanity = 2;
else if ("quanity = 3")
Quanity = 3;
else if ("quanity = 4")
Quanity = 4;
else if ("quanity = 5")
Quanity = 5;
Total = Quanity * Price;
cout << "Content-type: text/html\n\n";
cout << "<html>"
<< "<head>"
<< "<title>Total</title>"
<< "<body>"
<< "<br /><table cols=5 border=1>"
<< "<tr>"
<< "<th>Delete</th>"
<< "<th>Flower</th>"
<< "<th>Price</th>"
<< "<th>Quanity</th>"
<< "<th>Total</th>"
<< "</tr>"
<< "<tr>"
<< "<td><div align=center><input type=checkbox></td>"
<< "<td><div align=left>"
<< "</td>"
<< "<td><div align=center>"
<< Price
<< "<td><div align=center>"
<< "<select name=quanity>"
<< "<option value=1>1"
<< "<option value=2>2"
<< "<option value=3>3"
<< "<option value=4>4"
<< "<option value=5>5"
<< "</select></td>"
<< "</div>"
<< "<td><div align=center>"
<< Total
<< "</td>"
<< "</tr>"
<< "</body>"
<< "</html>";
}