Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.02 KB | None | 0 0
  1. //don't question it, it's for a school project. main() is in another class, and all it does is call ReadTargetData()
  2.  
  3. #include "stdafx.h"
  4. #include <iostream>
  5. #include <string>
  6.  
  7. using namespace std;
  8.  
  9. void ReadTargetData()
  10. {
  11.     void ReadTargetData();
  12.     void ReadDifficulty();
  13.     void SetPriority(int value);
  14.     void PrintTarget(string name, string hitID, int value, string priority);
  15.  
  16.     string name;
  17.     string hitID;
  18.     int value;
  19.     string priority;
  20.  
  21.     cout << "_________________________________________________" << endl;
  22.     cout << "|                Enter Hit Data                 |" << endl;
  23.     cout << "|###############################################|" << endl;
  24.     cout << "|        Enter the target's first name          |" << endl;
  25.     cin >> name;
  26.     cout << "|               Enter the hit ID                |" << endl;
  27.     cin >> hitID;
  28.     cout << "|         Enter a difficulty for the hit        |" << endl;
  29.     cout << "|             [Easy][Medium][Hard]              |" << endl;
  30.     ReadDifficulty();
  31.     cout << "|      Enter a value for the hit (dollars)      |" << endl;
  32.     cin >> value;
  33.     priority = SetPriority(value);
  34.     cout << "|###############################################|" << endl;
  35.     cout << "|             Data entry complete               |" << endl;
  36.     cout << "|_______________________________________________|" << endl;
  37. }
  38. void ReadDifficulty()
  39. {
  40.     string difficulty;
  41.         while (true)
  42.         {
  43.             cin >> difficulty;
  44.             if (difficulty == "easy" || difficulty == "Easy" || difficulty == "medium" || difficulty == "Medium" || difficulty == "hard" || difficulty == "Hard")
  45.             {
  46.                 break;
  47.             }
  48.             else
  49.             {
  50.                 cout << "|     Invalid difficulty, please try again      |" << endl;
  51.             }
  52.         }
  53. }
  54. string SetPriority(int value)
  55. {
  56.     string priority;
  57.     if (value < 1000)
  58.     {
  59.         priority = "Low priority";
  60.     }
  61.     else if (value > 1000000)
  62.     {
  63.         priority = "Low priority";
  64.     }
  65.     else if (value < 1000000 && value > 1000)
  66.     {
  67.         priority = "Medium priority";
  68.     }
  69.     return priority;
  70. }
  71. void PrintTarget(string name, string hitID, int value, string priority)
  72. {
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement