Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Mar 29th, 2020 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3. #include <fstream>
  4. using namespace std;
  5. int main() {
  6.     ifstream store;
  7.     int LowRange = 0;
  8.     int Midrange = 0;
  9.     int HighRange = 0;
  10.     int price = 0;
  11.     char Product[] = {0};
  12.     store.open("C:\\Users\\BOGOMIL\\Documents\\Visual Studio 2015\\Projects\\ConsoleApplication6\\store.txt" );
  13.     if (store.fail()) {
  14.         cout << "Failed to open file"<< endl;
  15.         return -1;
  16.     }
  17.     while (!store.eof()) {
  18.         store.get(Product, 10, '$');
  19.         ofstream Prices("Prices.txt");
  20.        
  21.         if (price <= 10 && price > 0) {
  22.  
  23.                 LowRange++;
  24.         }
  25.        
  26.         else if (price <= 20 && price > 10) {
  27.             Midrange++;
  28.         }
  29.  
  30.         else if (price > 20) {
  31.             HighRange++;
  32.         }
  33.         Prices << "Products in the 0-10 range" << " " << LowRange << endl;
  34.         Prices << "Products in the 10-20 range" << " " << Midrange << endl;
  35.         Prices << "Products in the 20+ range" << " " << HighRange << endl ;
  36.     }
  37.     ifstream Prices;
  38.     Prices.open("Prices.txt");
  39.     if (Prices.fail()) {
  40.         cout << "Failed to open file";
  41.         return -1;
  42.         while (!Prices.eof()) {
  43.             cout << Prices.get();
  44.         }
  45.     }
  46. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top