diff --git a/LAKSHYA_STANDARD_ALGORITHM_OF_TEST_CASES.h b/LAKSHYA_STANDARD_ALGORITHM_OF_TEST_CASES.h new file mode 100644 index 0000000..2c2b7ea --- /dev/null +++ b/LAKSHYA_STANDARD_ALGORITHM_OF_TEST_CASES.h @@ -0,0 +1,719 @@ +#ifndef LAKSHYA_STANDARD_ALGORITHM_OF_TEST_CASES_H_INCLUDED +#define LAKSHYA_STANDARD_ALGORITHM_OF_TEST_CASES_H_INCLUDED +#include +#include +using namespace std; +typedef long long ll; +namespace lakshya_standard_algorithm_of_test_cases +{ + class Integer + { + public: + // type-> within class use functions + ll generate_number() + { + short countt=0; + ll a=rand(); ll b=rand(); ll c=rand(); ll d=rand(); + ll store=0; + while(a!=0) { store=10; store+=(a%10); a/=10; countt++; } + while(b!=0) { store*=10; store+=(b%10); b/=10; countt++; } + while(c!=0) { store*=10; store+=(c%10); c/=10; countt++; } + while(d!=0) { if(countt==18) break; store*=10; store+=(d%10); d/=10; countt++;} + return store; + } + + + void randomized_vector(vector &v1) + { + for(int i1=v1.size()-1;i1>0;i1--) + { + swap(v1[i1],v1[(rand()*rand())%i1]); + } + } + + + bool is_prime(ll num) + { + if(num==1) return false; + for(ll i=2;i<=sqrt(num);i++) { if(num%i==0) {return false;} } + return true; + } + + // type-> used by user data_type object + ll get_random(ll lower_limit,ll upper_limit) + { + ll difference=abs(upper_limit-lower_limit+1); + ll number=generate_number()%difference; + number+=lower_limit; + return number; + } + + + ll get_odd(ll lower_limit,ll upper_limit) + { + if(upper_limit%2==0) { upper_limit--; } + if(lower_limit%2==0) { lower_limit++; } + ll difference=abs(upper_limit-lower_limit+1); + ll number=generate_number()%difference; + number+=lower_limit; + if(number%2==0) number++; + return number; + } + + + ll get_even(ll lower_limit,ll upper_limit) + { + if(upper_limit&1==1) { upper_limit--; } + if(lower_limit&1==1) { lower_limit++; } + ll difference=abs(upper_limit-lower_limit+1); + ll number=generate_number()%difference; + number+=lower_limit; + if(number&1==1) number++; + return number; + } + + + vector get_prime(ll lower_limit,ll upper_limit,ll sizee) + { + vector check(upper_limit+1,false); + vector prime; + if(lower_limit==2) prime.push_back(2); + for(int i=3;iprime.size()) { while(prime.size()!=sizee) { prime.push_back(prime[rand()%prime.size()]); } } + randomized_vector(prime); return prime; + } + + + ll get_non_prime(ll lower_limit,ll upper_limit) + { + bool check=true; + ll difference=abs(upper_limit-lower_limit+1); + ll number; + while(check!=false) + { + number=generate_number()%difference; + number+=lower_limit; + check=is_prime(number); + } + return number; + } + + + vector get_fibonacci(ll lower_limit,ll upper_limit,ll sizee) + { + vector fibo; fibo.push_back(0); fibo.push_back(1); + for(int i=2;i<=92;i++) { fibo.push_back(fibo[i-2]+fibo[i-1]); } + vector fibonacci; + for(int i=lower_limit-1;ifibonacci.size()) { while(fibonacci.size()!=sizee) { fibonacci.push_back(fibonacci[rand()%fibonacci.size()]); } } + randomized_vector(fibonacci); return fibonacci; + } + + + vector get_all_random_numbers(ll low,ll up,int sizee) + { + std::cout<< std::fixed; std::cout<< std::setprecision(14); vector v1; + ll diff=up-low+1; + float f1=((diff*1.0)/(sizee*1.0)); + float start=low*1.0; + ll d1=low; ll d2=up; + for(int i=0;i> initializer_details; + vector initializer_store; + public: + void store_initializer_details(int minimum,int maximum) { initializer_details.push_back(make_pair(minimum,maximum)); } + void set_initializer() + { + for(short i=0;i within class use functions + ll generate_number() + { + short countt=0; + ll a=rand(); ll b=rand(); ll c=rand(); ll d=rand(); + ll store=0; + while(a!=0) { store=10; store+=(a%10); a/=10; countt++; } + while(b!=0) { store*=10; store+=(b%10); b/=10; countt++; } + while(c!=0) { store*=10; store+=(c%10); c/=10; countt++; } + while(d!=0) { if(countt==18) break; store*=10; store+=(d%10); d/=10; countt++;} + return store; + } + + string integer_to_string(ll &num) + { + ll copy_num=abs(num); + string s1; + while(copy_num!=0) { short a=copy_num%10; copy_num/=10; s1+=a+48; } + reverse(s1.begin(),s1.end()); + if(num<0) { s1="-"+s1; } return s1; + } + + string generate_numeric_random_string(short sizee) + { + string symbols="1234056789"; string s1=""; + while(sizee--) { ll index=rand()%10; s1+=symbols[index]; } + return s1; + } + + // type-> used by user data_type object + string get_random_real(ll lower_limit,ll upper_limit,short precision) + { + ll difference=abs(upper_limit-lower_limit); + ll number=generate_number()%difference; + number+=lower_limit; + string s1=integer_to_string(number); + if(precision==0) return s1; + s1+="."; string s2=generate_numeric_random_string(precision); s1+=s2; return s1; + } + }; + + + class Permutation + { + private: + short index_of_string=-1; + vector store_string; + public: + short store_string_for_permutation(string &str) + { + store_string.push_back(str);return (++index_of_string); + } + + vector generate_permutations(short index,int sizee) + { + string str=store_string[index]; + vector store_permutations; + sort(str.begin(),str.end()); + do + { + if(store_permutations.size()==sizee) break; + store_permutations.push_back(str); + } + while (next_permutation(str.begin(), str.end())); + return store_permutations; + } + }; + + + class S_string:public Initializer + { + private: + short pointer_of_default_string=-1; + short pointer_of_input_string=-1; + + vector default_string_set; + vector > input_string_set; + public: + // type-> within class use functions + short store_default_string(string str) + { + default_string_set.push_back(str); return (++pointer_of_default_string); + } + + short store_input_string(string str,short type,short mode,int sizee) + { + input_string_set.push_back(make_tuple(str,type,mode,sizee)); return (++pointer_of_input_string); + } + + + void randomized_string(string &str) + { + for(int index=str.size();index>1;index--) { swap(str[index-1],str[rand()%index]); } + } + + string generate_repetition_allowed_string(string &str,int &sizee) + { + string a; while(a.size()!=sizee) {a+=str[rand()%str.size()]; } return a; + } + + string generate_unique_symbol_string(string &str,int &sizee) + { + randomized_string(str); string s2;int index=-1; + while(s2.size()!=sizee) { s2+=str[++index]; } return s2; + } + + string generate_repetition_allowed_palindrome_string(string &str,int &sizee) + { + string s1; while(s1.size()!=(sizee/2)) { s1+=str[rand()%str.size()]; } string s2=s1; + if(sizee&1==1) { s2+=str[rand()%str.size()]; reverse(s1.begin(),s1.end()); s2+=s1; } //odd case + else { reverse(s1.begin(),s1.end()); s2+=s1; } // even case + return s2; + } + + string generate_unique_symbol_palindrome_string(string &str,int &sizee) + { + randomized_string(str); int index=-1; string s1; + while(s1.size()!=(sizee/2)) { s1+=str[++index]; } string s2=s1; + if(sizee&1==1) { s2+=str[++index]; reverse(s1.begin(),s1.end()); s2+=s1; } // odd case + else { reverse(s1.begin(),s1.end()); s2+=s1; } // even case + return s2; + } + + // type-> used by user data_type object + string get_default_string(short index) + { + return default_string_set[index]; + } + + + string get_input_string(short index) + { + string str=get<0>(input_string_set[index]); + short type=get<1>(input_string_set[index]); + short mode=get<2>(input_string_set[index]); + int sizee=get<3>(input_string_set[index]); + if(sizee<0) { sizee=get_initializer(sizee); } + string to_be_return; + if(type==4) //palindrome case + { + if(mode==1) { to_be_return=generate_repetition_allowed_palindrome_string(str,sizee); return to_be_return; } + else { to_be_return=generate_unique_symbol_palindrome_string(str,sizee); return to_be_return; } + } + else // all other cases + { + if(mode==1) { to_be_return=generate_repetition_allowed_string(str,sizee); } + else { to_be_return=generate_unique_symbol_string(str,sizee); } + if(type==2) { sort(to_be_return.begin(),to_be_return.end()); } + else if(type==3) { sort(to_be_return.begin(),to_be_return.end()); reverse(to_be_return.begin(),to_be_return.end()); } + return to_be_return; + } + } + }; + + + class Array:public S_string,public Real,public Permutation + { + public: + // type-> within class use + void randomized_string_vector(vector &v1) + { + for(int i1=v1.size()-1;i1>0;i1--) { swap(v1[i1],v1[(rand()*rand())%i1]); } + } + // type-> used by object + vector get_integer(short mode,ll min_value,ll max_value,ll sizee,short order) + { + vector store_integer; + if(sizee<0) { sizee=get_initializer(sizee); } + switch(mode) + { + case 1: + { + for(int i=0;istore_integer.size()) { while(store_integer.size()!=sizee) { store_integer.push_back(store_integer[rand()%store_integer.size()]); } } break; + } + case 5: + { + for(int i=0;istore_integer.size()) { while(store_integer.size()!=sizee) { store_integer.push_back(store_integer[rand()%store_integer.size()]); } } break; + } + } + if(order==1) { randomized_vector(store_integer); } + if(order==2) { sort(store_integer.begin(),store_integer.end()); } + if(order==3) { sort(store_integer.rbegin(),store_integer.rend()); } + return store_integer; + } + + + vector get_real(short set_precision,ll min_value,ll max_value,ll sizee,short order) + { + if(sizee<0) { sizee=get_initializer(sizee); } + vector store_real; + for(int i=0;i get_input_string_array(short index,int sizee,short order) + { + vector store_string; + if(sizee<0) { sizee=get_initializer(sizee); } + for(int i=0;i get_all_permutations(short index, int sizee,short order) + { + if(sizee<0) { sizee=get_initializer(sizee); } + vector all_permutations= generate_permutations(index,sizee); + if(order==1) { randomized_string_vector(all_permutations); } + if(order==2) { sort(all_permutations.begin(),all_permutations.end()); } + if(order==3) { sort(all_permutations.rbegin(),all_permutations.rend()); } + return all_permutations; + } + + + vector get_all_random_numbers_for_array(ll c_low,ll c_up,int c_sizee,short order) + { + if(c_sizee<0) { c_sizee=get_initializer(c_sizee); } + vector v1=get_all_random_numbers(c_low,c_up,c_sizee); + if(order==2) { sort(v1.begin(),v1.end()); } + if(order==3) { sort(v1.rbegin(),v1.rend()); } + return v1; + } + }; + + + class Matrix:public Array + { + public: + void sort_string_row_wise_assending(vector > &v1) + { + for(int i=0;i> &v1) + { + int row=v1.size(); int col=v1[0].size(); + for(int i=0;i v2; + for(int j=0;j> &v1) + { + for(int i=0;i> &v1) + { + int row=v1.size(); int col=v1[0].size(); + for(int i=0;i v2; + for(int j=0;j> &v1) + { + for(int i=0;i> &v1) + { + int row=v1.size(); int col=v1[0].size(); + for(int i=0;i v2; + for(int j=0;j> &v1) + { + for(int i=0;i> &v1) + { + int row=v1.size(); int col=v1[0].size(); + for(int i=0;i v2; + for(int j=0;j> get_integer_matrix(short mode,ll min_value,ll max_value,int row,int col,short order1,short order2) + { + int index=-1; + if(row<0) { row=get_initializer(row); } if(col<0) { col=get_initializer(col); } + ll sizee=row*col; + vector > matrix; + vector v1=get_integer(mode,min_value,max_value,sizee,1); + for(int i=0;i store; + for(int j=0;j> get_real_matrix(short precision,ll min_val,ll max_val,int row,int col,short order1,short order2) + { + int index=-1; + if(row<0) { row=get_initializer(row); } if(col<0) { col=get_initializer(col); } + ll sizee=row*col; + vector > matrix; + vector v1=get_real(precision,min_val,max_val,sizee,1); + for(int i=0;i store; + for(int j=0;j> get_string_matrix(short index2,int row,int col,short order1,short order2) + { + int index=-1; + if(row<0) { row=get_initializer(row); } if(col<0) { col=get_initializer(col); } + ll sizee=row*col; + vector > matrix; + vector v1=get_input_string_array(index2,sizee,1); + for(int i=0;i store; + for(int j=0;j> get_permutation_matrix(short index2,int row,int col,short order1,short order2) + { + int index=-1; + if(row<0) { row=get_initializer(row); } if(col<0) { col=get_initializer(col); } + ll sizee=row*col; + vector > matrix; + vector v1=get_all_permutations(index2,sizee,1); + for(int i=0;i store; + for(int j=0;j> get_matrix_of_all_unique_numbers(ll low,ll up,int row,int col,short order1,short order2) + { + int index=-1; + if(row<0) { row=get_initializer(row); } if(col<0) { col=get_initializer(col); } + ll sizee=row*col; + vector > matrix; + vector v1=get_all_random_numbers_for_array(low,up,sizee,1); + for(int i=0;i store; + for(int j=0;j> store_number_data; + vector > generated_numbers; + vector > generated_strings; + public: + void reset_custom_data() + { + index_of_generated_numbers=-1; + index_of_generated_strings=-1; + generated_numbers.clear(); + generated_strings.clear(); + } + short store_details_of_numbers_custom(short type,ll min_value,ll max_value,short order) + { + vector v1; v1.push_back(1); v1.push_back(type); v1.push_back(min_value); v1.push_back(max_value); v1.push_back(order); + store_number_data.push_back(v1); return (++index_of_numbers); + } + short store_details_of_real_custom(short precision,ll min_value,ll max_value,short order) + { + vector v1; v1.push_back(2); v1.push_back(precision); v1.push_back(min_value); v1.push_back(max_value); v1.push_back(order); + store_number_data.push_back(v1); return (++index_of_numbers); + } + short store_details_of_default_string_custom(short index) + { + vector v1; v1.push_back(3); v1.push_back(1); v1.push_back(index); + store_number_data.push_back(v1); return (++index_of_numbers); + } + short store_details_of_input_string_custom(short index,short order) + { + vector v1; v1.push_back(3); v1.push_back(2); v1.push_back(index); v1.push_back(order); + store_number_data.push_back(v1); return (++index_of_numbers); + } + short store_details_of_permutation_string_custom(short index,short order) + { + vector v1; v1.push_back(4); v1.push_back(index); v1.push_back(order); + store_number_data.push_back(v1); return (++index_of_numbers); + } + short store_details_of_unique_numbers_custom(ll min_val,ll max_val,short order) + { + vector v1; v1.push_back(5); v1.push_back(min_val); v1.push_back(max_val); v1.push_back(order); + store_number_data.push_back(v1); return (++index_of_numbers); + } + short store_space_in_custom() + { + vector v1; v1.push_back(6); + store_number_data.push_back(v1); return (++index_of_numbers); + } + void traverse_custom() // just to check if build properly + { + for(int i=0;i> build_custom_data_type(vector v1) + { + vector > custom_data; + int sizee=v1[2]; if(sizee<0) { sizee=get_initializer(sizee); } + for(short i=3;i v2=store_number_data[v1[i]]; + short ch=v2[0]; + switch(ch) + { + case 1: + { + vector store=get_integer(v2[1],v2[2],v2[3],sizee,v2[4]); generated_numbers.push_back(store); + custom_data.push_back(make_pair(1,++index_of_generated_numbers)); break; + } + case 2: + { + vector store=get_real(v2[1],v2[2],v2[3],sizee,v2[4]); generated_strings.push_back(store); + custom_data.push_back(make_pair(2,++index_of_generated_strings)); break; + } + case 3: + { + short choice=v2[1]; + switch(choice) + { + case 1: + { + string str=get_default_string(v2[2]); vector store(sizee,str); + generated_strings.push_back(store); custom_data.push_back(make_pair(2,++index_of_generated_strings)); break; + } + case 2: + { + vector store=get_input_string_array(v2[2],sizee,v2[3]); generated_strings.push_back(store); + custom_data.push_back(make_pair(2,++index_of_generated_strings)); break; + } + } + break; + } + case 4: + { + vector store=get_all_permutations(v2[1],sizee,v2[2]); generated_strings.push_back(store); + custom_data.push_back(make_pair(2,++index_of_generated_strings)); break; + } + case 5: + { + vector store=get_all_random_numbers_for_array(v2[1],v2[2],sizee,v2[3]); generated_numbers.push_back(store); + custom_data.push_back(make_pair(1,++index_of_generated_numbers)); break; + } + case 6: + { + custom_data.push_back(make_pair(3,3)); break; + } + } + } + return custom_data; + } + ll get_integer_data_of_custom(int index1,int index2) + { + return (generated_numbers[index1][index2]); + } + string get_string_data_of_custom(int index1,int index2) + { + return (generated_strings[index1][index2]); + } + }; + + + class Child_of_all_test_case_datatype:public Custom_data_type + { + public: + void show() + { + cout<<"Working\n"; + } + }; +} + +#endif // LAKSHYA_STANDARD_ALGORITHM_OF_TEST_CASES_H_INCLUDED diff --git a/Test_case_generator.cpp b/Test_case_generator.cpp index 458f2f5..6af34ac 100644 --- a/Test_case_generator.cpp +++ b/Test_case_generator.cpp @@ -1,12 +1,13 @@ -////////////////////////////////////////////////////////////////////////////////////// -//88888888888888888888888888888888888888 #include #include "special_attributes.h" #include "special_functions.h" +#include "LAKSHYA_STANDARD_ALGORITHM_OF_TEST_CASES.h" +//********************************************************************************************************************************* - +#define three_D_cube _3dc #define message_box msb +#define message_box_2 msb2 #define message mm #define object_of_main_menu1 omm1 #define object_type_one_menu otom @@ -15,19 +16,70 @@ #define set_of_containers sofc #define set_of_initializers sofi #define set_of_all_attributes sofaa +#define status_of_three_D_cube s_3dc +#define status_two_of_three_D_cube s2_3dc +#define original_three_D_cube o3dc +#define custom_data_type cdt +#define stored_initializer si +#define free_integer fi - - +//********************************************************************************************************************************* using namespace std; +using namespace lakshya_standard_algorithm_of_test_cases; using namespace special_attributes; using namespace special_functions; typedef long long ll; typedef long l; +//********************************************************************************************************************************* +class Three_D_objects +{ +private: + fstream f1; + vector >>> cube; + vector >>> custom; + vector >> initializer; + vector object_names; + vector > integers; + ll test_size=1; + ll query_size=1; + string file_name; +public: + bool test_print_status=false; + bool query_print_status=false; + void build(short index); + void build_integers(short index); + void set_data1(vector >> v1) { cube.push_back(v1); } + void set_data2(vector >> v2) { custom.push_back(v2); } + void set_object_name(string name) { object_names.push_back(name); } + void set_initializer(vector > v3) { initializer.push_back(v3); } + void set_test_size(ll k) { test_size=k; } + int get_cube_size() { return cube.size(); } + ll get_test_size() { return test_size; } + void set_query_size(ll k) { query_size=k; } + ll get_query_size() { return query_size; } + void show_data(); + void header(); + void object_display(); + void mm(short ch); + void set_file_name(string str) { file_name=str; } + void destroy_integers() { integers.clear(); } + void set_text_format() { file_name+=".txt"; } + void set_docu_format() { file_name+=".doc"; } + void build_file() { f1.open(file_name,ios::out); } + void close_file() { f1.close(); } + Three_D_objects() // constructor + { + test_size=1; query_size=1; + test_print_status=false; + query_print_status=false; + file_name=""; + } +}; - +//********************************************************************************************************************************* class main_menu { @@ -38,10 +90,13 @@ class main_menu void header(); void menu(); void message_box(); + void message_box_2(); void undo(); + void repos(); void jump_to_main(); void message(short); friend void function_of_object_one(); + friend void function_of_object_two(); static void set_choice(); static void set_dafault_choice_exe(); main_menu() // default constructor @@ -55,8 +110,7 @@ void main_menu::set_choice() void main_menu::set_dafault_choice_exe() { choice="exe";} - - +//********************************************************************************************************************************* class object_type_one_menu:public main_menu //parent of object_one , child of main_menu { @@ -66,6 +120,8 @@ class object_type_one_menu:public main_menu //parent of object_one , child of m void object_display(short,string&,ll&); // function overloading void object_display(short,string&,ll&,vector &); // function overloading void object_display(short,string&,ll&,vector &,short&,vector >&); // function overloading + void object_display(vector>&,short&); // function overloading + void object_display(class object_one&); ////////////////////////////////////////////////////////////////////////////////////// void otom_phase00(); // for phase zero state zero void otom_phase01(string&); // for phase zero state one void otom_phase02(string&); // for phase zero state two @@ -75,10 +131,10 @@ class object_type_one_menu:public main_menu //parent of object_one , child of m void otom_phase14_3(vector &); // for phase one state four part3 void otom_phase15_1(string&,ll&,vector &); // for phase one state five part 1 void otom_phase16_1(string &str,ll &t,vector &v1,short&,vector >&); // for phase one state six part 1 + void otom_phase27_1(vector >&,short&); // for phase two state seven part one }; - - +//********************************************************************************************************************************* class object_one:public otom // child class of object_type_one_menu and grand child of main_menu (MULTIPLE INHERITANCE) { @@ -88,27 +144,53 @@ class object_one:public otom // child class of object_type_one_menu and grand ch ll test_cases=1; //default set to one short no_of_initializers=0; short no_of_containers=1; + short no_of_attribute_for_custom=1; + short index_of_custom_data_type=-1; + string custom_structure=""; vector > set_of_initializers; // short_name -> sofi vector unique_names_of_identifiers; // short_name -> unoi vector set_of_containers; // short_name -> sofc vector > containers; vector > print_containers; vector > set_of_all_attributes; // short_name -> sofaa + vector >> three_D_cube; // short_name -> _3dc + vector > status_of_three_D_cube; // short_name -> s_3dc + vector > status_two_of_three_D_cube; // short name -> s2_3dc; + vector >> original_three_D_cube; // short name -> o3dc; + vector > dummy_o3dc; + vector >> dummy2_o3dc; + vector >> custom_data_type; // short name -> cdt + vector > stored_initializer; // short name -> si + ll free_integer=0; // short name -> fi + public: + vector >> cube_structure() { return o3dc; } // function to give 3d cube to 3d object + vector >> custom_data_structure() { return cdt; } // function to give custom data to 3d object + string give_object_name() { return name_of_object; } // function to give object's name + vector > initializer_data() { return stored_initializer; } // function to give back initializer details + ll give_test_size() { return test_cases; } // function to return test case size short incrementer=0; string choice1=""; - bool check_the_test_case_range02(string&); // for phase zero state two - bool check_the_initializers_choice_range13(string&); // for phase one state three - bool check_if_identifier_exist(); // for phase one state three (general use) - bool valid_length_of_initializers14(); // for phase one state four - void delete_all_initializers15(); //for phase one state five - string type_of_container16(short); // for phase one state six - short count_nth_container16(string&); //for phase one state six - void get_correct_print_container16(pair&); //for phase one state six - void delete_all_containers(); // for phase one state six - void name_the_object00(); // for phase zero state zero + bool type_test_size=true; + bool check_the_test_case_range02(string&); // for phase zero state two + bool check_the_initializers_choice_range13(string&); // for phase one state three + bool check_if_identifier_exist(); // for phase one state three (general use) + bool valid_length_of_initializers14(); // for phase one state four + void delete_all_initializers15(); //for phase one state five + string type_of_container16(short); // for phase one state six + short count_nth_container16(string&); //for phase one state six + void get_correct_print_container16(pair&); //for phase one state six + void build_set_of_all_attributes207(); // for phase two state zero_seven (message and build) + bool check_the_attribute_choice_range27(string&); // for phase two state seven + bool check_availability_of_attribute27(short&); // for phase two state seven + void object_display_in_phase_two27(); // for phase two state seven + void object_display_in_phase_three308(); // for phase three state eight + void object_display_in_phase_three38(); // for phase three state eight + void reset_three_dimensional_object27(); // for phase two state seven + void delete_all_containers(); // phase and state yet to be decided .......................................... + void name_the_object00(); // for phase zero state zero void main_controller(); - object_one() // constructor + object_one() // constructor { name_of_object=""; test_cases=1; @@ -117,20 +199,23 @@ class object_one:public otom // child class of object_type_one_menu and grand ch no_of_initializers=0; no_of_containers=1; incrementer=0; + no_of_attribute_for_custom=1; + custom_structure=""; + index_of_custom_data_type=-1; + type_test_size=true; } }; - - +//********************************************************************************************************************************* void function_of_object_one(); // friend function of class main menu +void function_of_object_two(); // friend function of class main menu - - - +//********************************************************************************************************************************* int main() { + srand(time(NULL)); short initial_fg_color = getfgcolor(); short initial_bg_color = getbgcolor(); sfc(ww); @@ -162,36 +247,26 @@ int main() return 0; } - - - +//********************************************************************************************************************************* void main_menu::welcome() { sfc(ww);gxy(5,5); - cout<<"WELCOME TO TEST CASE GENERATOR (version 1.1)\n\n\n"; - cout<<" Press "; sbc(dr);sfc(lr); - cout<<" ENTER ";sbc(bb);sfc(ww); - cout<<" to continue"; - getch(); - system("CLS"); + cout<<"WELCOME TO ";sfc(lm);printf("BUILDING CUBES");sfc(ww);printf(" (version 1.1)\n\n\n"); + sfc(lc);cout<<" You are advised to Maximize your screen to have complete display\n\n\n";sfc(ww); + cout<<" Press "; sbc(dr);sfc(lr); cout<<" ENTER ";sbc(bb);sfc(ww); cout<<" to continue"; getch(); system("CLS"); } - - +//********************************************************************************************************************************* void main_menu::header() { gxy(0,0);sbc(dm); - printf("TEST CASE GENERATOR ");sfc(dgg); - printf("Version (1.1) ");sfc(ww); - printf("Type ");sfc(lr);printf("exe");sfc(ww);printf(" and ");sfc(lr);printf("ENTER");sfc(ww);printf(" to");sbc(dr);printf(" Exit");sbc(bb); - printf("\n\n "); + printf(" BUILDING CUBES ");sfc(dgg); printf("Version (1.1) ");sfc(ww); + printf("Type ");sfc(lr);printf("exe");sfc(ww);printf(" and ");sfc(lr);printf("ENTER");sfc(ww);printf(" to");sbc(dr);printf(" Exit");sbc(bb); printf("\n\n "); } - - - +//********************************************************************************************************************************* void main_menu::menu() { @@ -211,12 +286,12 @@ void main_menu::menu() } else if(choice=="2") { - cout<<"IN Progress"; + function_of_object_two(); system("cls"); } else if(choice=="3") { - cout<<"IN Progress"; + cout<<"IN Progress, Still working"; getch(); system("cls"); } else if(choice=="exe") @@ -234,75 +309,80 @@ void main_menu::menu() } } - - +//********************************************************************************************************************************* void main_menu::msb() { - gxy(0,20);sbc(dr); - printf("MESSAGE BOX\n\n");sbc(bb); + gxy(0,20);sbc(dr); printf("MESSAGE BOX\n\n");sbc(bb); } +//********************************************************************************************************************************* +void main_menu::msb2() +{ + gxy(0,25);sbc(dr);printf("MESSAGE BOX");sbc(bb); +} - +//********************************************************************************************************************************* void main_menu::undo() { - gxy(54,1); - printf("Type ");sfc(lr);printf("und");sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf(" to ");sbc(lgg);printf("UNDO");sbc(bb); + gxy(54,1); printf("Type ");sfc(lr);printf("und");sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf(" to ");sbc(lgg);printf("UNDO");sbc(bb); } +//********************************************************************************************************************************* + void main_menu::repos() + { + gxy(0,4);sfc(lc);printf("\n COMMANDS\n");sfc(ww); + printf(" Type the corresponding key and ");sbc(dr);printf("ENTER");sbc(bb);printf(" to ");sfc(lc);printf("add ATTRIBUTE into your object\n\n");sfc(ww); + printf(" Type ");sfc(lr);printf("rep");sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf(" to ");sfc(lc);printf("Reposition the ATTRIBUTES");sfc(ww);printf("\n\n"); + printf(" Type ");sfc(lr);printf("nex");sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf(" to ");sfc(lc);printf("Move in next Line");sfc(ww);printf("\n"); + } +//********************************************************************************************************************************* void main_menu::jump_to_main() { - gxy(1,1); - printf("Type ");sfc(lr);printf("min");sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf(" to go back to MAIN MENU"); + gxy(1,1); printf("Type ");sfc(lr);printf("min");sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf(" to go back to MAIN MENU"); } - - - +//********************************************************************************************************************************* void main_menu::mm(short ch) { switch (ch) { + case 0: + { + gxy(5,26);printf("ENTER YOUR CHOICE -> "); break; + } case 1: { - gxy(5,22);printf("ENTER YOUR CHOICE -> "); - break; + gxy(5,22);printf("ENTER YOUR CHOICE -> "); break; } case 2: { gxy(5,23);printf("Please enter a valid choice, now press ");sbc(dr);printf("ENTER");sbc(bb);printf(" key"); - getch(); - system("cls"); - break; + getch(); system("cls"); break; } case 3: { - gxy(5,21);printf("You are in PHASE ZERO");printf(". Give a name to your object"); - break; + gxy(5,21);printf("You are in PHASE ZERO");printf(". Give a name to your object"); break; } case 4: { - gxy(5,7);printf("Name your object -> "); - break; + gxy(5,7);printf("Name your object -> "); break; } case 5: { gxy(5,22);printf("Nothing to undo in phase zero"); - gxy(5,23);printf("Press ");sbc(dr);printf("ENTER");sbc(bb);printf(" to continue"); - break; + gxy(5,23);printf("Press ");sbc(dr);printf("ENTER");sbc(bb);printf(" to continue"); break; } case 6: { gxy(5,22);printf("Please provide a smaller name of object"); - gxy(5,23);printf("Press ");sbc(dr);printf("ENTER");sbc(bb);printf(" to continue"); - break; + gxy(5,23);printf("Press ");sbc(dr);printf("ENTER");sbc(bb);printf(" to continue"); break; } case 7: { @@ -310,61 +390,51 @@ void main_menu::mm(short ch) printf("\n\n "); printf("If YES then type ");sfc(lr);printf("yes");sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb); printf("\n\n "); - printf("If NO then type ");sfc(lr);printf("no");sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb); - break; + printf("If NO then type ");sfc(lr);printf("no");sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb); break; } case 8: { - gxy(1,8);printf("How many copies would you like to create"); - break; + gxy(1,8);printf("How many copies would you like to create"); break; } case 9: { - gxy(2,22);printf("Only valid integers in range [1 - 1000000] are possible"); - break; + gxy(2,22);printf("Only valid integers in range [1 - 1000000] are possible"); break; } case 10: { gxy(1,7);printf("Insert ");sfc(ly);printf("INITIALIZERS");sfc(ww);printf(" into your object"); gxy(1,9);printf("You can add from range [0 to 10] ");sfc(ly);printf("INITIALIZERS");sfc(ww); gxy(1,11);sfc(lr);printf("NOTE: ");sfc(ly);printf("INITIALIZERS");sfc(ww);printf(" can be only of INTEGER TYPE"); - gxy(1,13);printf("How many ");sfc(ly);printf("INITIALIZERS");sfc(ww);printf(" would you like to add ?"); - break; + gxy(1,13);printf("How many ");sfc(ly);printf("INITIALIZERS");sfc(ww);printf(" would you like to add ?"); break; } case 11: { - gxy(2,22);printf("You can add ");sfc(ly);printf("INITIALIZERS");sfc(ww);printf(" in range of [0 - 10] "); - break; + gxy(2,22);printf("You can add ");sfc(ly);printf("INITIALIZERS");sfc(ww);printf(" in range of [0 - 10] "); break; } case 12: { gxy(1,6);printf("Give unique names to your ");sfc(ly);printf("INITIALIZERS");sfc(ww); - gxy(1,7);sfc(lr);printf("NOTE: ");sfc(ww);printf("Length of names should be less then 5 character"); - break; + gxy(1,7);sfc(lr);printf("NOTE: ");sfc(ww);printf("Length of names should be less then 5 character"); break; } case 13: { gxy(2,22);printf("The name of ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" has to be less then 5 characters"); - gxy(5,23);printf("Press ");sbc(dr);printf("ENTER");sbc(bb);printf(" to continue"); - break; + gxy(5,23);printf("Press ");sbc(dr);printf("ENTER");sbc(bb);printf(" to continue"); break; } case 14: { gxy(2,22);printf("This name of IDENTIFIER has been already used, try a different name"); - gxy(5,23);printf("Press ");sbc(dr);printf("ENTER");sbc(bb);printf(" to continue"); - break; + gxy(5,23);printf("Press ");sbc(dr);printf("ENTER");sbc(bb);printf(" to continue"); break; } case 15: { gxy(1,7);printf("Insert ");sfc(lg);printf("CONTAINERS");sfc(ww);printf(" into your object"); gxy(1,9);printf("You can add from range [1 to 10] ");sfc(lg);printf("CONTAINERS");sfc(ww); - gxy(1,11);printf("How many ");sfc(lg);printf("CONTAINERS");sfc(ww);printf(" would you like to add ?"); - break; + gxy(1,11);printf("How many ");sfc(lg);printf("CONTAINERS");sfc(ww);printf(" would you like to add ?"); break; } case 16: { - gxy(2,22);printf("You can add ");sfc(lg);printf("CONTAINERS");sfc(ww);printf(" in range of [1 - 10] "); - break; + gxy(2,22);printf("You can add ");sfc(lg);printf("CONTAINERS");sfc(ww);printf(" in range of [1 - 10] "); break; } case 17: { @@ -377,13 +447,11 @@ void main_menu::mm(short ch) printf("5. MATRIX ->");printf(" type ");sfc(lr);printf("5");sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf("\n"); printf("6. TREE ->");printf(" type ");sfc(lr);printf("6");sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf("\n"); printf("7. GRAPH ->");printf(" type ");sfc(lr);printf("7");sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf("\n"); - printf("8. CUSTOM_data_type -> ");printf(" type ");sfc(lr);printf("8");sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf("\n"); - break; + printf("8. CUSTOM_data_type -> ");printf(" type ");sfc(lr);printf("8");sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf("\n"); break; } case 18: { - gxy(2,21);printf("Add ");sfc(lg);printf("CONTAINERS");sfc(ww);printf(" by typing the keys in range [1 - 7] "); - break; + gxy(2,21);printf("Add ");sfc(lg);printf("CONTAINERS");sfc(ww);printf(" by typing the keys in range [1 - 7] "); break; } case 19: { @@ -392,8 +460,7 @@ void main_menu::mm(short ch) gxy(3,6);printf("Now you are moving towards ");sbc(dy);printf("PHASE THREE");sbc(bb); gxy(3,8);printf("In this phase you have to arrange positions of attributes in your object"); gxy(3,10);printf("You are advised to ");sfc(lc);printf("MAXIMIZE");sfc(ww);printf(" you screen to have complete display"); - gxy(3,12);printf("Press ");sbc(dr);printf("ENTER");sbc(bb);printf(" to continue..."); - break; + gxy(3,12);printf("Press ");sbc(dr);printf("ENTER");sbc(bb);printf(" to continue..."); break; } case 20: { @@ -408,33 +475,555 @@ void main_menu::mm(short ch) printf(" (nodes in TREE())\n"); printf(" (nodes in GRAPH())\n\n");sfc(ww); sfc(lg);printf("CONTAINERS");sfc(ww);printf(" -> These are set of primitive data types\n"); - printf("\n");printf("Press ");sbc(dr);printf("ENTER");sbc(bb);printf(" to continue..."); - break; + printf("\n");printf("Press ");sbc(dr);printf("ENTER");sbc(bb);printf(" to continue..."); break; + } + case 21: + { + gxy(5,27);printf("Please enter a valid choice, now press ");sbc(dr);printf("ENTER");sbc(bb);printf(" key"); + getch(); break; + } + case 22: + { + gxy(0,27);printf("This ATTRIBUTE is already inserted, now press ");sbc(dr);printf("ENTER");sbc(bb);printf(" key"); + getch(); break; + } + case 23: + { + gxy(0,27);printf("You must add at least one ATTRIBUTE to move into next line, now press ");sbc(dr);printf("ENTER");sbc(bb);printf(" key"); + getch(); break; + } + case 24: + { + printf("\n What type of integer would you like to create ?\n"); + printf("\n ");sfc(lr);printf("press 1");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> RANDOM NUMBER"); + printf("\n ");sfc(lr);printf("press 2");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> ODD NUMBER"); + printf("\n ");sfc(lr);printf("press 3");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> EVEN NUMBER"); + printf("\n ");sfc(lr);printf("press 4");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> PRIME NUMBER"); + printf("\n ");sfc(lr);printf("press 5");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> NON PRIME NUMBER"); + printf("\n ");sfc(lr);printf("press 6");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> INCREMENTED NUMBER"); + printf("\n ");sfc(lr);printf("press 7");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> Nth FIBONACCI NUMBER"); + printf("\n ");sfc(lr);printf("press 8");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> GET_ALL_UNIQUE_RANDOM NUMBERS"); + printf("\n\n Type your choice -> "); break; + } + case 25: + { + printf("\n\n Enter the ");sfc(ly);printf("Minimum");sfc(ww);printf(" value and then ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (-10 to the power 18) to (10 to the power 18)"); + printf("\n\n Minimum value -> "); break; + } + case 26: + { + printf("\n\n Enter the ");sfc(ly);printf("Maximum");sfc(ww);printf(" value and then ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (-10 to the power 18) to (10 to the power 18)"); + printf("\n\n Maximum value -> "); break; + } + case 27: + { + printf("\n\n Enter the ");sfc(ly);printf("Minimum");sfc(ww);printf(" value and then ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (2) to (10 to the power 7)"); + printf("\n\n Minimum value -> "); break; + } + case 28: + { + printf("\n\n Enter the ");sfc(ly);printf("Maximum");sfc(ww);printf(" value and then ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (2) to (10 to the power 7)"); + printf("\n\n Maximum value -> "); break; + } + case 29: + { + printf("\n\n Enter the ");sfc(ly);printf("Minimum");sfc(ww);printf(" value and then ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (1) to (10 to the power 12)"); + printf("\n\n Minimum value -> ");break; + } + case 30: + { + printf("\n\n Enter the ");sfc(ly);printf("Maximum");sfc(ww);printf(" value and then ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (1) to (10 to the power 12)"); + printf("\n\n Maximum value -> "); break; + } + case 31: + { + printf("\n\n Enter the ");sfc(ly);printf("Starting");sfc(ww);printf(" value and then ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (-10 to the power 18) to (10 to the power 18)"); + printf("\n\n Maximum value -> "); break; + } + case 32: + { + printf("\n\n Enter the ");sfc(ly);printf("Increment");sfc(ww);printf(" value and then ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (-10 to the power 18) to (10 to the power 18)"); + printf("\n\n Increment value -> "); break; + } + case 33: + { + printf("\n\n Enter the ");sfc(ly);printf("Minimum");sfc(ww);printf(" value and then ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (1) to (93)"); + printf("\n\n Minimum value -> ");break; + } + case 34: + { + printf("\n\n Enter the ");sfc(ly);printf("Maximum");sfc(ww);printf(" value and then ");sbc(dr);printf(" ENTER ");sbc(bb);\ + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (1) to (93)"); + printf("\n\n Maximum value -> "); break; + } + case 35: + { + printf("\n What type of integer would you like to insert ?\n"); + printf("\n ");sfc(lr);printf("press 1");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to insert -> RANDOM NUMBER"); + printf("\n ");sfc(lr);printf("press 2");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to insert -> ODD NUMBER"); + printf("\n ");sfc(lr);printf("press 3");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to insert -> EVEN NUMBER"); + printf("\n ");sfc(lr);printf("press 4");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to insert -> PRIME NUMBER"); + printf("\n ");sfc(lr);printf("press 5");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to insert -> NON PRIME NUMBER"); + printf("\n ");sfc(lr);printf("press 6");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to insert -> INCREMENTED NUMBER"); + printf("\n ");sfc(lr);printf("press 7");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to insert -> Nth FIBONACCI NUMBER"); + printf("\n\n Type your choice -> "); break; + } + case 36: + { + printf("\n\n Enter a valid choice"); + printf("\n\n Now press ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to continue"); break; + } + case 37: + { + printf("\n\n Please check the range and enter a valid Integer"); + printf("\n\n Now press ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to continue"); break; + } + case 38: + { + printf("\n\n Maximum value must be greater then Minimum value"); + printf("\n\n press ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to change"); break; + } + case 39: + { + printf("\n\n No odd Integer exist in the given range"); + printf("\n\n To change Maximum value, press ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww); break; + } + case 40: + { + printf("\n\n No even Integer exist in the given range"); + printf("\n\n To change Maximum value, press ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww); break; + } + case 41: + { + printf("\n\n No Prime Integers exist in the given range."); + printf("\n\n press ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to change the maximum value"); break; + } + case 42: + { + printf("\n\n No Non_Prime Integer exist in the given range."); + printf("\n\n press ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to change the maximum value"); break; + } + case 43: + { + printf("\n\n Set the precision for your REAL NUMBER..."); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("\n (You can set form range [0 to 100])\n"); + printf("\n Enter the precision -> ");break; + } + case 44: + { + printf("\n\n Note -> (Max_value - Min_value) should be >=1 "); + printf("\n\n press ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to change"); break; + } + case 45: + { + printf("\n What type of ARRAY would you like to create ?\n"); + printf("\n ");sfc(lr);printf("press 1");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> ARRAY OF INTEGER"); + printf("\n ");sfc(lr);printf("press 2");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> ARRAY OF REAL"); + printf("\n ");sfc(lr);printf("press 3");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> ARRAY OF STRING"); + printf("\n ");sfc(lr);printf("press 4");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> ARRAY OF PERMUTATION"); + printf("\n ");sfc(lr);printf("press 5");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> ARRAY OF UNIQUE NUMBER"); + printf("\n\n Type your choice -> "); break; + } + case 46: + { + printf("\n\n What type of string you want to create ?"); + printf("\n\n ");sfc(lr);printf("press 1");sfc(ww);printf(" and ");sbc(dr);printf(" ENTER ");sbc(bb);printf(" to create ");sfc(ly);printf("DEFAULT STRING");sfc(ww);printf(" (user defined)"); + printf("\n\n ");sfc(lr);printf("press 2");sfc(ww);printf(" and ");sbc(dr);printf(" ENTER ");sbc(bb);printf(" to create ");sfc(lg);printf("INPUT STRING");sfc(ww);printf(" (computer generated)"); + printf("\n\n Enter your choice -> "); break; + } + case 47: + { + printf("\n\n Type the Default String and then press ");sbc(dr);printf("ENTER");sbc(bb); + sfc(lr);printf("\n NOTE: ");sfc(ww);printf("Do not include spaces in your string"); + printf("\n\n Type your string -> "); break; + } + case 48: + { + printf("\n\n Type the Input String and then press ");sbc(dr);printf("ENTER");sbc(bb); + sfc(lr);printf("\n NOTE: ");sfc(ww);printf("Do not include spaces in your string"); + printf("\n\n Type your string -> "); break; + } + case 49: + { + printf("\n\n What type of STRING you want to create ?\n"); + sfc(lr);printf("\n press 1");sfc(ww);printf(" and ");sbc(dr);printf(" ENTER ");sbc(bb);printf(" to create -> ");sfc(ly);printf("RANDOM STRING"); + sfc(lr);printf("\n press 2");sfc(ww);printf(" and ");sbc(dr);printf(" ENTER ");sbc(bb);printf(" to create -> ");sfc(ly);printf("SORTED ASSENDING STRING"); + sfc(lr);printf("\n press 3");sfc(ww);printf(" and ");sbc(dr);printf(" ENTER ");sbc(bb);printf(" to create -> ");sfc(ly);printf("SORTED DESCENDING STRING"); + sfc(lr);printf("\n press 4");sfc(ww);printf(" and ");sbc(dr);printf(" ENTER ");sbc(bb);printf(" to create -> ");sfc(ly);printf("PALINDROMIC STRING");sfc(ww); + printf("\n\n Enter your choice -> "); break; + } + case 50: + { + printf("\n\n Select a valid mode of create\n"); + sfc(lr);printf("\n press 1");sfc(ww);printf(" and ");sbc(dr);printf(" ENTER ");sbc(bb);printf(" to generate -> ");sfc(ly);printf(" REPEATED SYMBOL STRING"); + sfc(lr);printf("\n press 2");sfc(ww);printf(" and ");sbc(dr);printf(" ENTER ");sbc(bb);printf(" to generate -> ");sfc(ly);printf(" ALL UNIQUE SYMBOL STRING");sfc(ww); + printf("\n\n Enter your choice -> "); break; + } + case 51: + { + printf("\n\n Enter the size of STRING and then press ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (1) to (10 to the power 6)"); + printf("\n\n SIZE -> "); break; + } + case 52: + { + printf("\n\n You can add following Attributes\n"); + printf("\n ");sfc(lr);printf("press 1");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to add -> INTEGER"); + printf("\n ");sfc(lr);printf("press 2");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to add -> REAL"); + printf("\n ");sfc(lr);printf("press 3");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to add -> STRING"); + printf("\n ");sfc(lr);printf("press 4");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to add -> PERMUTATION"); + printf("\n ");sfc(lr);printf("press 5");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to add -> UNIQUE NUMBER"); + printf("\n ");sfc(lr);printf("press 6");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to add -> SPACE"); + printf("\n\n Type your choice -> "); break; + } + case 53: + { + printf("\n Select a valid order for this column of your ");sfc(lg);printf("CUSTOM_{}\n");sfc(ww); + printf("\n ");sfc(lr);printf("press 1");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to apply -> RANDOMLY ARRANGED"); + printf("\n ");sfc(lr);printf("press 2");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to apply -> SORTED ASCENDING"); + printf("\n ");sfc(lr);printf("press 3");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to apply -> SORTED DESCENDING"); + printf("\n Enter your choice -> "); break; + } + case 54: + { + printf("\n\n Select a valid ");sfc(lm);printf("ORDER");sfc(ww);printf(" for your ");sfc(lg);printf("ARRAY[]\n");sfc(ww); + printf("\n ");sfc(lr);printf("press 1");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to apply -> RANDOMLY ARRANGED"); + printf("\n ");sfc(lr);printf("press 2");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to apply -> SORTED ASCENDING"); + printf("\n ");sfc(lr);printf("press 3");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to apply -> SORTED DESCENDING"); + printf("\n\n Enter your choice -> "); break; + } + case 55: + { + printf("\n\n Select a valid ");sfc(lm);printf("Print Format");sfc(ww);printf(" for your");sfc(lg);printf(" ARRAY[] \n");sfc(ww); + printf("\n ");sfc(lr);printf("press 1");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to select -> Space Separated "); + printf("\n ");sfc(lr);printf("press 2");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to select -> Line Separated"); + printf("\n\n Type your choice -> "); break; + } + case 56: + { + printf("\n\n Enter the Size of your ");sfc(lg);printf("ARRAY[]");sfc(ww);printf(" and then press ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (1) to (10 to the power 6)"); + printf("\n\n If you want to choose an ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" then type ");sfc(lm);printf("int");sfc(ww);printf(" and ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n\n Type your choice -> "); break; + } + case 57: + { + printf("\n\n Type the ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" name and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww); + printf("\n To cancel this feature type ");sfc(lm);printf("cl");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww); + printf("\n\n Type your choice -> "); break; + } + case 58: + { + printf("\n\n Please type a valid choice"); + printf("\n\n Now press ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to continue"); break; + } + case 59: + { + printf("\n\n Oops, you have not defined any ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" yet, you can not use this feature."); + printf("\n\n Now press ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to continue"); break; + } + case 60: + { + printf("\n What type of MATRIX would you like to create ?\n"); + printf("\n ");sfc(lr);printf("press 1");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> MATRIX OF INTEGER"); + printf("\n ");sfc(lr);printf("press 2");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> MATRIX OF REAL"); + printf("\n ");sfc(lr);printf("press 3");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> MATRIX OF STRING"); + printf("\n ");sfc(lr);printf("press 4");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> MATRIX OF PERMUTATION"); + printf("\n ");sfc(lr);printf("press 5");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to create -> MATRIX OF UNIQUE NUMBER"); + printf("\n\n Type your choice -> "); break; + } + case 61: + { + printf("\n\n Enter the Number of Rows for your ");sfc(lg);printf("MATRIX[]");sfc(ww);printf(" and then press ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (1) to (10 to the power 6)"); + printf("\n\n If you want to choose an ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" then type ");sfc(lm);printf("int");sfc(ww);printf(" and ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n\n Type your choice -> "); break; + } + case 62: + { + printf("\n\n Enter the Number of Columns for your ");sfc(lg);printf("MATRIX[]");sfc(ww);printf(" and then press ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (1) to (10 to the power 6)"); + printf("\n\n If you want to choose an ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" then type ");sfc(lm);printf("int");sfc(ww);printf(" and ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n\n Type your choice -> "); break; + } + case 63: + { + printf("\n\n Select a valid ");sfc(lm);printf("COLUMN ORDER");sfc(ww);printf(" for your ");sfc(lg);printf("MATRIX[][]\n");sfc(ww); + printf("\n ");sfc(lr);printf("press 1");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to apply -> COLUMN WISE RANDOMLY ARRANGED"); + printf("\n ");sfc(lr);printf("press 2");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to apply -> COLUMN WISE SORTED ASCENDING"); + printf("\n ");sfc(lr);printf("press 3");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to apply -> COLUMN WISE SORTED DESCENDING"); + printf("\n\n Enter your choice -> "); break; + } + case 64: + { + printf("\n\n Select a valid ");sfc(lm);printf("ROW ORDER");sfc(ww);printf(" for your ");sfc(lg);printf("MATRIX[][]\n");sfc(ww); + printf("\n ");sfc(lr);printf("press 1");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to apply -> ROW WISE RANDOMLY ARRANGED"); + printf("\n ");sfc(lr);printf("press 2");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to apply -> ROW WISE SORTED ASCENDING"); + printf("\n ");sfc(lr);printf("press 3");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to apply -> ROW WISE SORTED DESCENDING"); + printf("\n\n Enter your choice -> "); break; + } + case 65: + { + printf("\n\n You are only allowed to create 1000000 Number of Cells in your ");sfc(lg);printf("Matrix[][]");sfc(ww);printf(" at a time."); + printf("\n\n However, as per the details of Rows and Columns of your ");sfc(lg);printf("Matrix[][]");sfc(ww); + printf("Number of cells is = "); break; + } + case 66: + { + printf("\n\n So you are advised to reduce the Number of Columns from your ");sfc(lg);printf("Matrix[][]");sfc(ww); + sfc(lr);printf("\n Note: ");sfc(ww);printf("Number of cells = Rows*Columns"); + printf("\n\n Now press ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to change Number of Columns"); break; + } + case 67: + { + printf("\n\n Enter the number of Attributes you want to insert and then press ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (1) to (20)"); + printf("\n\n Type your choice -> "); break; + } + case 68: + { + printf("\n\n Type the String and then press ");sbc(dr);printf("ENTER");sbc(bb); + sfc(lr);printf("\n NOTE: ");sfc(ww);printf("Do not include spaces in your string"); + printf("\n ");printf("Range : Length must be less then 20 characters"); + printf("\n\n Type your string -> "); break; + } + case 69: + { + printf("\n\n Enter the number of Rows you want to create in your ");sfc(lg);printf("CUSTOM_{}");sfc(ww);printf(" and then press ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (1) to (10 to the power 6)"); + printf("\n\n If you want to choose an ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" then type ");sfc(lm);printf("int");sfc(ww);printf(" and ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n\n Type your choice -> "); break; + } + case 70: + { + printf("\n\n Enter the size of Palindromic STRING and then press ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (1) to ("); break; } } } - - - - - +//********************************************************************************************************************************** +//********************************************************************************************************************************** void function_of_object_one() { - system("cls"); - //cout<<"you are in object 1 class\n"; + string choice; + main_menu dummy_obj; object_one o1; + Three_D_objects obj1; o1.main_controller(); - if(o1.choice1=="exe") { main_menu::set_dafault_choice_exe(); } + if(o1.choice1=="min") { return; } + if(o1.choice1=="exe") { main_menu::set_dafault_choice_exe(); return;} + obj1.set_data1(o1.cube_structure()); + obj1.set_data2(o1.custom_data_structure()); + obj1.set_object_name(o1.give_object_name()); + obj1.set_initializer(o1.initializer_data()); + obj1.set_test_size(o1.give_test_size()); + //obj1.show_data(); + obj1.mm(1);getch(); + while(1) // do you want to include test value in TEST File + { + system("cls"); dummy_obj.header();dummy_obj.jump_to_main();obj1.object_display();obj1.mm(2); cin>>choice; + if(choice=="min"||choice=="exe"||choice=="yes"||choice=="no") { break; } + else { obj1.mm(0);getch(); } + } + if(choice=="min") { return; } + if(choice=="exe") { main_menu::set_dafault_choice_exe(); return;} + while(1) // Build the Test File + { + system("cls");obj1.mm(10);string name;cin>>name; + obj1.set_file_name(name); + while(1) // Set File Format + { + system("cls"); obj1.mm(11); cin>>choice; + if(choice=="1") { obj1.set_text_format();break; } + if(choice=="2") { obj1.set_docu_format();break; } + else { obj1.mm(0);getch(); } + } + obj1.mm(3);getch();obj1.mm(4); + obj1.build_integers(0); + if(choice=="yes") { obj1.test_print_status=true; } + obj1.build_file(); + ll t=obj1.get_test_size(); + while(t--) + { + obj1.build(0); + } + obj1.destroy_integers(); + obj1.close_file(); + string choice2; + while(1) + { + system("cls"); obj1.mm(5); cin>>choice2; + if(choice2=="1"||choice2=="2"||choice2=="3") { break; } + else { obj1.mm(0);getch(); } + } + if(choice2=="1") { continue; } + if(choice2=="2") { break; } + if(choice2=="3") { main_menu::set_dafault_choice_exe(); break;} + } } +//********************************************************************************************************************************* +void function_of_object_two() +{ + string choice,choice3; short ch; + Three_D_objects obj1; + main_menu dummy_obj; + while(1) // How many Objects you want to create + { + system("cls"); dummy_obj.header();dummy_obj.jump_to_main(); obj1.mm(6); cin>>choice; + if(choice=="min") { return; } + if(choice=="exe") { main_menu::set_dafault_choice_exe(); return;} + bool check=valid_pos_neg_integer(choice); + if(check==false) { obj1.mm(0);getch();continue; } + ch=string_to_integer_converter(choice); + if(ch<1 || ch>10) { obj1.mm(0);getch();continue; } + break; + } + //******************************************************************************************************************************** + for(short itr=0;itr>choice; + if(choice=="min") { return; } + if(choice=="exe") { main_menu::set_dafault_choice_exe(); return;} + bool check=valid_pos_neg_integer(choice); + if(check==false) { obj1.mm(0);getch();continue; } + ch=string_to_integer_converter(choice); + if(ch<1 || ch>100000) { obj1.mm(0);getch();continue; } + obj1.set_query_size(ch); break; + } + //******************************************************************************************************************************** + while(1) // do you want to include Query value in Test File + { + system("cls"); dummy_obj.header();dummy_obj.jump_to_main();obj1.object_display();obj1.mm(8); cin>>choice; + if(choice=="min"||choice=="exe"||choice=="yes"||choice=="no") { break; } + else { obj1.mm(0);getch(); } + } + if(choice=="min") { return; } + if(choice=="exe") { main_menu::set_dafault_choice_exe(); return;} + //******************************************************************************************************************************** + while(1) // Arrangement of objects + { + system("cls"); dummy_obj.header();dummy_obj.jump_to_main();obj1.object_display();obj1.mm(9); cin>>choice3; + if(choice3=="min"||choice3=="exe"||choice3=="1"||choice3=="2") { break; } + else { obj1.mm(0);getch(); } + } + if(choice3=="min") { return; } + if(choice3=="exe") { main_menu::set_dafault_choice_exe(); return;} + //******************************************************************************************************************************** + if(choice3=="1") // Sequential Arrangement of Objects + { + while(1) + { + system("cls");obj1.mm(10);string name;cin>>name; + obj1.set_file_name(name); + //************************************************************************************************************************* + while(1) // Set File Format + { + system("cls"); obj1.mm(11); cin>>choice; + if(choice=="1") { obj1.set_text_format();break; } + if(choice=="2") { obj1.set_docu_format();break; } + else { obj1.mm(0);getch(); } + } + //************************************************************************************************************************* + obj1.mm(3);getch();obj1.mm(4); + if(choice=="yes") { obj1.query_print_status=true; } + obj1.build_file(); + int t=obj1.get_query_size(); int start=-1; + while(t--) + { + int index=(++start)%obj1.get_cube_size(); + obj1.build_integers(index); + obj1.build(index); + obj1.destroy_integers(); + } + obj1.close_file(); + string choice2; + while(1) + { + system("cls"); obj1.mm(5); cin>>choice2; + if(choice2=="1"||choice2=="2"||choice2=="3") { break; } + else { obj1.mm(0);getch(); } + } + if(choice2=="1") { continue; } + if(choice2=="2") { break; } + if(choice2=="3") { main_menu::set_dafault_choice_exe(); break;} + } + } + //******************************************************************************************************************************** + else // Randomized Arrangement of Objects + { + while(1) + { + system("cls");obj1.mm(10);string name;cin>>name; + obj1.set_file_name(name); + //************************************************************************************************************************* + while(1) // Set File Format + { + system("cls"); obj1.mm(11); cin>>choice; + if(choice=="1") { obj1.set_text_format();break; } + if(choice=="2") { obj1.set_docu_format();break; } + else { obj1.mm(0);getch(); } + } + //************************************************************************************************************************* + system("cls"); obj1.mm(3);getch();obj1.mm(4); + if(choice=="yes") { obj1.query_print_status=true; } + obj1.build_file(); + ll t=obj1.get_query_size(); + while(t--) + { + int index=rand()%obj1.get_cube_size(); + obj1.build_integers(index); + obj1.build(index); + obj1.destroy_integers(); + } + obj1.close_file(); + string choice2; + while(1) + { + system("cls"); obj1.mm(5); cin>>choice2; + if(choice2=="1"||choice2=="2"||choice2=="3") { break; } + else { obj1.mm(0);getch(); } + } + if(choice2=="1") { continue; } + if(choice2=="2") { break; } + if(choice2=="3") { main_menu::set_dafault_choice_exe(); break;} + } + } + //obj1.show_data(); +} - - +//********************************************************************************************************************************** +//********************************************************************************************************************************** void otom::object_display(short ch) @@ -443,17 +1032,12 @@ void otom::object_display(short ch) { case 0: { - gxy(60,4); - printf("Empty Object"); - gxy(59,5);printf("[ ]"); - break; + gxy(60,4); printf("Empty Object"); gxy(59,5);printf("[ ]"); break; } } } - - - +//********************************************************************************************************************************* void otom::object_display(short ch,string &str) { @@ -461,18 +1045,12 @@ void otom::object_display(short ch,string &str) { case 1: { - gxy(60,4); - cout< &v1) // overloaded function { @@ -501,24 +1071,17 @@ void otom::object_display(short ch,string &name_of_object,ll &test_case_size,vec { case 4: { - gxy(60,4); - cout< &v1,short &n,vector > &v2) { @@ -526,15 +1089,13 @@ void otom::object_display(short ch,string &str,ll &t,vector &v1,short & { case 5: { - gxy(60,4); - cout< &v1,short & } } +//********************************************************************************************************************************* +void otom::object_display(vector > &v1,short& n) +{ + gxy(7,13);sfc(ly);printf("INITIALIZERS");sfc(ww); if(n==0) { gxy(4,14);printf("(no initializers)"); } + short set_x_axis=1; + short set_y_axis=14; + for(short i=0;i(v1[i])==true) continue; + gxy(set_x_axis,++set_y_axis);printf("Press ");sfc(lr);cout<(v1[i]);sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf(" to add ");sfc(ly);cout<(v1[i])<<"\n";sfc(ww); + } + set_x_axis=38; + set_y_axis=14; + gxy(48,13);sfc(lg);printf("CONTAINERS");sfc(ww); + for(short i=n;i(v1[i])==true) continue; + gxy(set_x_axis,++set_y_axis);printf("Press ");sfc(lr);cout<(v1[i]);sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf(" to add ");sfc(lg);cout<(v1[i])<<"\n";sfc(ww); + } +} - - - - +//********************************************************************************************************************************* void otom::otom_phase00() { header();msb();mm(3);undo();jump_to_main();object_display(0); - gxy(2,3);sbc(dy);printf("PHASE ZERO");sbc(bb);printf("-> Creating an Empty Object");mm(4); - mm(1); + gxy(2,3);sbc(dy);printf("PHASE ZERO");sbc(bb);printf("-> Creating an Empty Object");mm(4); mm(1); } - - - - +//********************************************************************************************************************************* void otom::otom_phase01(string &str) { @@ -578,9 +1152,7 @@ void otom::otom_phase01(string &str) gxy(2,3);sbc(dy);printf("PHASE ZERO");sbc(bb);printf("-> Creating an Empty Object");mm(7);mm(1); } - - - +//********************************************************************************************************************************* void otom::otom_phase02(string &str) { @@ -588,8 +1160,7 @@ void otom::otom_phase02(string &str) gxy(2,3);sbc(dy);printf("PHASE ZERO");sbc(bb);printf("-> Creating an Empty Object");mm(8);mm(1); } - - +//********************************************************************************************************************************* void otom::otom_phase13(string &str,ll &t) { @@ -597,9 +1168,7 @@ void otom::otom_phase13(string &str,ll &t) gxy(2,3);sbc(dy);printf("PHASE ONE");sbc(bb);printf("-> Adding ATTRIBUTES in Object");mm(10);mm(1); } - - - +//********************************************************************************************************************************* void otom::otom_phase14_1(string &str,ll &t) { @@ -607,9 +1176,7 @@ void otom::otom_phase14_1(string &str,ll &t) gxy(2,3);sbc(dy);printf("PHASE ONE");sbc(bb);printf("-> Adding ATTRIBUTES in Object");mm(12); } - - - +//********************************************************************************************************************************* void otom::otom_phase14_2(short copy_of_no_of_initilizers) { @@ -617,28 +1184,20 @@ void otom::otom_phase14_2(short copy_of_no_of_initilizers) int sn=0; // sn stands for starting_number while(copy_of_no_of_initilizers--) { - sn++; - gxy(1,++si);if(sn==10) {gxy(0,si);}cout<"); + sn++; gxy(1,++si);if(sn==10) {gxy(0,si);}cout<"); } } - - - +//********************************************************************************************************************************* void otom::otom_phase14_3(vector &str) { if(str.size()==1) return; short si=8; // si stands for starting_index - for(short i=1;i &v1) { @@ -646,10 +1205,7 @@ void otom::otom_phase15_1(string &str,ll &t,vector &v1) gxy(2,3);sbc(dy);printf("PHASE ONE");sbc(bb);printf("-> Adding ATTRIBUTES in Object");mm(15);mm(1); } - - - - +//********************************************************************************************************************************* void otom::otom_phase16_1(string &str,ll &t,vector &v1,short &n,vector > &v2) { @@ -657,13 +1213,15 @@ void otom::otom_phase16_1(string &str,ll &t,vector &v1,short &n,vector gxy(2,3);sbc(dy);printf("PHASE ONE");sbc(bb);printf("-> Adding ATTRIBUTES in Object");mm(17);mm(18); } +//********************************************************************************************************************************* +void otom::otom_phase27_1(vector> &v1,short &n) +{ + header();jump_to_main();repos();object_display(v1,n); + gxy(2,3);sbc(dy);printf("PHASE THREE");sbc(bb);printf("-> Positioning of ATTRIBUTES in Object");msb2(); +} - - - - - +//********************************************************************************************************************************* bool object_one::check_the_test_case_range02(string &temp) { @@ -673,9 +1231,7 @@ bool object_one::check_the_test_case_range02(string &temp) return check; } - - - +//********************************************************************************************************************************* bool object_one::check_the_initializers_choice_range13(string &temp) { @@ -685,33 +1241,24 @@ bool object_one::check_the_initializers_choice_range13(string &temp) return check; } - - +//********************************************************************************************************************************* void object_one::name_the_object00() { - name_of_object=choice1; - unoi.push_back(choice1); + name_of_object=choice1; unoi.push_back(choice1); + if(type_test_size==false) { state="state03_message";return; } state="state1"; } - - - +//********************************************************************************************************************************* bool object_one::check_if_identifier_exist() //general use { - for(short i=0;i &p1) +{ + string str="",&temp=p1.second,number=positive_number_to_string(p1.first); + if(temp=="i") { str+="INTEGER_"; str+=number; } + if(temp=="r") { str+="REAL_"; str+=number; str+=".()"; } + if(temp=="a") { str+="ARRAY_"; str+=number; str+="[]"; } + if(temp=="s") { str+="STRING_"; str+=number; str+="()"; } + if(temp=="m") { str+="MATRIX_"; str+=number; str+="[][]"; } + if(temp=="t") { str+="TREE_"; str+=number; str+="()()"; } + if(temp=="g") { str+="GRAPH_"; str+=number; str+="()()";} + if(temp=="c") { str+="CUSTOM_"; str+=number; str+="{}"; } + temp=str; +} +//********************************************************************************************************************************* -short object_one::count_nth_container16(string &str) +void object_one::build_set_of_all_attributes207() { - short countt=0; - for(short i=0;i3) + return false; + bool check=all_integers(temp); + return check; } +//********************************************************************************************************************************* +bool object_one::check_availability_of_attribute27(short& temp) +{ + if(get<0>(sofaa[temp-1])==true) return false; + return true; +} +//********************************************************************************************************************************* +void object_one::reset_three_dimensional_object27() +{ + _3dc.clear(); + for(short i=0;i(sofaa[i])=false; } +} +//********************************************************************************************************************************* -void object_one::get_correct_print_container16(pair &p1) +void object_one::object_display_in_phase_two27() { - string str="",&temp=p1.second,number=positive_number_to_string(p1.first); - if(temp=="i") - { - str+="INTEGER_"; - str+=number; - } - if(temp=="r") + gxy(0,28); sfc(lc);cout<0) sfc(lg); + cout<<_3dc[i][j].second<<" ";sfc(ww); + } + if(i==(_3dc.size()-1)) break; + cout<<"\n"; } - temp=str; + string s1="Acurrent_pointer";s1[0]-=38; + sfc(lr);cout<0) sfc(lg); + cout<<_3dc[i][j].second<<" ";sfc(ww); + } + printf("\n"); + }sbc(dr); + printf("\n\nMESSAGE BOX\n");sbc(bb); + printf("You have successfully completed the three phases\n"); + printf("Now you are just one final phase away to generate your test cases\n"); + printf("\n\n Type ");sfc(lr);printf("rep");sfc(ww); + printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf(" to reposition your object"); + printf("\n\n Type ");sfc(lg);printf("con");sfc(ww); + printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf(" to continue..."); + printf("\n\nEnter your choice -> "); +} +//********************************************************************************************************************************* +void object_one::object_display_in_phase_three38() +{ + gxy(2,3);sbc(dy);printf("PHASE FOUR");sbc(bb);printf("-> Giving Values to ATTRIBUTES"); + gxy(0,5);printf("This is the structure of your object\n"); + sfc(lc);cout<0) sfc(lg); + cout<<_3dc[i][j].second<<" ";sfc(ww); + } + printf("\n"); + } +} - +//********************************************************************************************************************************* void object_one::delete_all_containers() ////phase and state yet to be decided................................................................................. { + for(short i=0;i>choice1; + system("cls"); otom_phase00(); cin>>choice1; if(choice1=="min") break; else if(choice1=="und") {mm(5);getch();} else if(choice1=="exe") { break; } else if(choice1.size()>10) {system("cls");otom_phase00();mm(6);getch();continue;} - else - { name_the_object00(); } + else { name_the_object00(); } } // state1 if(state=="state1") // does it have test cases { - system("cls"); - otom_phase01(name_of_object); - cin>>choice1; + system("cls"); otom_phase01(name_of_object); cin>>choice1; if(choice1=="min") break; - else if(choice1=="und") - { - unoi.pop_back(); - state="state0"; - continue; - } + else if(choice1=="und") { unoi.pop_back(); state="state0"; continue; } else if(choice1=="exe") { break; } - else if(choice1=="yes") - { - state="state2"; - } - else if(choice1=="no") - { - state="state03_message"; - } + else if(choice1=="yes") { state="state2"; } + else if(choice1=="no") { state="state03_message"; } else { system("cls"); otom_phase01(name_of_object); mm(2); } } // state 2 if(state=="state2") // if yes, how many { - system("cls"); - otom_phase02(name_of_object); - cin>>choice1; + system("cls"); otom_phase02(name_of_object); cin>>choice1; if(choice1=="min") break; - else if(choice1=="und") - { - state="state1"; - continue; - } + else if(choice1=="und") { state="state1"; continue; } else if(choice1=="exe") { break; } else { bool check=check_the_test_case_range02(choice1); - if(check==false) - { - system("cls"); - otom_phase02(name_of_object); - mm(9);mm(2); - continue; - } + if(check==false) { system("cls"); otom_phase02(name_of_object); mm(9);mm(2); continue; } ll int_checker=string_to_integer_converter(choice1); - if(int_checker<=0||int_checker>1000000) - { - system("cls"); - otom_phase02(name_of_object); - mm(9);mm(2); - continue; - } - else - { - test_cases=string_to_integer_converter(choice1); - state="state03_message"; - } + if(int_checker<=0||int_checker>1000000) { system("cls"); otom_phase02(name_of_object); mm(9);mm(2); continue; } + else { test_cases=string_to_integer_converter(choice1); state="state03_message"; } } } - - + // state 03_message if(state=="state03_message") { - system("cls"); - mm(20);getch(); - state="state3"; + system("cls"); mm(20);getch(); state="state3"; } // phase 1 starts from here // state 3 how many initializers does it have if(state=="state3") { - system("cls"); - otom_phase13(name_of_object,test_cases); - cin>>choice1; + system("cls"); otom_phase13(name_of_object,test_cases); cin>>choice1; if(choice1=="min") break; - else if(choice1=="und") - { - state="state1"; - test_cases=1; - continue; - } + else if(choice1=="und") { state="state1"; test_cases=0; continue; } else if(choice1=="exe") { break; } else { bool check=check_the_initializers_choice_range13(choice1); - if(check==false) - { - system("cls"); - otom_phase13(name_of_object,test_cases); - mm(11);mm(2); - continue; - } + if(check==false) { system("cls"); otom_phase13(name_of_object,test_cases); mm(11);mm(2); continue; } ll int_checker=string_to_integer_converter(choice1); - if(int_checker>10) - { - system("cls"); - otom_phase13(name_of_object,test_cases); - mm(11);mm(2); - continue; - } - else - { - no_of_initializers=string_to_integer_converter(choice1); - state="state4"; - } + if(int_checker>10) { system("cls"); otom_phase13(name_of_object,test_cases); mm(11);mm(2); continue; } + else { no_of_initializers=string_to_integer_converter(choice1); state="state4"; } } } @@ -995,101 +1527,64 @@ void object_one::main_controller() // main controller function else if(choice1=="und") { if(i==1) break; - else { unoi.pop_back();i-=2;continue; } + else { unoi.pop_back();sofi.pop_back();++incrementer;i-=2;continue; } } else { bool check=valid_length_of_initializers14(); - if(check==false) - { - mm(13);getch();--i;continue; - } + if(check==false) { mm(13);getch();--i;continue; } check=check_if_identifier_exist(); // general for all - if(check==false) - { - mm(14);getch();--i;continue; - } + if(check==false) { mm(14);getch();--i;continue; } unoi.push_back(choice1); - pair p1; - p1=make_pair(--incrementer,choice1); - sofi.push_back(p1); + sofi.push_back(make_pair(--incrementer,choice1)); } } - - - - if(choice1=="min") break; else if(choice1=="und") { - state="state3"; - continue; + state="state3"; continue; } else if(choice1=="exe") { break; } state="state5"; } - // state 5 how many containers dose it have if(state=="state5") { - system("cls"); - otom_phase15_1(name_of_object,test_cases,unoi); - cin>>choice1; + system("cls"); otom_phase15_1(name_of_object,test_cases,unoi); cin>>choice1; if(choice1=="min") break; - else if(choice1=="und") - { - delete_all_initializers15(); - state="state4";continue; - } + else if(choice1=="und") { delete_all_initializers15(); state="state4";continue; } else if(choice1=="exe") { break; } else { bool check=check_the_initializers_choice_range13(choice1); // same functionality, so using this function - if(check==false) - { - system("cls"); - otom_phase15_1(name_of_object,test_cases,unoi); - mm(16);mm(2); - continue; - } + if(check==false) { system("cls"); otom_phase15_1(name_of_object,test_cases,unoi); mm(16);mm(2); continue; } ll int_checker=string_to_integer_converter(choice1); if(int_checker<=0 || int_checker>10) { - system("cls"); - otom_phase15_1(name_of_object,test_cases,unoi); - mm(16);mm(2); - continue; + system("cls"); otom_phase15_1(name_of_object,test_cases,unoi); mm(16);mm(2); continue; } else { - no_of_containers=string_to_integer_converter(choice1); - state="state6"; + no_of_containers=string_to_integer_converter(choice1); state="state6"; } - - } + } } - - // state 6 + // state 6 type of containers if(state=="state6") { for(short i=1;i<=no_of_containers;i++) { - system("cls"); - otom_phase16_1(name_of_object,test_cases,unoi,no_of_initializers,print_containers);mm(1); - cin>>choice1; + system("cls"); otom_phase16_1(name_of_object,test_cases,unoi,no_of_initializers,print_containers);mm(1); cin>>choice1; if(choice1=="min") break; else if(choice1=="und") { if(i==1) { break; } else { - containers.pop_back(); - print_containers.pop_back(); - sofc.pop_back();i-=2; - continue; + containers.pop_back(); print_containers.pop_back(); sofc.pop_back();i-=2; continue; } } else if(choice1=="exe") { break; } @@ -1098,95 +1593,3933 @@ void object_one::main_controller() // main controller function bool check=check_the_initializers_choice_range13(choice1); // same functionality so using this function again if(check==false) { - system("cls"); - otom_phase16_1(name_of_object,test_cases,unoi,no_of_initializers,print_containers); - mm(2);--i; - continue; + system("cls"); otom_phase16_1(name_of_object,test_cases,unoi,no_of_initializers,print_containers); mm(2);--i; continue; } ll int_checker=string_to_integer_converter(choice1); if(int_checker<=0 || int_checker>=9) { - system("cls"); - otom_phase16_1(name_of_object,test_cases,unoi,no_of_initializers,print_containers); - mm(2);--i; - continue; + system("cls"); otom_phase16_1(name_of_object,test_cases,unoi,no_of_initializers,print_containers); mm(2);--i; continue; } else { string name_of_container=type_of_container16(int_checker); sofc.push_back(name_of_container); short nth_number_of_container=count_nth_container16(name_of_container); + containers.push_back(make_pair(int_checker,name_of_container)); pair p1; p1=make_pair(nth_number_of_container,name_of_container); - //p1.first=nth_number_of_container; - //p1.second=name_of_container; - containers.push_back(p1); get_correct_print_container16(p1); print_containers.push_back(p1); } } } + if(choice1=="min") break; + else if(choice1=="und") { state="state5";continue; } + else if(choice1=="exe") { break; } + state="state07"; + } + // state 07 message and build + if(state=="state07") + { + system("cls"); mm(19); getch(); build_set_of_all_attributes207(); state="state7"; + } + // phase 2 state 7 positioning of attributes + if(state=="state7") + { + short elements=sofaa.size(); + vector > null_object; + null_object.push_back(make_pair(0,"")); + _3dc.push_back(null_object); + while(true) + { + vector > dummy_3dc; + while(true) + { + if(elements==0) break; + system("cls"); + otom_phase27_1(sofaa,no_of_initializers); + object_display_in_phase_two27();mm(0); + cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + else if(choice1=="rep") break; + else if(choice1=="nex") + { + if(dummy_3dc.size()==0) { mm(23);continue; } + else + { + _3dc.push_back(null_object); break; + } + } + else + { + bool check=check_the_attribute_choice_range27(choice1); + if(check==false) { mm(21);continue; } + short int_checker=string_to_integer_converter(choice1); + if(int_checker<=0||int_checker>sofaa.size()) { mm(21);continue; } + check=check_availability_of_attribute27(int_checker); + if(check==false) { mm(22);continue; } + dummy_3dc.push_back(make_pair(get<1>(sofaa[int_checker-1]),get<3>(sofaa[int_checker-1]))); + get<0>(sofaa[int_checker-1])=true; + --elements; _3dc.pop_back(); _3dc.push_back(dummy_3dc); + } + } + if(elements==0) {state="state08";break; } + if(choice1=="min") break; + else if(choice1=="exe") break; + else if(choice1=="rep") { reset_three_dimensional_object27();break; } + } if(choice1=="min") break; - else if(choice1=="und") + else if(choice1=="exe") break; + } + + // phase 3 state 08 giving values to object + if(state=="state08") + { + system("cls"); header();jump_to_main(); object_display_in_phase_three308(); cin>>choice1; + if(choice1=="min" || choice1=="exe") break; + if(choice1=="con") { - //delete_all_containers16(); - state="state5";continue; + state="state8"; + for(short i=0;i<_3dc.size();i++) + { + vector vv; + for(short j=0;j<_3dc[i].size();j++) + { + vector vv2; vv.push_back(false); + short ch=_3dc[i][j].first; + switch(ch) + { + case 1: // INTEGER + { + vv2.push_back("~");vv2.push_back("~");vv2.push_back("~"); break; + } + case 2: // REAL + { + vv2.push_back("~");vv2.push_back("~");vv2.push_back("~"); break; + } + case 3: // ARRAY + { + vv2.push_back("~");vv2.push_back("~");vv2.push_back("~"); + vv2.push_back("~");vv2.push_back("~");vv2.push_back("~");vv2.push_back("~"); break; + } + case 4: // STRING + { + vv2.push_back("~");vv2.push_back("~");vv2.push_back("~");vv2.push_back("~");vv2.push_back("~"); break; + } + case 5: // MATRIX + { + vv2.push_back("~");vv2.push_back("~");vv2.push_back("~");vv2.push_back("~");vv2.push_back("~"); + vv2.push_back("~");vv2.push_back("~");vv2.push_back("~"); break; + } + case 6: // TREE + { + vv2.push_back("~"); break; + } + case 7: // GRAPH + { + vv2.push_back("~"); break; + } + case 8: // CUSTOM DATA TYPE + { + vv2.push_back("~");vv2.push_back("~"); break; + } + default: // INITIALIZERS + { + vv2.push_back("~");vv2.push_back("~"); + } + } + s2_3dc.push_back(vv2); + } + s_3dc.push_back(vv); + } + continue; } - else if(choice1=="exe") { break; } - state="state07"; + if(choice1=="rep") { state="state7"; reset_three_dimensional_object27(); } + else { printf("\nEnter a valid choice, now press ");sbc(dr);printf("ENTER");sbc(bb);printf(" to continue");getch(); } } + // state 8 + if(state=="state8") // DEFINE FOLLOWING VALUES OF ATTRIBUTES + { + system("cls"); header();jump_to_main(); object_display_in_phase_three38(); + printf("\n\nDEFINE FOLLOWING VALUES OF ATTRIBUTES\n\n"); + short start=0; + for(short i=0;i<_3dc.size();i++) + { int tr=0; + for(short j=0;j<_3dc[i].size();j++) + { + if(s_3dc[i][j]==true) + { + cout<<(++start)<<". ";printf(" Attribute values saved for "); + if(_3dc[i][j].first<0) { sfc(ly);cout<<_3dc[i][j].second<<" \n";sfc(ww); } + else { sfc(lg);cout<<_3dc[i][j].second<<" \n";sfc(ww); } + if((i==_3dc.size()-1)&&(j==_3dc[i].size()-1)) { state="state9"; break; } + continue; + } + short ch=_3dc[i][j].first;printf("\n\n\n"); + switch(ch) + { + case 1: // INTEGER CLASS + { + cout<<" "<<(++start)<<". "; + sfc(lg);cout<<_3dc[i][j].second;sfc(lc);cout<<" [CLASS INTEGER]";sfc(ww); + string integer_choice; + if(s2_3dc[start-1][0]=="~") + { + mm(24); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3" || choice1=="4" || choice1=="5" || choice1=="6" || choice1=="7" || choice1=="8") + { + integer_choice=choice1; + s2_3dc[start-1][0]=integer_choice; + short store=string_to_integer_converter(choice1); + dummy_o3dc.push_back(make_pair(1,"int")); + dummy_o3dc.push_back(make_pair(store,integer_choice)); break; + } + mm(36); getch(); break; + } + else { integer_choice=s2_3dc[start-1][0]; } + if(integer_choice=="1") + { + printf("\n\n Enter following details for");sfc(lm);printf(" [RANDOM NUMBER] ");sfc(ww); + if(s2_3dc[start-1][1]=="~") + { + mm(25); string min_value; cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); min_value=choice1; + s2_3dc[start-1][1]=min_value; + dummy_o3dc.push_back(make_pair(store,min_value)); break; + } + if(s2_3dc[start-1][2]=="~") + { + mm(26); string max_value; cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=string_to_integer_converter(s2_3dc[start-1][1]); + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + min_value=choice1; s2_3dc[start-1][1]=min_value; + dummy_o3dc.push_back(make_pair(store,min_value)); break; + } + if(s2_3dc[start-1][2]=="~") + { + mm(26); string max_value; cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=string_to_integer_converter(s2_3dc[start-1][1]); + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + min_value=choice1; s2_3dc[start-1][1]=min_value; + dummy_o3dc.push_back(make_pair(store,min_value)); break; + } + if(s2_3dc[start-1][2]=="~") + { + mm(26); string max_value; cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=string_to_integer_converter(s2_3dc[start-1][1]); + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<2 || store>10000000) { mm(37); getch();break; } + min_value=choice1; s2_3dc[start-1][1]=min_value; + dummy_o3dc.push_back(make_pair(store,min_value)); break; + } + if(s2_3dc[start-1][2]=="~") + { + mm(28); string max_value; cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=string_to_integer_converter(s2_3dc[start-1][1]); + if(store1<2 || store1>10000000) { mm(37); getch();break; } + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000000000) { mm(37); getch();break; } + min_value=choice1; s2_3dc[start-1][1]=min_value; + dummy_o3dc.push_back(make_pair(store,min_value)); break; + } + if(s2_3dc[start-1][2]=="~") + { + mm(30);string max_value; cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=string_to_integer_converter(s2_3dc[start-1][1]); + if(store1<1 || store1>1000000000000) { mm(37); getch();break; } + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + starting_value=choice1; s2_3dc[start-1][1]=starting_value; + dummy_o3dc.push_back(make_pair(store,starting_value)); break; + } + if(s2_3dc[start-1][2]=="~") + { + mm(32);string increment_value; cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); increment_value=choice1; s2_3dc[start-1][2]=increment_value; + dummy_o3dc.push_back(make_pair(store,increment_value)); + dummy_o3dc.push_back(make_pair(0,"store")); + dummy2_o3dc.push_back(dummy_o3dc); + dummy_o3dc.clear(); s_3dc[i][j]=true; break; + } + } + else if(integer_choice=="7") + { + printf("\n\n Enter following details for");sfc(lm);printf(" [Nth FIBONACCI NUMBER] ");sfc(ww); + if(s2_3dc[start-1][1]=="~") + { + mm(33); string min_value; cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>93) { mm(37); getch();break; } + min_value=choice1; s2_3dc[start-1][1]=min_value; + dummy_o3dc.push_back(make_pair(store,min_value)); break; + } + if(s2_3dc[start-1][2]=="~") + { + mm(34); string max_value; cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=string_to_integer_converter(s2_3dc[start-1][1]); + if(store1<1 || store1>93) { mm(37); getch();break; } + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + min_value=choice1; s2_3dc[start-1][1]=min_value; + dummy_o3dc.push_back(make_pair(store,min_value)); break; + } + if(s2_3dc[start-1][2]=="~") + { + mm(26); string max_value; cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=string_to_integer_converter(s2_3dc[start-1][1]); + if(store1(store1-store2+1)) + { + cout<<"\n\n You wish to create "<>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<0 || store>100) { mm(37); getch();break; } + precision=choice1; s2_3dc[start-1][0]=precision; + dummy_o3dc.push_back(make_pair(2,"rel")); + dummy_o3dc.push_back(make_pair(store,precision)); break; + } + if(s2_3dc[start-1][1]=="~") + { + mm(25); string min_value; cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + min_value=choice1; s2_3dc[start-1][1]=min_value; + dummy_o3dc.push_back(make_pair(store,min_value)); break; + } + if(s2_3dc[start-1][2]=="~") + { + mm(26); string max_value; cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=string_to_integer_converter(s2_3dc[start-1][1]); + if(store1==store2) { mm(44); getch();break; }// ( Note -> Max_value-Min_value >=1 ) + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3") + { + short store=string_to_integer_converter(choice1); + dummy_o3dc.push_back(make_pair(store,choice1)); + dummy2_o3dc.push_back(dummy_o3dc); + dummy_o3dc.clear(); s_3dc[i][j]=true; break; + } + mm(36); getch(); break; + } + if(s2_3dc[start-1][0]=="print") // set print format in Array + { + mm(55); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2") + { + s2_3dc[start-1][0]="order"; + short store=string_to_integer_converter(choice1); + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + mm(36); getch(); break; + } + if(s2_3dc[start-1][0]=="printt") // set print format for default string in Array + { + mm(55); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2") + { + short store=string_to_integer_converter(choice1); + dummy_o3dc.push_back(make_pair(store,choice1)); + dummy2_o3dc.push_back(dummy_o3dc); + dummy_o3dc.clear(); s_3dc[i][j]=true; break; + } + mm(36); getch(); break; + } + if(s2_3dc[start-1][0]=="~") // set type of Array + { + mm(45); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3" || choice1=="4" || choice1=="5") + { + s2_3dc[start-1][0]=choice1; + short store=string_to_integer_converter(choice1); + dummy_o3dc.push_back(make_pair(3,"arr")); + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + mm(36); getch(); break; + } + if(s2_3dc[start-1][0]=="1") // set type of Array of Integer + { + if(s2_3dc[start-1][1]=="~") // type of integer + { + mm(35); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3" || choice1=="4" || choice1=="5" || choice1=="6" || choice1=="7") + { + s2_3dc[start-1][1]=choice1; + short store=string_to_integer_converter(choice1); + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + mm(36); getch(); break; + } + if(s2_3dc[start-1][1]=="1"&&s2_3dc[start-1][2]=="~") // min value for random number + { + printf("\n Enter following details for");sfc(lm);printf(" [RANDOM NUMBERS] ");sfc(ww); + mm(25); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); s2_3dc[start-1][2]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="2"&&s2_3dc[start-1][2]=="~") // min value for odd number + { + printf("\n Enter following details for");sfc(lm);printf(" [ODD NUMBERS] ");sfc(ww); + mm(25); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); s2_3dc[start-1][2]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="3"&&s2_3dc[start-1][2]=="~") // min value for even number + { + printf("\n Enter following details for");sfc(lm);printf(" [EVEN NUMBERS] ");sfc(ww); + mm(25); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); s2_3dc[start-1][2]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="4"&&s2_3dc[start-1][2]=="~") // min value for prime number + { + printf("\n Enter following details for");sfc(lm);printf(" [PRIME NUMBERS] ");sfc(ww); + mm(27); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<2 || store>10000000) { mm(37); getch();break; } + s2_3dc[start-1][2]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="5"&&s2_3dc[start-1][2]=="~") // min value for non prime number + { + printf("\n Enter following details for");sfc(lm);printf(" [Non Prime Numbers] ");sfc(ww); + mm(29); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000000000) { mm(37); getch();break; } + s2_3dc[start-1][2]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="6"&&s2_3dc[start-1][2]=="~") // starting value for incremented number + { + printf("\n Enter following details for");sfc(lm);printf(" [Incremented Numbers] ");sfc(ww); + mm(31); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + s2_3dc[start-1][2]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="7"&&s2_3dc[start-1][2]=="~") // min value for Nth Fibonacci number + { + printf("\n Enter following details for");sfc(lm);printf(" [FIBONACCI NUMBERS] ");sfc(ww); + mm(33); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>93) { mm(37); getch();break; } + s2_3dc[start-1][2]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="1"&&s2_3dc[start-1][3]=="~") // max value for random number + { + printf("\n Enter following details for");sfc(lm);printf(" [RANDOM NUMBERS] ");sfc(ww); + mm(26); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); ll store2=dummy_o3dc[3].first; + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); ll store2=dummy_o3dc[3].first; + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); ll store2=dummy_o3dc[3].first; + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); ll store2=dummy_o3dc[3].first; + if(store1<2 || store1>10000000) { mm(37); getch();break; } + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); ll store2=dummy_o3dc[3].first; + if(store1<1 || store1>1000000000000) { mm(37); getch();break; } + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); s2_3dc[start-1][3]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="7"&&s2_3dc[start-1][3]=="~") // max value for Nth Fibonacci number + { + printf("\n Enter following details for");sfc(lm);printf(" [Nth FIBONACCI NUMBERS] ");sfc(ww); + mm(34); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); ll store2=dummy_o3dc[3].first; + if(store1<1 || store1>93) { mm(37); getch();break; } + if(store1(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][4]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + bool flag=false; + for(short itrr=0;itrr(si[itrr])==choice1) + { + flag=true; s2_3dc[start-1][4]=choice1; dummy_o3dc.push_back(make_pair(get<0>(si[itrr]),choice1)); s2_3dc[start-1][0]="print"; break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][4]=="~") // size of array + { + mm(56); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][4]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + s2_3dc[start-1][4]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); s2_3dc[start-1][0]="print"; break; + } + } + if(s2_3dc[start-1][0]=="2") // Array of Real + { + printf("\n Enter following details for");sfc(lm);printf(" [REAL NUMBERS] ");sfc(ww); + if(s2_3dc[start-1][1]=="~") // set precision + { + mm(43); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<0 || store>100) { mm(37); getch();break; } + s2_3dc[start-1][1]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][2]=="~") // set minimum value + { + mm(25); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + s2_3dc[start-1][2]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][3]=="~") // set maximum value + { + mm(26); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); ll store2=dummy_o3dc[3].first; + if(store1==store2) { mm(44); getch();break; }// ( Note -> Max_value-Min_value >=1 ) + if(store1(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][4]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + bool flag=false; + for(short itrr=0;itrr(si[itrr])==choice1) + { + flag=true; s2_3dc[start-1][4]=choice1; dummy_o3dc.push_back(make_pair(get<0>(si[itrr]),choice1)); s2_3dc[start-1][0]="print"; break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][4]=="~") // set size of Array + { + mm(56); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][4]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + s2_3dc[start-1][4]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); s2_3dc[start-1][0]="print"; break; + } + } + if(s2_3dc[start-1][0]=="3") // Array of String + { + if(s2_3dc[start-1][1]=="~") // type of string + { + mm(46); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2") + { + short store=string_to_integer_converter(choice1); s2_3dc[start-1][1]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + mm(36); getch(); break; + } + if(s2_3dc[start-1][1]=="1") // Default String + { + if(s2_3dc[start-1][2]=="~") // store the default String + { + mm(47); string def_string; cin>>def_string; s2_3dc[start-1][2]=def_string; + dummy_o3dc.push_back(make_pair(4,def_string)); break; + } + if(s2_3dc[start-1][4]=="~~") // set size of Array through initializer + { + printf("\n List of ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" available\n"); + for(short itrr=0;itrr(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][4]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + bool flag=false; + for(short itrr=0;itrr(si[itrr])==choice1) + { + flag=true; s2_3dc[start-1][4]=choice1; dummy_o3dc.push_back(make_pair(get<0>(si[itrr]),choice1)); s2_3dc[start-1][0]="printt"; break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][4]=="~") // set size of ARRAY + { + mm(56); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][4]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + s2_3dc[start-1][4]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); s2_3dc[start-1][0]="printt"; break; + } + } + else // Input String + { + if(s2_3dc[start-1][2]=="~") // store input string + { + mm(48); string in_string;cin>>in_string; s2_3dc[start-1][2]=in_string; + dummy_o3dc.push_back(make_pair(4,in_string)); break; + } + if(s2_3dc[start-1][3]=="~") // type of string + { + mm(49); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3" || choice1=="4") + { + short store=string_to_integer_converter(choice1); + s2_3dc[start-1][3]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + mm(36); getch(); break; + } + if(s2_3dc[start-1][5]=="~") // mode of string + { + mm(50); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2") + { + short store=string_to_integer_converter(choice1); s2_3dc[start-1][5]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + mm(36); getch(); break; + } + if(s2_3dc[start-1][6]=="~") // size of string + { + if(s2_3dc[start-1][5]=="1") // Repetition allowed in symbols + { + mm(51); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + s2_3dc[start-1][6]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + else // No repetition allowed in symbols + { + if(s2_3dc[start-1][3]=="4") // palindromic + { + mm(70);sfc(lm);cout<<(2*s2_3dc[start-1][2].size()); sfc(ww);printf(")\n\n SIZE -> "); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>(2*s2_3dc[start-1][2].size())) { mm(37); getch();break; } + s2_3dc[start-1][6]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + else // Ordinary + { + mm(70);sfc(lm);cout< "); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>s2_3dc[start-1][2].size()) + { mm(37); getch();break; } + s2_3dc[start-1][6]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + } + } + if(s2_3dc[start-1][4]=="~~") // size of array through initializer + { + printf("\n List of ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" available\n"); + for(short itrr=0;itrr(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][4]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + bool flag=false; + for(short itrr=0;itrr(si[itrr])==choice1) + { + flag=true; s2_3dc[start-1][4]=choice1; dummy_o3dc.push_back(make_pair(get<0>(si[itrr]),choice1)); s2_3dc[start-1][0]="print"; break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][4]=="~") // size of array + { + mm(56); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][4]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + s2_3dc[start-1][4]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); s2_3dc[start-1][0]="print"; break; + } + } + } + if(s2_3dc[start-1][0]=="4") // prepare for Permutations + { + dummy_o3dc.push_back(make_pair(1,"~")); // for storing permutation string (index 2) + dummy_o3dc.push_back(make_pair(1,"~")); // for storing Size of array (index 3) + dummy_o3dc.push_back(make_pair(1,"~")); // for storing print format of array (index 4) + dummy_o3dc.push_back(make_pair(1,"~")); // for storing order of array (index 5) + s2_3dc[start-1][0]="ready_for_permutation"; break; + } + if(s2_3dc[start-1][0]=="ready_for_permutation") // Array of Permutation + { + printf("\n Enter following details for");sfc(lm);printf(" [PERMUTATIONS] ");sfc(ww); + if(s2_3dc[start-1][4]=="~~") // set size of Array through initializer + { + printf("\n List of ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" available\n"); + for(short itrr=0;itrr(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][4]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + bool flag=false; + for(short itrr=0;itrr(si[itrr])==choice1) + { + flag=true; s2_3dc[start-1][4]=choice1; + dummy_o3dc[3].first=get<0>(si[itrr]); dummy_o3dc[3].second=choice1; break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][4]=="~") // set size of Array + { + mm(56); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][4]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + s2_3dc[start-1][4]=choice1; + dummy_o3dc[3].first=store;dummy_o3dc[3].second=choice1; break; + } + if(dummy_o3dc[2].second=="~") // store string for permutation + { + mm(68); string in_string; cin>>in_string; + if(in_string.size()>19) { mm(37); getch();break; } + ll store1=count_no_of_permutations(in_string); + if(dummy_o3dc[3].first<0) + { + short indexx=abs(dummy_o3dc[3].first)-1; + ll store2=get<2>(si[indexx]); + if(store1(si[indexx]);sfc(ww);printf(" Range -> [ ");cout<(si[indexx])<<" - "<(si[indexx])<<" ]"; cout<<"\n\n So you are advised to change your string which have at least "<>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2") + { + short store=string_to_integer_converter(choice1); + dummy_o3dc[4].first=store; dummy_o3dc[4].second=choice1; break; + } + mm(36); getch(); break; + } + if(dummy_o3dc[5].second=="~") // store order of array + { + mm(54); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3") + { + short store=string_to_integer_converter(choice1); + dummy_o3dc[5].first=store; dummy_o3dc[5].second=choice1; + dummy2_o3dc.push_back(dummy_o3dc); + dummy_o3dc.clear(); s_3dc[i][j]=true; break; + } + mm(36); getch(); break; + } + } + if(s2_3dc[start-1][0]=="5") // prepare for unique number + { + dummy_o3dc.push_back(make_pair(1,"~")); // for storing minimum value (index 2) + dummy_o3dc.push_back(make_pair(1,"~")); // for storing maximum value (index 3) + dummy_o3dc.push_back(make_pair(1,"~")); // for storing size of array (index 4) + dummy_o3dc.push_back(make_pair(1,"~")); // for storing print format (index 5) + dummy_o3dc.push_back(make_pair(1,"~")); // for storing order (index 6) + s2_3dc[start-1][0]="ready_for_unique"; break; + } + if(s2_3dc[start-1][0]=="ready_for_unique") // Array of Unique Numbers + { + printf("\n Enter following details for");sfc(lm);printf(" [UNIQUE NUMBERS] ");sfc(ww); + if(s2_3dc[start-1][4]=="~~") // set size of Array through initializer + { + printf("\n List of ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" available\n"); + for(short itrr=0;itrr(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][4]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + bool flag=false; + for(short itrr=0;itrr(si[itrr])==choice1) + { + flag=true; s2_3dc[start-1][4]=choice1; + dummy_o3dc[4].first=get<0>(si[itrr]); dummy_o3dc[4].second=choice1; break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][4]=="~") // set size of Array + { + mm(56); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][4]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + s2_3dc[start-1][4]=choice1; + dummy_o3dc[4].first=store;dummy_o3dc[4].second=choice1; break; + } + if(dummy_o3dc[2].second=="~") // set minimum value + { + mm(25); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + dummy_o3dc[2].first=store;dummy_o3dc[2].second=choice1; break; + } + if(dummy_o3dc[3].second=="~") // set maximum value + { + mm(26); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=dummy_o3dc[2].first; + if(store1(si[indexx]); + if(maxi>(store1-store2+1)) + { + cout<<"\n\n You wish to create "<(si[indexx]);sfc(ww);printf(" Range -> [ ");cout<(si[indexx])<<" - "<(si[indexx])<<" ]"; + cout<<"\n However, only "<<(store1-store2+1)<<" Unique No. exists in range provided by you."; + printf("\n\n You are advised to enlarge your range"); + printf("\n\n press ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to change Maximum value"); getch();break; + } + } + else + { + if(dummy_o3dc[4].first>(store1-store2+1)) + { + cout<<"\n\n You wish to create "<>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2") + { + short store=string_to_integer_converter(choice1); + dummy_o3dc[5].first=store; dummy_o3dc[5].second=choice1; break; + } + mm(36); getch(); break; + } + if(dummy_o3dc[6].second=="~") // set order + { + mm(54); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3") + { + short store=string_to_integer_converter(choice1); + dummy_o3dc[6].first=store; dummy_o3dc[6].second=choice1; + dummy2_o3dc.push_back(dummy_o3dc); + dummy_o3dc.clear(); s_3dc[i][j]=true; break; + } + mm(36); getch(); break; + } + } + } - if(state=="state07") + case 4: // STRING CLASS + { + cout<<" "<<(++start)<<". "; + sfc(lg);cout<<_3dc[i][j].second;sfc(lc);cout<<" [CLASS STRING]";sfc(ww); + string type_of_string; + if(s2_3dc[start-1][0]=="~") + { + mm(46);cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2") + { + type_of_string=choice1; + short store=string_to_integer_converter(choice1); s2_3dc[start-1][0]=type_of_string; + dummy_o3dc.push_back(make_pair(4,"str")); + dummy_o3dc.push_back(make_pair(store,type_of_string)); break; + } + mm(36); getch(); break; + } + type_of_string=s2_3dc[start-1][0]; + if(type_of_string=="1") + { + mm(47); string def_string; cin>>def_string; s2_3dc[start-1][1]=def_string; + dummy_o3dc.push_back(make_pair(4,def_string)); + dummy2_o3dc.push_back(dummy_o3dc); + dummy_o3dc.clear(); s_3dc[i][j]=true; break; + } + if(type_of_string=="2") + { + string in_string; + if(s2_3dc[start-1][1]=="~") + { + mm(48); cin>>in_string; s2_3dc[start-1][1]=in_string; + dummy_o3dc.push_back(make_pair(4,in_string)); break; + } + in_string=s2_3dc[start-1][1]; string input_string_type; + if(s2_3dc[start-1][2]=="~") + { + string input_string_type; mm(49); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3" || choice1=="4") + { + input_string_type=choice1; short store=string_to_integer_converter(choice1); + s2_3dc[start-1][2]=input_string_type; + dummy_o3dc.push_back(make_pair(store,input_string_type)); break; + } + mm(36); getch(); break; + } + input_string_type=s2_3dc[start-1][2]; string input_string_mode; + if(s2_3dc[start-1][3]=="~") + { + mm(50); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2") + { + input_string_mode=choice1; short store=string_to_integer_converter(choice1); s2_3dc[start-1][3]=input_string_mode; + dummy_o3dc.push_back(make_pair(store,input_string_mode)); break; + } + mm(36); getch(); break; + } + input_string_mode=s2_3dc[start-1][3]; + string input_string_size; + if(s2_3dc[start-1][4]=="~") + { + if(s2_3dc[start-1][3]=="1") // Repetition allowed in symbols + { + mm(51); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + input_string_size=choice1; s2_3dc[start-1][4]=input_string_size; + dummy_o3dc.push_back(make_pair(store,input_string_size)); + dummy2_o3dc.push_back(dummy_o3dc); + dummy_o3dc.clear(); s_3dc[i][j]=true; break; + } + else // No repetition allowed in symbols + { + if(s2_3dc[start-1][2]=="4") // palindromic + { + mm(70);sfc(lm);cout<<(2*s2_3dc[start-1][1].size());sfc(ww); printf(")\n\n SIZE -> "); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>(2*s2_3dc[start-1][1].size())) { mm(37); getch();break; } + input_string_size=choice1; s2_3dc[start-1][4]=input_string_size; + dummy_o3dc.push_back(make_pair(store,input_string_size)); + dummy2_o3dc.push_back(dummy_o3dc); + dummy_o3dc.clear(); s_3dc[i][j]=true; break; + } + else // Ordinary + { + mm(70);sfc(lm);cout< "); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>s2_3dc[start-1][1].size()) { mm(37); getch();break; } + input_string_size=choice1; s2_3dc[start-1][4]=input_string_size; + dummy_o3dc.push_back(make_pair(store,input_string_size)); + dummy2_o3dc.push_back(dummy_o3dc); + dummy_o3dc.clear(); s_3dc[i][j]=true; break; + } + } + } + } + break; + } + + case 5: // MATRIX CLASS + { + cout<<" "<<(++start)<<". "; + sfc(lg);cout<<_3dc[i][j].second;sfc(lc);cout<<" [CLASS MATRIX]";sfc(ww); + if(s2_3dc[start-1][0]=="order2") // set order2 in Matrix + { + mm(63); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3") + { + short store=string_to_integer_converter(choice1); + dummy_o3dc.push_back(make_pair(store,choice1)); + dummy2_o3dc.push_back(dummy_o3dc); + dummy_o3dc.clear(); s_3dc[i][j]=true; break; + } + mm(36); getch(); break; + } + if(s2_3dc[start-1][0]=="order1") // set order in Matrix + { + mm(64); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3") + { + short store=string_to_integer_converter(choice1); + dummy_o3dc.push_back(make_pair(store,choice1)); + s2_3dc[start-1][0]="order2"; break; + } + mm(36); getch(); break; + } + if(s2_3dc[start-1][0]=="~") // set type of Matrix + { + mm(60); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3" || choice1=="4" || choice1=="5") + { + s2_3dc[start-1][0]=choice1; + short store=string_to_integer_converter(choice1); + dummy_o3dc.push_back(make_pair(5,"mat")); + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + mm(36); getch(); break; + } + if(s2_3dc[start-1][0]=="1") // matrix of Integer + { + if(s2_3dc[start-1][1]=="~") // type of integer + { + mm(35);cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3" || choice1=="4" || choice1=="5" || choice1=="6" || choice1=="7") + { + s2_3dc[start-1][1]=choice1; + short store=string_to_integer_converter(choice1); + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + mm(36); getch(); break; + } + if(s2_3dc[start-1][1]=="1"&&s2_3dc[start-1][2]=="~") // min value for random number + { + printf("\n Enter following details for");sfc(lm);printf(" [RANDOM NUMBERS] ");sfc(ww); + mm(25); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); s2_3dc[start-1][2]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="2"&&s2_3dc[start-1][2]=="~") // min value for odd number + { + printf("\n Enter following details for");sfc(lm);printf(" [ODD NUMBERS] ");sfc(ww); + mm(25); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); s2_3dc[start-1][2]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="3"&&s2_3dc[start-1][2]=="~") // min value for even number + { + printf("\n Enter following details for");sfc(lm);printf(" [EVEN NUMBERS] ");sfc(ww); + mm(25); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); s2_3dc[start-1][2]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="4"&&s2_3dc[start-1][2]=="~") // min value for prime number + { + printf("\n Enter following details for");sfc(lm);printf(" [PRIME NUMBERS] ");sfc(ww); + mm(27); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<2 || store>10000000) { mm(37); getch();break; } + s2_3dc[start-1][2]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="5"&&s2_3dc[start-1][2]=="~") // min value for non prime number + { + printf("\n Enter following details for");sfc(lm);printf(" [Non Prime Numbers] ");sfc(ww); + mm(29); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000000000) { mm(37); getch();break; } + s2_3dc[start-1][2]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="6"&&s2_3dc[start-1][2]=="~") // starting value for incremented number + { + printf("\n Enter following details for");sfc(lm);printf(" [Incremented Numbers] ");sfc(ww); + mm(31); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + s2_3dc[start-1][2]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="7"&&s2_3dc[start-1][2]=="~") // min value for Nth Fibonacci number + { + printf("\n Enter following details for");sfc(lm);printf(" [FIBONACCI NUMBERS] ");sfc(ww); + mm(33); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>93) { mm(37); getch();break; } + s2_3dc[start-1][2]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="1"&&s2_3dc[start-1][3]=="~") // max value for random number + { + printf("\n Enter following details for");sfc(lm);printf(" [RANDOM NUMBERS] ");sfc(ww); + mm(26); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); ll store2=dummy_o3dc[3].first; + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); ll store2=dummy_o3dc[3].first; + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); ll store2=dummy_o3dc[3].first; + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); ll store2=dummy_o3dc[3].first; + if(store1<2 || store1>10000000) { mm(37); getch();break; } + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); ll store2=dummy_o3dc[3].first; + if(store1<1 || store1>1000000000000) { mm(37); getch();break; } + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); s2_3dc[start-1][3]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="7"&&s2_3dc[start-1][3]=="~") // max value for Nth Fibonacci number + { + printf("\n Enter following details for");sfc(lm);printf(" [Nth FIBONACCI NUMBERS] ");sfc(ww); + mm(34); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); ll store2=dummy_o3dc[3].first; + if(store1<1 || store1>93) { mm(37); getch();break; } + if(store1(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][4]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + bool flag=false; + for(short itrr=0;itrr(si[itrr])==choice1) + { + fi=get<2>(si[itrr]); flag=true; s2_3dc[start-1][4]=choice1; dummy_o3dc.push_back(make_pair(get<0>(si[itrr]),choice1)); break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][4]=="~") // Rows in Matrix + { + mm(61); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][4]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + s2_3dc[start-1][4]=choice1; fi=store; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][5]=="~~") // Columns in Matrix through initializer + { + printf("\n List of ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" available\n"); + for(short itrr=0;itrr(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][5]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + short flag=0; + for(short itrr=0;itrr(si[itrr])==choice1) + { + ll range=fi*get<2>(si[itrr]); + if(range>1000000) { mm(65);sfc(lr);cout<(si[itrr]),choice1));s2_3dc[start-1][0]="order1"; break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][5]=="~") // Columns in Matrix + { + mm(62);cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][5]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + ll range=fi*store; + if(range>1000000) { mm(65);sfc(lr);cout<>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<0 || store>100) { mm(37); getch();break; } + s2_3dc[start-1][1]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][2]=="~") // set minimum value + { + mm(25); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + s2_3dc[start-1][2]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][3]=="~") // set maximum value + { + mm(26); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); ll store2=dummy_o3dc[3].first; + if(store1==store2) { mm(44); getch();break; }// ( Note -> Max_value-Min_value >=1 ) + if(store1(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][4]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + bool flag=false; + for(short itrr=0;itrr(si[itrr])==choice1) + { + fi=get<2>(si[itrr]); flag=true; s2_3dc[start-1][4]=choice1; dummy_o3dc.push_back(make_pair(get<0>(si[itrr]),choice1)); break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][4]=="~") // Rows in Matrix + { + mm(61); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][4]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + s2_3dc[start-1][4]=choice1; fi=store; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][5]=="~~") // Columns in Matrix through initializer + { + printf("\n List of ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" available\n"); + for(short itrr=0;itrr(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][5]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + short flag=0; + for(short itrr=0;itrr(si[itrr])==choice1) + { + ll range=fi*get<2>(si[itrr]); + if(range>1000000) { mm(65);sfc(lr);cout<(si[itrr]),choice1));s2_3dc[start-1][0]="order1"; break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][5]=="~") // Columns in Matrix + { + mm(62);cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][5]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + ll range=fi*store; + if(range>1000000) { mm(65);sfc(lr);cout<>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2") + { + short store=string_to_integer_converter(choice1); s2_3dc[start-1][1]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + mm(36); getch(); break; + } + if(s2_3dc[start-1][1]=="1") // Default String + { + if(s2_3dc[start-1][2]=="~") // store the default String + { + mm(47); string def_string; cin>>def_string; s2_3dc[start-1][2]=def_string; + dummy_o3dc.push_back(make_pair(4,def_string)); break; + } + if(s2_3dc[start-1][4]=="~~") // Rows in Matrix through initializer + { + printf("\n List of ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" available\n"); + for(short itrr=0;itrr(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][4]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + bool flag=false; + for(short itrr=0;itrr(si[itrr])==choice1) + { + fi=get<2>(si[itrr]); flag=true; s2_3dc[start-1][4]=choice1; dummy_o3dc.push_back(make_pair(get<0>(si[itrr]),choice1)); break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][4]=="~") // Rows in Matrix + { + mm(61); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][4]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + s2_3dc[start-1][4]=choice1; fi=store; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][5]=="~~") // Columns in Matrix through initializer + { + printf("\n List of ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" available\n"); + for(short itrr=0;itrr(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][5]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + short flag=0; + for(short itrr=0;itrr(si[itrr])==choice1) + { + ll range=fi*get<2>(si[itrr]); + if(range>1000000) { mm(65);sfc(lr);cout<(si[itrr]),choice1)); + dummy2_o3dc.push_back(dummy_o3dc); dummy_o3dc.clear(); s_3dc[i][j]=true; break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][5]=="~") // Columns in Matrix + { + mm(62); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][5]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + ll range=fi*store; + if(range>1000000) { mm(65);sfc(lr);cout<>in_string; s2_3dc[start-1][2]=in_string; + dummy_o3dc.push_back(make_pair(4,in_string)); break; + } + if(s2_3dc[start-1][3]=="~") // type of string + { + mm(49); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3" || choice1=="4") + { + short store=string_to_integer_converter(choice1); + s2_3dc[start-1][3]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + mm(36); getch(); break; + } + + if(s2_3dc[start-1][7]=="~") // mode of string + { + mm(50); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2") + { + short store=string_to_integer_converter(choice1); s2_3dc[start-1][7]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + mm(36); getch(); break; + } + if(s2_3dc[start-1][6]=="~") // size of string + { + if(s2_3dc[start-1][7]=="1") // Repetition allowed in symbols + { + mm(51);cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + s2_3dc[start-1][6]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + else // No repetition allowed in symbols + { + if(s2_3dc[start-1][3]=="4") // palindromic + { + mm(70);sfc(lm);cout<<(2*s2_3dc[start-1][2].size()); sfc(ww);printf(")\n\n SIZE -> "); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>(2*s2_3dc[start-1][2].size())) { mm(37); getch();break; } + s2_3dc[start-1][6]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + else // Ordinary + { + mm(70);sfc(lm);cout< "); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>s2_3dc[start-1][2].size()) { mm(37); getch();break; } + s2_3dc[start-1][6]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + } + } + if(s2_3dc[start-1][4]=="~~") // Rows in Matrix through initializer + { + printf("\n List of ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" available\n"); + for(short itrr=0;itrr(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][4]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + bool flag=false; + for(short itrr=0;itrr(si[itrr])==choice1) + { + fi=get<2>(si[itrr]); flag=true; s2_3dc[start-1][4]=choice1; dummy_o3dc.push_back(make_pair(get<0>(si[itrr]),choice1)); break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][4]=="~") // Rows in Matrix + { + mm(61); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][4]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + s2_3dc[start-1][4]=choice1; fi=store; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][5]=="~~") // Columns in Matrix through initializer + { + printf("\n List of ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" available\n"); + for(short itrr=0;itrr(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][5]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + short flag=0; + for(short itrr=0;itrr(si[itrr])==choice1) + { + ll range=fi*get<2>(si[itrr]); + if(range>1000000) { mm(65);sfc(lr);cout<(si[itrr]),choice1));s2_3dc[start-1][0]="order1"; break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][5]=="~") // Columns in Matrix + { + mm(62); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][5]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + ll range=fi*store; + if(range>1000000) { mm(65);sfc(lr);cout<(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][4]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + bool flag=false; + for(short itrr=0;itrr(si[itrr])==choice1) + { + fi=get<2>(si[itrr]); flag=true; s2_3dc[start-1][4]=choice1; dummy_o3dc[3].first=get<0>(si[itrr]);dummy_o3dc[3].second=choice1; break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][4]=="~") // Rows in Matrix + { + mm(61); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][4]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + s2_3dc[start-1][4]=choice1; fi=store; + dummy_o3dc[3].first=store;dummy_o3dc[3].second=choice1; break; + } + if(s2_3dc[start-1][5]=="~~") // Columns in Matrix through initializer + { + printf("\n List of ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" available\n"); + for(short itrr=0;itrr(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][5]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + short flag=0; + for(short itrr=0;itrr(si[itrr])==choice1) + { + ll range=fi*get<2>(si[itrr]); + if(range>1000000) { mm(65);sfc(lr);cout<(si[itrr]);dummy_o3dc[4].second=choice1; break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][5]=="~") // Columns in Matrix + { + mm(62); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][5]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + ll range=fi*store; + if(range>1000000) { mm(65);sfc(lr);cout<>in_string; + if(in_string.size()>19) { mm(37); getch();break; } + ll store1=count_no_of_permutations(in_string); + if(store1(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][4]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + bool flag=false; + for(short itrr=0;itrr(si[itrr])==choice1) + { + fi=get<2>(si[itrr]); flag=true; s2_3dc[start-1][4]=choice1; dummy_o3dc[4].first=get<0>(si[itrr]);dummy_o3dc[4].second=choice1; break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][4]=="~") // Rows in Matrix + { + mm(61); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][4]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + s2_3dc[start-1][4]=choice1; fi=store; + dummy_o3dc[4].first=store;dummy_o3dc[4].second=choice1; break; + } + if(s2_3dc[start-1][5]=="~~") // Columns in Matrix through initializer + { + printf("\n List of ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" available\n"); + for(short itrr=0;itrr(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][5]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + short flag=0; + for(short itrr=0;itrr(si[itrr])==choice1) + { + ll range=fi*get<2>(si[itrr]); + if(range>1000000) { mm(65);sfc(lr);cout<(si[itrr]);dummy_o3dc[5].second=choice1; break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][5]=="~") // Columns in Matrix + { + mm(62); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][5]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + ll range=fi*store; + if(range>1000000) { mm(65);sfc(lr);cout<>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + dummy_o3dc[2].first=store;dummy_o3dc[2].second=choice1; break; + } + if(dummy_o3dc[3].second=="~") // set maximum value + { + mm(26); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=dummy_o3dc[2].first; + if(store1(store1-store2+1)) + { + cout<<"\n\n You wish to create "<>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>20) { mm(37); getch();break; } + no_of_attribute_for_custom=store; s2_3dc[start-1][0]=choice1; + dummy_o3dc.push_back(make_pair(8,"cus")); + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + if(s2_3dc[start-1][1]=="~~") + { + printf("\n List of ");sfc(ly);printf("INITIALIZER");sfc(ww);printf(" available\n"); + for(short itrr=0;itrr(si[itrr]);sfc(ww); + cout<<" Range ["<(si[itrr])<<" - "<(si[itrr])<<"]"; + } + mm(57); cin>>choice1; + if(choice1=="cl") { s2_3dc[start-1][1]="~";break; } + else if(choice1=="min") break; + else if(choice1=="exe") break; + bool flag=false; + for(short itrr=0;itrr(si[itrr])==choice1) + { + flag=true; s2_3dc[start-1][1]=choice1; dummy_o3dc.push_back(make_pair(get<0>(si[itrr]),choice1)); break; + } + } + if(flag==false) { mm(58); getch();break; } + break; + } + if(s2_3dc[start-1][1]=="~") + { + mm(69); cin>>choice1; + if(choice1=="int") + { + if(si.size()==0) { mm(59); getch();break; } + else { s2_3dc[start-1][1]="~~"; break; } + } + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + s2_3dc[start-1][1]=choice1; + dummy_o3dc.push_back(make_pair(store,choice1)); break; + } + while(no_of_attribute_for_custom>0) + { + cout<<"\n\n Your structure -> ";vector > demo_custom; sfc(lm);cout<>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3" || choice1=="4" || choice1=="5" || choice1=="6") + { + if(choice1=="1") // attribute type -> Integer + { + custom_structure+="Integer"; + demo_custom.push_back(make_pair(1,"int")); // Integer (index 0) + demo_custom.push_back(make_pair(1,"~")); // type (index 1) + demo_custom.push_back(make_pair(1,"~")); // min_value (index 2) + demo_custom.push_back(make_pair(1,"~")); // max_value (index 3) + demo_custom.push_back(make_pair(1,"~")); // order (index 4) + dummy_o3dc.push_back(make_pair(++index_of_custom_data_type,"Integer")); + cdt.push_back(demo_custom); + } + else if(choice1=="2") // attribute type -> Real + { + custom_structure+="Real"; + demo_custom.push_back(make_pair(2,"rel")); // Real (index 0) + demo_custom.push_back(make_pair(2,"~")); // precision (index 1) + demo_custom.push_back(make_pair(2,"~")); // min_value (index 2) + demo_custom.push_back(make_pair(2,"~")); // max_value (index 3) + demo_custom.push_back(make_pair(2,"~")); // order (index 4) + dummy_o3dc.push_back(make_pair(++index_of_custom_data_type,"Real")); + cdt.push_back(demo_custom); + } + else if(choice1=="3") // attribute type -> String + { + custom_structure+="String"; + demo_custom.push_back(make_pair(3,"str")); // string (index 0) + demo_custom.push_back(make_pair(3,"~")); // type (index 1) + dummy_o3dc.push_back(make_pair(++index_of_custom_data_type,"String")); + cdt.push_back(demo_custom); + } + else if(choice1=="4") // attribute type -> Permutation + { + custom_structure+="Permutation"; + demo_custom.push_back(make_pair(4,"per")); // permutation (index 0) + demo_custom.push_back(make_pair(4,"~")); // string (index 1) + demo_custom.push_back(make_pair(4,"~")); // order (index 2) + dummy_o3dc.push_back(make_pair(++index_of_custom_data_type,"Permutation")); + cdt.push_back(demo_custom); + } + else if(choice1=="5") // attribute type -> Unique Number + { + custom_structure+="Unique_No"; + demo_custom.push_back(make_pair(5,"uni")); // Unique Number (index 0) + demo_custom.push_back(make_pair(5,"~")); // min_value (index 1) + demo_custom.push_back(make_pair(5,"~")); // max_value (index 2) + demo_custom.push_back(make_pair(5,"~")); // order (index 3) + dummy_o3dc.push_back(make_pair(++index_of_custom_data_type,"Unique_Number")); + cdt.push_back(demo_custom); + } + else if(choice1=="6") // attribute type -> Space + { + custom_structure+="_space_"; + demo_custom.push_back(make_pair(6,"spc")); // space + dummy_o3dc.push_back(make_pair(++index_of_custom_data_type,"Space")); + cdt.push_back(demo_custom); + } + --no_of_attribute_for_custom; + break; + } + mm(36); getch(); break; + } + if(no_of_attribute_for_custom==0) + { + no_of_attribute_for_custom=-1; dummy2_o3dc.push_back(dummy_o3dc); break; + } + if(no_of_attribute_for_custom==-1) + { + cout<<"\n\n Your structure -> "; sfc(lm);cout< Type of Integer + { + mm(35); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3" || choice1=="4" || choice1=="5" || choice1=="6" || choice1=="7") + { + short store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][itr2].first=store; + cdt[dummy_o3dc[itr].first][itr2].second=choice1; + break; + } + mm(36); getch(); break; + } + if(cdt[dummy_o3dc[itr].first][itr2].second=="~" && itr2==2) // case 2 -> Minimum value + { + if(cdt[dummy_o3dc[itr].first][itr2-1].first==1) // random integer + { + printf("\n Random Integer"); + mm(25); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][itr2].second=choice1; cdt[dummy_o3dc[itr].first][itr2].first=store; break; + } + if(cdt[dummy_o3dc[itr].first][itr2-1].first==2) // odd number + { + printf("\n Odd Integer"); + mm(25); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][itr2].second=choice1; cdt[dummy_o3dc[itr].first][itr2].first=store; break; + } + if(cdt[dummy_o3dc[itr].first][itr2-1].first==3) // even number + { + printf("\n Even Integer"); + mm(25); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][itr2].second=choice1; cdt[dummy_o3dc[itr].first][itr2].first=store; break; + } + if(cdt[dummy_o3dc[itr].first][itr2-1].first==4) // prime number + { + printf("\n Prime Number"); + mm(27); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<2 || store>10000000) { mm(37); getch();break; } + cdt[dummy_o3dc[itr].first][itr2].second=choice1; cdt[dummy_o3dc[itr].first][itr2].first=store; break; + } + if(cdt[dummy_o3dc[itr].first][itr2-1].first==5) // non prime number + { + printf("\n Non prime Number"); + mm(29); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000000000) { mm(37); getch();break; } + cdt[dummy_o3dc[itr].first][itr2].second=choice1; cdt[dummy_o3dc[itr].first][itr2].first=store; break; + } + if(cdt[dummy_o3dc[itr].first][itr2-1].first==6) // incremented number + { + printf("\n Incremented Number"); + mm(31); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][itr2].second=choice1; cdt[dummy_o3dc[itr].first][itr2].first=store; break; + } + if(cdt[dummy_o3dc[itr].first][itr2-1].first==7) // Nth fibonacci number + { + printf("\n Nth Fibonacci Number"); + mm(33); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>93) { mm(37); getch();break; } + cdt[dummy_o3dc[itr].first][itr2].second=choice1; cdt[dummy_o3dc[itr].first][itr2].first=store; break; + } + } + if(cdt[dummy_o3dc[itr].first][itr2].second=="~" && itr2==3) // case 3 -> maximum value + { + if(cdt[dummy_o3dc[itr].first][itr2-2].first==1) // random integer + { + printf("\n Random Number"); + mm(26); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=string_to_integer_converter(cdt[dummy_o3dc[itr].first][itr2-1].second); + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=string_to_integer_converter(cdt[dummy_o3dc[itr].first][itr2-1].second); + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=string_to_integer_converter(cdt[dummy_o3dc[itr].first][itr2-1].second); + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=string_to_integer_converter(cdt[dummy_o3dc[itr].first][itr2-1].second); + if(store1<2 || store1>10000000) { mm(37); getch();break; } + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=string_to_integer_converter(cdt[dummy_o3dc[itr].first][itr2-1].second); + if(store1<1 || store1>1000000000000) { mm(37); getch();break; } + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][itr2].second=choice1; cdt[dummy_o3dc[itr].first][itr2].first=store; break; + } + if(cdt[dummy_o3dc[itr].first][itr2-2].first==7) // Nth fibonacci number + { + printf("\n Nth Fibonacci Number"); + mm(34); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=string_to_integer_converter(cdt[dummy_o3dc[itr].first][itr2-1].second); + if(store1<1 || store1>93) { mm(37); getch();break; } + if(store1 order + { + mm(53); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3") + { + ll store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][itr2].first=store; + cdt[dummy_o3dc[itr].first][itr2].second=choice1; + dummy_o3dc[itr].first=-1; break; + } + mm(36); getch(); break; + } + } + } + if(dummy_o3dc[itr].second=="Real") + { + printf("\n\n Class [REAL] \n\n"); + for(short itr2=1;itr2<=4;itr2++) + { + if(cdt[dummy_o3dc[itr].first][itr2].second=="~" && itr2==1) + { + mm(43); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<0 || store>100) { mm(37); getch();break; } + cdt[dummy_o3dc[itr].first][itr2].second=choice1; cdt[dummy_o3dc[itr].first][itr2].first=store; break; + } + if(cdt[dummy_o3dc[itr].first][itr2].second=="~" && itr2==2) + { + mm(25); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][itr2].second=choice1; cdt[dummy_o3dc[itr].first][itr2].first=store; break; + } + if(cdt[dummy_o3dc[itr].first][itr2].second=="~" && itr2==3) + { + mm(26); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=cdt[dummy_o3dc[itr].first][itr2-1].first; + if(store1==store2) { mm(44); getch();break; }// ( Note -> Max_value-Min_value >=1 ) + if(store1>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3") + { + ll store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][itr2].first=store; + cdt[dummy_o3dc[itr].first][itr2].second=choice1; + dummy_o3dc[itr].first=-1; + break; + } + mm(36); getch(); break; + } + } + } + if(dummy_o3dc[itr].second=="String") + { + printf("\n\n [CLASS STRING]"); + if(cdt[dummy_o3dc[itr].first][1].second=="~") + { + mm(46); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1") // default string + { + short store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][1].second=choice1; cdt[dummy_o3dc[itr].first][1].first=store; + cdt[dummy_o3dc[itr].first].push_back(make_pair(1,"~")); // default_string + break; + } + if(choice1=="2") // Computer_generated string + { + short store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][1].second=choice1; cdt[dummy_o3dc[itr].first][1].first=store; + cdt[dummy_o3dc[itr].first].push_back(make_pair(2,"~")); // input_string (index 2) + cdt[dummy_o3dc[itr].first].push_back(make_pair(2,"~")); // type (index 3) + cdt[dummy_o3dc[itr].first].push_back(make_pair(2,"~")); // mode (index 4) + cdt[dummy_o3dc[itr].first].push_back(make_pair(2,"~")); // size (index 5) + cdt[dummy_o3dc[itr].first].push_back(make_pair(2,"~")); // order (index 6) + break; + } + mm(36); getch(); break; + } + if(cdt[dummy_o3dc[itr].first][1].first==1) // default string + { + mm(47); string def_string; cin>>def_string; + cdt[dummy_o3dc[itr].first][2].second=def_string; + dummy_o3dc[itr].first=-1; break; + } + if(cdt[dummy_o3dc[itr].first][1].first==2) // input string + { + if(cdt[dummy_o3dc[itr].first][2].second=="~") // input_string + { + mm(48);string in_string; cin>>in_string; + cdt[dummy_o3dc[itr].first][2].second=in_string; break; + } + if(cdt[dummy_o3dc[itr].first][3].second=="~") // string type + { + mm(49); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3" || choice1=="4") + { + short store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][3].second=choice1; cdt[dummy_o3dc[itr].first][3].first=store; break; + } + mm(36); getch(); break; + } + if(cdt[dummy_o3dc[itr].first][4].second=="~") // string mode + { + mm(50); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2") + { + short store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][4].second=choice1; cdt[dummy_o3dc[itr].first][4].first=store; break; + } + mm(36); getch(); break; + } + if(cdt[dummy_o3dc[itr].first][5].second=="~") // string size + { + if(cdt[dummy_o3dc[itr].first][4].second=="1") // Repetition allowed in symbols + { + mm(51); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) { mm(37); getch();break; } + cdt[dummy_o3dc[itr].first][5].second=choice1; cdt[dummy_o3dc[itr].first][5].first=store; break; + } + else // No repetition allowed in symbols + { + if(cdt[dummy_o3dc[itr].first][3].second=="4") // palindromic + { + mm(70);sfc(lm);cout<<(2*cdt[dummy_o3dc[itr].first][2].second.size());sfc(ww); printf(")\n\n SIZE -> "); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>(2*cdt[dummy_o3dc[itr].first][2].second.size())) { mm(37); getch();break; } + cdt[dummy_o3dc[itr].first][5].second=choice1; cdt[dummy_o3dc[itr].first][5].first=store; break; + } + else // Ordinary + { + mm(70);sfc(lm);cout< "); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>cdt[dummy_o3dc[itr].first][2].second.size()) { mm(37); getch();break; } + cdt[dummy_o3dc[itr].first][5].second=choice1; cdt[dummy_o3dc[itr].first][5].first=store; break; + } + } + } + if(cdt[dummy_o3dc[itr].first][6].second=="~") // string order + { + mm(53); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3") + { + ll store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][6].second=choice1; cdt[dummy_o3dc[itr].first][6].first=store; + dummy_o3dc[itr].first=-1; break; + } + mm(36); getch(); break; + } + } + } + if(dummy_o3dc[itr].second=="Permutation") + { + printf("\n\n CLASS [PERMUTATION]"); + if(cdt[dummy_o3dc[itr].first][1].second=="~") // store string to generate permutation + { + mm(68); string in_string; cin>>in_string; + if(in_string.size()>19) { mm(37); getch();break; } + ll store1=count_no_of_permutations(in_string); + if(dummy_o3dc[2].first<0) + { + short indexx=abs(dummy_o3dc[2].first)-1; + ll store2=get<2>(si[indexx]); + if(store1(si[indexx]);sfc(ww);printf(" Range -> [ ");cout<(si[indexx])<<" - "<(si[indexx])<<" ]"; + cout<<"\n\n So you are advised to change your string which have at least "<>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3") + { + ll store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][2].second=choice1; cdt[dummy_o3dc[itr].first][2].first=store; + dummy_o3dc[itr].first=-1; break; + } + mm(36); getch(); break; + } + } + if(dummy_o3dc[itr].second=="Unique_Number") + { + printf("\n\n CLASS [UNIQUE-RANDOM NUMBER]"); + if(cdt[dummy_o3dc[itr].first][1].second=="~") + { + mm(25); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][1].second=choice1; cdt[dummy_o3dc[itr].first][1].first=store; break; + } + if(cdt[dummy_o3dc[itr].first][2].second=="~") + { + mm(26); cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=cdt[dummy_o3dc[itr].first][1].first; + if(store1(si[indexx]); + if(maxi>(store1-store2+1)) + { + cout<<"\n\n You wish to create "<(si[indexx]);sfc(ww);printf(" Range -> [ ");cout<(si[indexx])<<" - "<(si[indexx])<<" ]"; + cout<<"\n However, only "<<(store1-store2+1)<<" Unique No. exists in range provided by you."; + printf("\n\n You are advised to enlarge your range"); + printf("\n\n press ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to change Maximum value"); getch();break; + } + } + else + { + if(dummy_o3dc[2].first>(store1-store2+1)) + { + cout<<"\n\n You wish to create "<>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + if(choice1=="1" || choice1=="2" || choice1=="3") + { + ll store=string_to_integer_converter(choice1); + cdt[dummy_o3dc[itr].first][3].second=choice1; cdt[dummy_o3dc[itr].first][3].first=store; + dummy_o3dc[itr].first=-1; break; + } + mm(36); getch(); break; + } + } + if(dummy_o3dc[itr].second=="Space") + { + dummy_o3dc[itr].first=-1; break; + } + break; + } + if(no_of_attribute_for_custom==-2) + { + no_of_attribute_for_custom=1; custom_structure.clear(); dummy_o3dc.clear(); + s_3dc[i][j]=true; break; + } + } + break; + } + + default: // INITIALIZER CLASS + { + cout<<" "<<(++start)<<". "; + sfc(ly);cout<<_3dc[i][j].second;sfc(lc);cout<<" [CLASS INITIALIZER]";sfc(ww); + if(s2_3dc[start-1][0]=="~") + { + printf("\n\n Enter the ");sfc(ly);printf("Minimum");sfc(ww);printf(" value and then ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (1) to (10 to the power 6)"); + printf("\n\n Minimum value -> "); string min_value; cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store=string_to_integer_converter(choice1); + if(store<1 || store>1000000) + { mm(37); getch();break; } + min_value=choice1; + dummy_o3dc.push_back(make_pair(_3dc[i][j].first,"ini")); + dummy_o3dc.push_back(make_pair(store,min_value)); + s2_3dc[start-1][0]=min_value; break; + } + if(s2_3dc[start-1][1]=="~") + { + printf("\n\n Enter the ");sfc(ly);printf("Maximum");sfc(ww);printf(" value and then ");sbc(dr);printf(" ENTER ");sbc(bb); + printf("\n ");sfc(lr);printf(" Note: ");sfc(ww);printf("Range -> (1) to (10 to the power 6)"); + printf("\n\n Maximum value -> "); string max_value; cin>>choice1; + if(choice1=="min") break; + else if(choice1=="exe") break; + bool check=valid_pos_neg_integer(choice1); + if(check==false) { mm(37); getch();break; } + ll store1=string_to_integer_converter(choice1); + ll store2=string_to_integer_converter(s2_3dc[start-1][0]); + if(store1<1 || store1>1000000) { mm(37); getch();break; } + if(store1 prime=c1.get_prime(cube[index][i1][i2+2].first,cube[index][i1][i2+3].first,cube[index][i1][i2+4].first); + integers.push_back(prime); + cube[index][i1][i2+6].first=(integers.size()-1); + cube[index][i1][i2+5].first=-1; + i2+=6;break; + } + case 6: // Incremented Numbers + { + cube[index][i1][i2+4].first=cube[index][i1][i2+2].first;; + i2+=4; break; + } + case 7: // Nth Fibonacci Numbers + { + vector fibo=c1.get_fibonacci(cube[index][i1][i2+2].first,cube[index][i1][i2+3].first,cube[index][i1][i2+4].first); + integers.push_back(fibo); + cube[index][i1][i2+6].first=(integers.size()-1); + cube[index][i1][i2+5].first=-1; + i2+=6;break; + } + case 8: // Unique Numbers + { + vector uni=c1.get_all_random_numbers(cube[index][i1][i2+2].first,cube[index][i1][i2+3].first,cube[index][i1][i2+4].first); + integers.push_back(uni); + cube[index][i1][i2+6].first=(integers.size()-1); + cube[index][i1][i2+5].first=-1; + i2+=6;break; + } + default: // All others + { + i2+=3;break; + } + } + break; + } + case 2: // Real + { + i2+=3; break; + } + case 3: // Array + { + short inner_type=cube[index][i1][i2+1].first; + switch(inner_type) + { + case 1: { i2+=7;break; } // Array of Integer + case 2: { i2+=7;break; } // Array of Real + case 3: // Array of String + { + short inner_type2=cube[index][i1][i2+2].first; + switch(inner_type2) + { + case 1: { i2+=5;break; } // Array of default string + case 2: { i2+=9;break; } // Array of Input String (user defined) + } + break; + } + case 4: { i2+=5;break; } // Array of Permutation + case 5: { i2+=6;break; } // Array of Unique Numbers + } + break; + } + case 4: // String + { + short inner_type=cube[index][i1][i2+1].first; + switch(inner_type) + { + case 1: { i2+=2;break; } // Default String + case 2: { i2+=5;break; } // Input String + } + break; + } + case 5: // Matrix + { + short inner_type=cube[index][i1][i2+1].first; + switch(inner_type) + { + case 1: { i2+=8;break; } // Matrix of Integer + case 2: { i2+=8;break; } // Matrix of Real + case 3: // Matrix of Sting + { + short inner_type2=cube[index][i1][i2+2].first; + switch(inner_type2) + { + case 1: { i2+=5;break; } // Matrix of default String + case 2: { i2+=10;break; } // Matrix of Input String (user defined) + } + break; + } + case 4: { i2+=6;break; } // Matrix of Permutation + case 5: { i2+=7;break; } // Matrix of Unique Numbers + } + break; + } + case 6: // Tree + { + break; + } + case 7: // Graph + { + break; + } + case 8: // Custom_Data_Type + { + i2+=(cube[index][i1][i2+1].first+2);break; + } + default: // initializer + { + i2+=2;break; + } + } + } + } +} +//********************************************************************************************************************************* - //vector > set_of_all_attributes; // short_name -> sofaa - incrementer=0; - short incrementer2=0; - for(short i=0;i(initializer[index][itr]),get<2>(initializer[index][itr])); + } + c1.set_initializer(); + for(int i1=0;i1 store; + store=c1.get_integer(cube[index][i1][i2+2].first,cube[index][i1][i2+3].first,cube[index][i1][i2+4].first,cube[index][i1][i2+5].first,cube[index][i1][i2+7].first); + if(cube[index][i1][i2+6].first==1) //space separated + { + for(int ktr=0;ktr store; + store=c1.get_real(cube[index][i1][i2+2].first,cube[index][i1][i2+3].first,cube[index][i1][i2+4].first,cube[index][i1][i2+5].first,cube[index][i1][i2+7].first); + if(cube[index][i1][i2+6].first==1) //space separated + { + for(int ktr=0;ktr st=c1.get_input_string_array(index3,cube[index][i1][i2+7].first,cube[index][i1][i2+9].first); + if(cube[index][i1][i2+8].first==1) //space separated + { + for(int ktr=0;ktr st=c1.get_all_permutations(index3,cube[index][i1][i2+3].first,cube[index][i1][i2+5].first); + if(cube[index][i1][i2+4].first==1) //space separated + { + for(int ktr=0;ktr store=c1.get_all_random_numbers_for_array(cube[index][i1][i2+2].first,cube[index][i1][i2+3].first,cube[index][i1][i2+4].first,cube[index][i1][i2+6].first); + if(cube[index][i1][i2+5].first==1) //space separated + { + for(int ktr=0;ktr(sofaa[i])<<" "<(sofaa[i])<<" "<(sofaa[i])<<" "<(sofaa[i])<<" \n"; + short inner_type=cube[index][i1][i2+1].first; + switch(inner_type) + { + case 1: // Default String + { + //cout<> matrix=c1.get_integer_matrix(cube[index][i1][i2+2].first,cube[index][i1][i2+3].first,cube[index][i1][i2+4].first,cube[index][i1][i2+5].first,cube[index][i1][i2+6].first,cube[index][i1][i2+7].first,cube[index][i1][i2+8].first); + for(int ktr1=0;ktr1> matrix=c1.get_real_matrix(cube[index][i1][i2+2].first,cube[index][i1][i2+3].first,cube[index][i1][i2+4].first,cube[index][i1][i2+5].first,cube[index][i1][i2+6].first,cube[index][i1][i2+7].first,cube[index][i1][i2+8].first); + for(int ktr1=0;ktr1> matrix=c1.get_string_matrix(index3,cube[index][i1][i2+7].first,cube[index][i1][i2+8].first,cube[index][i1][i2+9].first,cube[index][i1][i2+10].first); + for(int ktr1=0;ktr1> matrix=c1.get_permutation_matrix(index3,cube[index][i1][i2+3].first,cube[index][i1][i2+4].first,cube[index][i1][i2+5].first,cube[index][i1][i2+6].first); + for(int ktr1=0;ktr1> matrix=c1.get_matrix_of_all_unique_numbers(cube[index][i1][i2+2].first,cube[index][i1][i2+3].first,cube[index][i1][i2+4].first,cube[index][i1][i2+5].first,cube[index][i1][i2+6].first,cube[index][i1][i2+7].first); + for(int ktr1=0;ktr1 copy_cube; + copy_cube.push_back(8); + copy_cube.push_back(cube[index][i1][i2+1].first); + copy_cube.push_back(cube[index][i1][i2+2].first); + for(short ktr=(i2+3);ktr<(i2+3+cube[index][i1][i2+1].first);ktr++) + { + short index2=cube[index][i1][ktr].first; + short inner_type=custom[index][index2][0].first; + switch (inner_type) + { + case 1: // custom of integers + { + short index3=c1.store_details_of_numbers_custom(custom[index][index2][1].first,custom[index][index2][2].first,custom[index][index2][3].first,custom[index][index2][4].first); + copy_cube.push_back(index3); break; + } + case 2: // custom of reals + { + short index3=c1.store_details_of_real_custom(custom[index][index2][1].first,custom[index][index2][2].first,custom[index][index2][3].first,custom[index][index2][4].first); + copy_cube.push_back(index3); break; + } + case 3: // custom of Strings + { + short inner_type2=custom[index][index2][1].first; + switch(inner_type2) + { + case 1: // custom of default string + { + short index3=c1.store_default_string(custom[index][index2][2].second); + short index4=c1.store_details_of_default_string_custom(index3); + copy_cube.push_back(index4); break; + } + case 2: // custom of input string + { + short index3=c1.store_input_string(custom[index][index2][2].second,custom[index][index2][3].first,custom[index][index2][4].first,custom[index][index2][5].first); + short index4=c1.store_details_of_input_string_custom(index3,custom[index][index2][6].first); + copy_cube.push_back(index4); break; + } + } + break; + } + case 4: // custom of Permutations + { + short index3=c1.store_string_for_permutation(custom[index][index2][1].second); + short index4=c1.store_details_of_permutation_string_custom(index3,custom[index][index2][2].first); + copy_cube.push_back(index4); break; + } + case 5: // custom of Unique Numbers + { + short index3=c1.store_details_of_unique_numbers_custom(custom[index][index2][1].first,custom[index][index2][2].first,custom[index][index2][3].first); + copy_cube.push_back(index3); break; + } + case 6: // custom of Spaces + { + short index3=c1.store_space_in_custom(); + copy_cube.push_back(index3); break; + } + } + } + // ********************************************************************** + vector > store=c1.build_custom_data_type(copy_cube); + int size_of_custom=copy_cube[2]; + if(size_of_custom<0) { size_of_custom=c1.get_initializer(size_of_custom); } + for(int i=0;i "<(initializer[i1][itr])<<") ["<(initializer[i1][itr])<<" - "<(initializer[i1][itr])<<" ] "<(initializer[i1][itr])<<" \n"; + } + cout<<"\n Object\n"; + for(int i2=0;i2 "; break; + } + case 3: + { + printf("\n\n\n\n Press ");sbc(dr);printf("ENTER");sbc(bb);printf(" to start the process of building your ");sfc(lc);printf("TEST FILE...");sfc(ww);break; + } + case 4: + { + printf("\n\n\n\n Please wait, this process can take some time.....\n");break; + } + case 5: + { + sfc(ly);printf("\n\n\n Congratulations"); + sfc(lc);printf("\n\n Your Test file is successfully created...\n\n"); + printf("\n ");sfc(lr);printf("press 1");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to build another file "); + printf("\n ");sfc(lr);printf("press 2");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to go back to menu"); + printf("\n ");sfc(lr);printf("press 3");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" to exit"); + cout<<"\n\n Enter your choice -> "; break; + } + case 6: + { + cout<<"\n\n\n\n How many ";sfc(ly);printf("OBJECTS");sfc(ww);printf(" you want to include in your Test Cases ?"); + sfc(lr);printf("\n Note");sfc(ww);printf(" : Range [ 1 to 10 ]"); + printf("\n\n Enter your choice -> "); break; + } + case 7: + { + cout<<"\n\n\n\n How many ";sfc(lc);printf("QUERIES");sfc(ww);printf(" you want to include in your Test Cases ?"); + sfc(lr);printf("\n Note");sfc(ww);printf(" : Range [ 1 to 10 to the power 5 ]"); + printf("\n\n Enter your choice -> "); break; + } + case 8: + { + printf("\n\n\n\n\n Do you want to display Query value at top of your ");sfc(ly);printf("TESE FILE");sfc(ww); + printf("\n\n Type ");sfc(ly);printf("yes");sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf(" to include it"); + printf("\n\n Type ");sfc(ly);printf("no");sfc(ww);printf(" and ");sbc(dr);printf("ENTER");sbc(bb);printf(" to disable it"); + cout<<"\n\n Enter your choice -> "; break; + } + case 9: + { + printf("\n\n Select a valid arrangement of your ");sfc(ly);printf("OBJECTS\n\n");sfc(ww); + printf("\n ");sfc(lr);printf("press 1");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" for SEQUENTIAL ARRANGEMENT "); + printf("\n ");sfc(lr);printf("press 2");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" for RANDOMIZED ARRANGEMENT "); + cout<<"\n\n Enter your choice -> "; break; + } + case 10: + { + printf("\n\n\n Name your ");sfc(lc);printf("TEST FILE\n\n -> ");sfc(ww);break; + } + case 11: + { + printf("\n\n Select a valid ");sfc(lc);printf("FILE FORMAT");sfc(ww);printf(" of your ");sfc(lc);printf("TEST FILE\n\n");sfc(ww); + printf("\n ");sfc(lr);printf("press 1");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" for TEXT DOCUMENT "); + printf("\n ");sfc(lr);printf("press 2");sfc(ww);printf(" and ");sbc(dr);sfc(lr);printf(" ENTER ");sbc(bb);sfc(ww);printf(" for WORD DOCUMENT "); + cout<<"\n\n Enter your choice -> "; break; + } + } +} +// The END diff --git a/Test_case_generator.exe b/Test_case_generator.exe index d513c84..2d442d3 100644 Binary files a/Test_case_generator.exe and b/Test_case_generator.exe differ diff --git a/special_attributes.h b/special_attributes.h index 48dd44d..26b6d12 100644 --- a/special_attributes.h +++ b/special_attributes.h @@ -4,7 +4,7 @@ #include #define black bb #define dark_blue db -#define dark_green sg +#define dark_green dg #define dark_cyan dc #define dark_red dr #define dark_magenta dm diff --git a/special_functions.h b/special_functions.h index 1d8dd6f..5b1200e 100644 --- a/special_functions.h +++ b/special_functions.h @@ -5,8 +5,15 @@ typedef long long ll; namespace special_functions { bool all_integers(std::string temp); + bool valid_pos_neg_integer(string temp); ll string_to_integer_converter(string temp); string positive_number_to_string(ll); + bool check_odd_exist(ll a,ll b); + bool check_even_exist(ll a,ll b); + bool check_prime(ll a); + bool check_prime_exist(ll a,ll b); + bool check_non_prime_exist(ll a,ll b); + ll count_no_of_permutations(string a); } @@ -30,11 +37,41 @@ bool special_functions::all_integers(std::string temp) +bool special_functions::valid_pos_neg_integer(string temp) +{ + if(temp.size()>20) return false; + short i=0; + if(temp[0]=='-') { i++; } + for(i;i19) return 0; // string length must be smaller then 19 + sort(a.begin(),a.end()); + vector v1;ll countt=1,sum=1; + for(short i=1;i10) { return 39916800; } + ll num=1,den=1; sum=a.size(); + while(sum--) { num*=(sum+1); } + for(int i=0;i