// ALMark // 7/23/05 #include const int grains_lb=7000; int main() { double cost_boxbullets=0, cost_boxrounds=0, cost_boxbrass=0, cost_canpowder=0, cost_boxprimer=0; int bullets_box=0, rounds_box=0, brass_box=0, reloads_bullet=0, primers_box=0; double lbs_can=0, grains_load=0, costofbrass=0, totalcost=0; char buybrass='n',cont='y'; do { cout << endl << endl << "================================================================================" << "\t\t\t\tReload Calculator" << endl; cout << "================================================================================" << endl; cout << "Enter cost/box of bullets (projectiles): $"; cin >> cost_boxbullets; cout << "Enter number of bullets/box: "; cin >> bullets_box; cout << "Enter cost/can of powder: $"; cin >> cost_canpowder; cout << "Enter number of lbs. of powder in can: "; cin >> lbs_can; cout << "Enter cost/box of primers: $"; cin >> cost_boxprimer; cout << "Enter number of primers/box: "; cin >> primers_box; cout << "Enter grains of powder in the load: "; cin >> grains_load; cout << "Enter average number of reloads you get per casing: "; cin >> reloads_bullet; cout << "With reloading you can sometimes reload shot factory brass" << endl; cout << "or you can usually buy brass in bulk." << endl; cout << endl << "Will you be buying brass in bulk? (Y/N): "; cin >> buybrass; if((buybrass=='Y')||(buybrass=='y')) { cout << "Enter cost of package of brass: $"; cin >> cost_boxbrass; cout << "Enter number of casings/package: "; cin >> brass_box; costofbrass=(cost_boxbrass/brass_box)/reloads_bullet; } else { cout << "Enter cost of box of factory rounds: $"; cin >> cost_boxrounds; cout << "Enter number of rounds/box: "; cin >> rounds_box; costofbrass=(cost_boxrounds/rounds_box)/reloads_bullet; } totalcost=(cost_boxbullets/bullets_box)+costofbrass+((cost_canpowder/lbs_can)/grains_lb)*grains_load+cost_boxprimer/primers_box; cout << endl << "====================================================" << endl; cout << "Estimated cost for this loading is: $" << totalcost << endl; cout << "====================================================" << endl << endl; cout << "Again? (Y/N): "; cin >> cont; } while((cont=='y')||(cont=='Y')); return 0; }