i cant figure out why this outputs the wrong number
when i say the length and width is 1 it outputs 2293544. and i dont know if its reading the 2 numbers i put in for length and width

i use the magic formula and still does it

case 'B':;
case 'b':;
cout << " You have choosen B. rectangle." ;
cout << " please enter the length and width of the rug.\n" << endl;
cin >> length, width;

cout << " The total cost will be " << areaR << endl;
            areaR= (length * width);
            cin >> areaR;
            cin >> areaR;

>cin >> length, width;
This doesn't do what you think. A comma is inapproriate, it should be another >> operator:

cin>> length >> width;

>cout << " The total cost will be " << areaR << endl;
>areaR= (length * width);
>cin >> areaR;
>cin >> areaR;

This is nonsensical. The ordering seems goofy. You print areaR before assigning it a suitable value, then fill it with user input twice in a row?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.