Record Detail

Compile Error

In file included from /in/ex3.cpp:4:
/in/Car.h:10:70: error: implicit conversion loses floating-point precision: 'double' to 'const float' [-Werror,-Wconversion]
        Rectangle body{{{0,0.03},{0.1, 0.03}, {0.1, 0}, {0, 0}}, {1, 0.95, 0.3}};
                                                                 ~   ^~~~
/in/Car.h:10:76: error: implicit conversion loses floating-point precision: 'double' to 'const float' [-Werror,-Wconversion]
        Rectangle body{{{0,0.03},{0.1, 0.03}, {0.1, 0}, {0, 0}}, {1, 0.95, 0.3}};
                                                                 ~         ^~~
/in/Car.h:11:41: error: implicit conversion loses floating-point precision: 'double' to 'const float' [-Werror,-Wconversion]
        Circle leftWheel{{0.03, 0}, {1, 0.32, 0.286}, 0.01};
                                    ~   ^~~~
/in/Car.h:11:47: error: implicit conversion loses floating-point precision: 'double' to 'const float' [-Werror,-Wconversion]
        Circle leftWheel{{0.03, 0}, {1, 0.32, 0.286}, 0.01};
                                    ~         ^~~~~
/in/Car.h:12:42: error: implicit conversion loses floating-point precision: 'double' to 'const float' [-Werror,-Wconversion]
        Circle rightWheel{{0.07, 0}, {1, 0.32, 0.286}, 0.01};
                                     ~   ^~~~
/in/Car.h:12:48: error: implicit conversion loses floating-point precision: 'double' to 'const float' [-Werror,-Wconversion]
        Circle rightWheel{{0.07, 0}, {1, 0.32, 0.286}, 0.01};
                                     ~         ^~~~~
/in/Car.h:13:84: error: implicit conversion loses floating-point precision: 'double' to 'const float' [-Werror,-Wconversion]
        Trapezium upperBody{{{0.01, 0.06},{0.08, 0.06}, {0.09, 0.03}, {0, 0.03}}, {0.79, 0.76, 0.89}};
                                                                                  ~^~~~
/in/Car.h:13:90: error: implicit conversion loses floating-point precision: 'double' to 'const float' [-Werror,-Wconversion]
        Trapezium upperBody{{{0.01, 0.06},{0.08, 0.06}, {0.09, 0.03}, {0, 0.03}}, {0.79, 0.76, 0.89}};
                                                                                  ~      ^~~~
/in/Car.h:13:96: error: implicit conversion loses floating-point precision: 'double' to 'const float' [-Werror,-Wconversion]
        Trapezium upperBody{{{0.01, 0.06},{0.08, 0.06}, {0.09, 0.03}, {0, 0.03}}, {0.79, 0.76, 0.89}};
                                                                                  ~            ^~~~
9 errors generated.

Information

Submit By
Type
Submission
Homework
Homework 8
Language
C++ (Clang++, with memory check)
Submit At
2022-12-09 18:51:30
Judged At
2022-12-09 18:51:30
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes