Help with c++ homework?

Hello all, I'm very new to c++, I've been trying to make these programs work but I keep getting error messages...I only have gotten one problem to work so far... I keep getting the same error codes. Here is the code: (for reference the code double length starts at line 9)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
using namespace std;

int main ()
{
    double length: 0.0;    
    double height: 0.0;
    double width: 0.0;
    double volume: 0.0;
    double amtConditioner: 0.0;
    
    cout << "Enter length:";
    cin >> length;
    cout << "Enter height:";
    cin >> height;
    cout << "Enter width:";
    cin >> width;
    
    volume=length*height*width;
    amtConditioner=volume/100.0;
    
    cout << "Amount of Conditioner to add in mL:" << amtConditioner <<endl;
    
    system("pause");
    return 0;
}


The error messages I keep getting are:

9 expected primary-expression before "double"
9 expected `;' before "double"
10 expected primary-expression before "double"
10 expected `;' before "double"
11 expected primary-expression before "double"
11 expected `;' before "double"
12 expected primary-expression before "double"
12 expected `;' before "double"
13 expected primary-expression before "double"
13 expected `;' before "double"
16 `length' undeclared (first use this function)
18 `height' undeclared (first use this function)
20 `width' undeclared (first use this function)
22 `volume' undeclared (first use this function)
23 `amtConditioner' undeclared (first use this function)


I'm really not sure what I'm doing wrong! I thought I declared all the variables correctly...please help, thank you!!
Try using = instead of : when declaring your variables
Ah!!! it works!!! Thank you thank you thank you!!!
Topic archived. No new replies allowed.