Commit f43f3e72 authored by Aro Ghukasyan's avatar Aro Ghukasyan

Aro Ghukasyan E_07_10 V.1

parent a4f65cdd
If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: Error: Sale can not be negative.
1. $200 - 299 11
If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter Week Sale:
1. $200 - 299 12
2. $300 - 399 0
3. $400 - 499 1
4. $500 - 599 1
......@@ -7,4 +7,4 @@ If you want break Enter -1 Enter Week Sale: If you want break Enter -1 Enter
6. $700 - 799 2
7. $800 - 899 1
8. $900 - 999 1
9. $1000 and more 3
\ No newline at end of file
9. $1000 and more 3
#include <iostream>
void allocationRange(int *, const int);
void allocationRange(int * aray, const int ARRAY_SIZE);
int
main()
......@@ -10,9 +10,10 @@ main()
allocationRange(arrayCount, ARRAY_SIZE);
std::cout << std::endl;
int rangeOfumber;
for (int i = 0; i < ARRAY_SIZE - 1; ++i) {
std::cout << i + 1 << ". $" << 100 * (i + 2) << " - " << 100 * (i + 2) + 99 << "\t";
rangeOfumber = 100 * (i + 2);
std::cout << i + 1 << ". $" << rangeOfumber << " - " << rangeOfumber + 99 << "\t";
std::cout << "\t" << arrayCount[i];
std::cout << std::endl;
......@@ -20,7 +21,7 @@ main()
std::cout << "9. $1000 and more ";
std::cout << "\t" << arrayCount[ARRAY_SIZE - 1];
std::cout << std::endl;
return 0;
}
......@@ -34,11 +35,12 @@ allocationRange(int * aray, const int ARRAY_SIZE)
{
std::cout << "If you want break Enter -1 \t Enter Week Sale: ";
std::cin >> sale;
if (0 < sale) {
allSalary = (sale * 9 / 100) + 200;
} else {
std::cout << "Error: Sale can not be negative.";
if (0 > sale && -1 != sale) {
std::cerr << "\nError 1: Sale can not be negative.";
break;
} else {
allSalary = (sale * 9 / 100) + 200;
}
if (1000 < allSalary) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment