1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
|
// I shall add the possibility of a Not Guilty plea soon; but then I'll have to
// write the jury function too, it will be complicated.
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <windows.h>
#define SENTENCE PlaySound(TEXT("Voice/sent.wav" ), NULL, SND_FILENAME);
#define GAVEL PlaySound(TEXT("Voice/gavel.wav" ), NULL, SND_FILENAME);
#define YEARS PlaySound(TEXT("Voice/years.wav" ), NULL, SND_FILENAME);
#define PRISON PlaySound(TEXT("Voice/prison.wav"), NULL, SND_FILENAME);
using namespace std;
void guilty(string, string, string);
/*
void notguilty(string, string, string);
void jury(string, string, string);
*/
int main() {
string charge1, charge2, charge3, yesno, plead;
cout << "Please input all data UNCAPTIALIZED.\n\n";
do {
cout << "Input charge 1: ";
cin >> charge1;
cin.ignore();
cout << "\nAny further charges?[Y/N]\n\n";
cin >> yesno;
cin.ignore();
if (yesno=="n") {charge2==""; charge3==""; break;}
cout << "\nInput charge 2: ";
cin >> charge2;
cin.ignore();
cout << "\nAny further charges?[Y/N]\n\n";
cin >> yesno;
cin.ignore();
if (yesno=="n") {charge3==""; break;}
cout << "\nInput charge 3: ";
cin >> charge3;
cin.ignore();
break;
} while (true);
/*
do {
cout << "\nInput plead: [\"Guilty\"/\"Not Guilty\"]\n";
cin >> plead;
cin.ignore();
break;
} while (true);
if (plead=="guilty")
guilty(charge1, charge2, charge3);
else
notguilty(charge1, charge2, charge3);
*/
guilty(charge1, charge2, charge3);
YEARS
PRISON
GAVEL
cin.get();
return 0;
}
void guilty(string charge1, string charge2, string charge3) {
int sentence=0;
if (charge1!="" && charge2=="" && charge3=="")
cout << "\n\nYou have pleaded guilty to: " << charge1 << endl;
if (charge1!="" && charge2!="" && charge3=="")
cout << "\n\nYou have pleaded guilty to: " << charge1 << " and " << charge2 << endl;
if (charge1!="" && charge2!="" && charge3!="")
cout << "\n\nYou have pleaded guilty to: " << charge1 << ", " << charge2 << " and " << charge3 << endl;
Sleep(3000);
system("cls");
cout << "Judging.";
Sleep(1000);
system("cls");
cout << "Judging..";
Sleep(1000);
system("cls");
cout << "Judging...";
system("cls");
int num1=0, num2=0, num3=0, num4=0, num5=0, num6=0, num7=0;
ifstream file("file.txt");
if (charge1=="murder" || charge2=="murder" || charge3=="murder")
file >> num1;
if (charge1=="manslaughter" || charge2=="manslaughter" || charge3=="manslaughter")
file >> num2;
if (charge1=="rape" || charge2=="rape" || charge3=="rape")
file >> num3;
if (charge1=="assault" || charge2=="assault" || charge3=="assault")
file >> num4;
if (charge1=="theft" || charge2=="theft" || charge3=="theft")
file >> num5;
if (charge1=="subabu" || charge2=="subabu" || charge3=="subabu")
file >> num6;
if (charge1=="hitrun" || charge2=="hitrun" || charge3=="hitrun")
file >> num7;
sentence=(num1+num2+num3+num4+num5+num6+num7);
cout << "Decision found.";
Sleep(3000);
system("cls");
cout << "Sentencing.";
Sleep(800);
system("cls");
cout << "Sentencing..";
Sleep(800);
system("cls");
cout << "Sentencing...";
system("cls");
Sleep(500);
SENTENCE
cout << sentence;
Sleep(500);
}
/*
void notguilty(string charge1, string charge2, string charge3) {
}*/
|