LogFAQs > #877043864

LurkerFAQs, Active DB, Database 1 ( 03.09.2017-09.16.2017 ), DB2, DB3, DB4, DB5, DB6, DB7, DB8, DB9, DB10, DB11, DB12, Clear
Topic List
Page List: 1
TopicAnyone here familiar with C++?
IllegalAlien
04/12/17 9:40:36 AM
#10:


I haven't programmed C++ in a while but here is the fixed code for glaringly wrong syntax:


void compareValues(Circle circle1, Circle circle2)
{
if (circle1.Radius > circle2.Radius)
cout << "Circle 1 has a larger radius.\n";
else
cout << "Circle 2 has a larger radius.\n";

if (circle1.Area > circle2.Area)
cout << "Circle 1 has a larger area.\n";
else
cout << "Circle 2 has a larger area.\n";

if (circle1.color == circle2.color)
cout << "Both circles are " << circle1.color;
else
cout << "The color of Circle 1 is " << circle1.Color << " and the color of Circle 2 is " << circle2.color;
}

---
"Never argue with an idiot, they drag you down to their level, then beat you with experience."
... Copied to Clipboard!
Topic List
Page List: 1