diff --git a/librerie/exercise5/zmytest/test.cpp b/librerie/exercise5/zmytest/test.cpp index 0eef580..50aabc8 100755 --- a/librerie/exercise5/zmytest/test.cpp +++ b/librerie/exercise5/zmytest/test.cpp @@ -113,13 +113,14 @@ void IntegerFunctions(T& mtx){ std::cout<<"Choose one of the following options:"< "; std::cin>>std::ws; std::cin>>choice; @@ -129,28 +130,31 @@ void IntegerFunctions(T& mtx){ PrintElements(mtx); break; case 2: - CheckExistence(mtx); + CheckExistenceOfElement(mtx); break; case 3: - ProductsElementsLessThan(mtx); + CheckExistenceOfCell(mtx); break; case 4: - Double(mtx); + ProductsElementsLessThan(mtx); break; case 5: - Insert(mtx); + Double(mtx); break; case 6: - Read(mtx); + Insert(mtx); break; case 7: - Resize(mtx); + Read(mtx); break; case 8: + Resize(mtx); + break; + case 9: menu(); break; } - }while(choice!=8 && choice!=9); + }while(choice!=9 && choice!=10); } template @@ -193,13 +197,14 @@ void FloatFunctions(T& mtx){ std::cout<<"Choose one of the following options:"< "; std::cin>>std::ws; std::cin>>choice; @@ -209,28 +214,31 @@ void FloatFunctions(T& mtx){ PrintElements(mtx); break; case 2: - CheckExistence(mtx); + CheckExistenceOfElement(mtx); break; case 3: - SumElementsGreaterThan(mtx); + CheckExistenceOfCell(mtx); break; case 4: - CubeElements(mtx); + SumElementsGreaterThan(mtx); break; case 5: - Insert(mtx); + CubeElements(mtx); break; case 6: - Read(mtx); + Insert(mtx); break; case 7: - Resize(mtx); + Read(mtx); break; case 8: + Resize(mtx); + break; + case 9: menu(); break; } - }while(choice!=8 && choice!=9); + }while(choice!=9 && choice!=10); } template @@ -273,13 +281,14 @@ void StringFunctions(T& mtx){ std::cout<<"Choose one of the following options:"< "; std::cin>>std::ws; std::cin>>choice; @@ -289,28 +298,31 @@ void StringFunctions(T& mtx){ PrintElements(mtx); break; case 2: - CheckExistence(mtx); + CheckExistenceOfElement(mtx); break; case 3: - ConcatLessThan(mtx); + CheckExistenceOfCell(mtx); break; case 4: - HeadConcat(mtx); + ConcatLessThan(mtx); break; case 5: - Insert(mtx); + HeadConcat(mtx); break; case 6: - Read(mtx); + Insert(mtx); break; case 7: - Resize(mtx); + Read(mtx); break; case 8: + Resize(mtx); + break; + case 9: menu(); break; } - }while(choice!=8 && choice!=9); + }while(choice!=9 && choice!=10); } template @@ -351,6 +363,18 @@ void HeadConcatMapAux(string& data, void* par){ /* ----- shared functions ----- */ +template +void CheckExistenceOfCell(T& mtx){ + ulong row,column; + cout<<"\n\n Check existence in the matrix of the cell with coordinates: \n"; + cout<<" Row: "; + cin>>row; + cout<<" Column: "; + cin>>column; + + cout<<" The cell " << ( (mtx.ExistsCell(row,column))? "does" : "does not") << " exist\n\n"; +} + template void Resize(T& mtx){ ulong rows, columns; @@ -401,7 +425,7 @@ void Insert(T& mtx){ } template