code: the final version of lab03 var3

main
BaranovEK 11 месяцев назад
Родитель 29099c717e
Сommit bfb3f8cf9c

@ -32,7 +32,14 @@
<Add option="-Wall" /> <Add option="-Wall" />
<Add option="-fexceptions" /> <Add option="-fexceptions" />
</Compiler> </Compiler>
<Unit filename="histogram.cpp" />
<Unit filename="histogram.h" />
<Unit filename="histogram_internal.h" />
<Unit filename="main.cpp" /> <Unit filename="main.cpp" />
<Unit filename="svg.cpp" />
<Unit filename="svg.h" />
<Unit filename="text.cpp" />
<Unit filename="text.h" />
<Extensions /> <Extensions />
</Project> </Project>
</CodeBlocks_project_file> </CodeBlocks_project_file>

@ -7,7 +7,7 @@
1716797551 c:\users\lenov\desktop\lab03\histogram.h 1716797551 c:\users\lenov\desktop\lab03\histogram.h
<vector> <vector>
1716817439 source:c:\users\lenov\desktop\lab03\main.cpp 1717268069 source:c:\users\lenov\desktop\lab03\main.cpp
<iostream> <iostream>
<vector> <vector>
"histogram.h" "histogram.h"
@ -17,15 +17,15 @@
1716798974 c:\users\lenov\desktop\lab03\text.h 1716798974 c:\users\lenov\desktop\lab03\text.h
<vector> <vector>
1716799035 source:c:\users\lenov\desktop\lab03\text.cpp 1717261318 source:c:\users\lenov\desktop\lab03\text.cpp
<iostream> <iostream>
"text.h" "text.h"
<vector> <vector>
1716817390 c:\users\lenov\desktop\lab03\svg.h 1716819918 c:\users\lenov\desktop\lab03\svg.h
<vector> <vector>
1716817410 source:c:\users\lenov\desktop\lab03\svg.cpp 1716819750 source:c:\users\lenov\desktop\lab03\svg.cpp
<iostream> <iostream>
<vector> <vector>
<string> <string>

@ -24,7 +24,11 @@ input_data() {
cerr << "Enter bin count: "; cerr << "Enter bin count: ";
cin>> in.bin_count; cin>> in.bin_count;
cerr << "Enter column hight: "; cerr << "Enter column hight: ";
cin>> in.COLUMN_HIGHT; cin >> in.COLUMN_HIGHT;
while (in.COLUMN_HIGHT <=0 ){
cerr << "The height of the column can only be positive, try again: ";
cin >> in.COLUMN_HIGHT;
}
return in; return in;
} }

@ -31,6 +31,13 @@
<Compiler> <Compiler>
<Add option="-Wall" /> <Add option="-Wall" />
</Compiler> </Compiler>
<Unit filename="doctest.h" />
<Unit filename="histogram.cpp" />
<Unit filename="histogram.h" />
<Unit filename="svg.cpp" />
<Unit filename="svg.h" />
<Unit filename="unittest.cbp" />
<Unit filename="unittest.cpp" />
<Extensions> <Extensions>
<lib_finder disable_auto="1" /> <lib_finder disable_auto="1" />
</Extensions> </Extensions>

@ -37,10 +37,17 @@ TEST_CASE("same numbers") {
TEST_CASE("distinct positive numbers") { TEST_CASE("Image height < column height") {
double COLUMN_height = 400; double COLUMN_height = 220000;
COLUMN_hight_function(COLUMN_height ,5,{23,5,54,6,7});
CHECK(COLUMN_height == 140 );
}
TEST_CASE("Image height > column height ") {
double COLUMN_height = 100;
COLUMN_hight_function(COLUMN_height ,5,{23,5,54,6,7}); COLUMN_hight_function(COLUMN_height ,5,{23,5,54,6,7});
CHECK(COLUMN_height == 150 ); CHECK(COLUMN_height == 100 );
} }

@ -7,7 +7,7 @@
1716797551 c:\users\lenov\desktop\lab03\histogram.h 1716797551 c:\users\lenov\desktop\lab03\histogram.h
<vector> <vector>
1716819750 source:c:\users\lenov\desktop\lab03\unittest.cpp 1716828332 source:c:\users\lenov\desktop\lab03\unittest.cpp
"doctest.h" "doctest.h"
"histogram_internal.h" "histogram_internal.h"
"svg.h" "svg.h"

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Debug" />
</CodeBlocks_layout_file>
Загрузка…
Отмена
Сохранить