The title for this could also be: proof of not being an idiot.
I decided to go back to the VERY basics of what I could do for a bundle management system. Here is an extremely basic build of a system that could accept the very most basic stuff. It could sort of work though.
It still needs the ability to switch lengths halfway through the bundle, and it needs to have a much prettier output. Any step is a step though. I'll begin actually working on the classes and such now.
Here's the code:
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main()
{
// Declaring vars
string bunk, species;
int thickness, length, width;
int sentinel = 99;
int counter = 0;
int bunkWidth[300];
bool choice = true;
// Prompts for input
cout << "\nEnter Bunk Number: " << endl;
cin >> bunk;
cout << "\nEnter Species: " << endl;
cin >> species;
cout << "\nEnter Thickness: " << endl;
cin >> thickness;
cout << "\nEnter Length: " << endl;
cin >> length;
while (sentinel != 0) {
cout << "\nEnter Width: "<< endl;
cin >> width;
bunkWidth[counter] = width;
sentinel = width;
width = 0;
counter++;
}
cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nPrint Report? (y/n) ";
cin >> choice;
if (choice == true) {
cout << "Bunk Number: " << bunk << endl;
cout << "Species: " << species << endl;
cout << "Thickness: " << thickness <<"/4" << endl;
cout << "Length: " << length << endl;
cout << "Width: " << endl;
for (int i = 0; i < counter ; i++) {
cout << bunkWidth[i] << endl;
}
}
}
I decided to go back to the VERY basics of what I could do for a bundle management system. Here is an extremely basic build of a system that could accept the very most basic stuff. It could sort of work though.
It still needs the ability to switch lengths halfway through the bundle, and it needs to have a much prettier output. Any step is a step though. I'll begin actually working on the classes and such now.
Here's the code:
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main()
{
// Declaring vars
string bunk, species;
int thickness, length, width;
int sentinel = 99;
int counter = 0;
int bunkWidth[300];
bool choice = true;
// Prompts for input
cout << "\nEnter Bunk Number: " << endl;
cin >> bunk;
cout << "\nEnter Species: " << endl;
cin >> species;
cout << "\nEnter Thickness: " << endl;
cin >> thickness;
cout << "\nEnter Length: " << endl;
cin >> length;
while (sentinel != 0) {
cout << "\nEnter Width: "<< endl;
cin >> width;
bunkWidth[counter] = width;
sentinel = width;
width = 0;
counter++;
}
cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nPrint Report? (y/n) ";
cin >> choice;
if (choice == true) {
cout << "Bunk Number: " << bunk << endl;
cout << "Species: " << species << endl;
cout << "Thickness: " << thickness <<"/4" << endl;
cout << "Length: " << length << endl;
cout << "Width: " << endl;
for (int i = 0; i < counter ; i++) {
cout << bunkWidth[i] << endl;
}
}
}
No comments:
Post a Comment