Student Project
2024-08-28 01:45:55 UTC
<*** Main Program ***>
#include "include\tools.hpp"
int main()
{
clear();
int signal_To_Ignore = -1;
int signal_to_Stop = -99;
int data[] = {1, 10, -1, 5, 6, -1, 7, -99, 8, 10};
cout << "\n\nOriginal array is: \n";
for (auto d : data)
{
cout << d << ", ";
}
cout << "\n\n\n";
cout << "After applying the two signals, the array becomes: \n";
for (auto d : data)
{
if (d == signal_to_Stop)
{
break;
}
else if (d == signal_To_Ignore)
{
continue;
}
else
{
cout << d << ", ";
}
}
cout << "\n\n";
return 0;
}
<*******************************************************>
<*** Tools.hpp ***>
#pragma once
#include <iostream>
#include <vector>
using namespace std;
void clear();
<*******************************************************>
<*** Tools.cpp ***>
#include "include/tools.hpp"
void clear() {
// CSI[2J clears screen, CSI[H moves the cursor to top-left corner
cout << "\x1B[2J\x1B[H";
}
<*******************************************************>
#include "include\tools.hpp"
int main()
{
clear();
int signal_To_Ignore = -1;
int signal_to_Stop = -99;
int data[] = {1, 10, -1, 5, 6, -1, 7, -99, 8, 10};
cout << "\n\nOriginal array is: \n";
for (auto d : data)
{
cout << d << ", ";
}
cout << "\n\n\n";
cout << "After applying the two signals, the array becomes: \n";
for (auto d : data)
{
if (d == signal_to_Stop)
{
break;
}
else if (d == signal_To_Ignore)
{
continue;
}
else
{
cout << d << ", ";
}
}
cout << "\n\n";
return 0;
}
<*******************************************************>
<*** Tools.hpp ***>
#pragma once
#include <iostream>
#include <vector>
using namespace std;
void clear();
<*******************************************************>
<*** Tools.cpp ***>
#include "include/tools.hpp"
void clear() {
// CSI[2J clears screen, CSI[H moves the cursor to top-left corner
cout << "\x1B[2J\x1B[H";
}
<*******************************************************>