-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b610e30
commit 1d7b668
Showing
3 changed files
with
103 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef HEADERS_OUTPUT | ||
#define HEADERS_OUTPUT | ||
|
||
#include <string> | ||
|
||
|
||
void printLabel(int, int); | ||
void printSeparators(int, int, std::string); | ||
|
||
void printHeader(int, int, int); | ||
void printFooter(int, int, int); | ||
|
||
|
||
#endif | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#include <iostream> | ||
#include <string> | ||
|
||
#include "../headers/genericFunctions.hpp" | ||
|
||
|
||
using std::cout; | ||
using std::string; | ||
|
||
|
||
|
||
|
||
void printLabel(int amountColumns, int upperBound) | ||
{ | ||
for (int col = 0; col < amountColumns; col++) | ||
{ | ||
cout << "++++++[ number "; | ||
if (upperBound >= 1e+006) | ||
{ | ||
cout << "\t "; | ||
} | ||
cout << "| difference ]++"; | ||
} | ||
} | ||
|
||
|
||
void printSeparators(int amountSeparators, int amountColumns, string separator) | ||
{ | ||
for (int i = 0; i < amountSeparators; i++) | ||
{ | ||
cout << separator; | ||
} | ||
cout << " \n "; | ||
} | ||
|
||
// ─ | ||
|
||
|
||
void printHeader(int amountColumns, int amountSeparators, int upperBound) | ||
{ | ||
|
||
|
||
cout | ||
<< " \n" | ||
<< " \n prime numbers in given range: \n" | ||
<< " \n" | ||
<< " "; | ||
|
||
printLabel(amountColumns, upperBound); | ||
cout << "++++ \n "; | ||
|
||
printSeparators(amountSeparators, amountColumns, "─"); | ||
|
||
cout | ||
<< " \n" | ||
<< " \n" | ||
<< " \n" | ||
<< " "; | ||
} | ||
|
||
|
||
void printFooter(int amountColumns, int amountSeparators, int upperBound) | ||
{ | ||
cout | ||
<< " \n" | ||
<< " \n" | ||
<< " "; | ||
|
||
printSeparators(amountSeparators, amountColumns, "─"); | ||
|
||
printLabel(amountColumns, upperBound); | ||
|
||
printSeparators(amountSeparators/2, amountColumns, "─ "); | ||
} |