Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~4K People Reached
Favorite Forums
Favorite Tags
Member Avatar for smitsky

Hi. I'm getting the following message when I try to overload operator= here in line 830-833. I have also included the error messages. Thanks #include <iostream> #include <string> #include <limits> #include <vector> #include <iomanip> #include <cstdlib> using namespace std; /** * Global Variables */ string k; int pmem, plen; int …

Member Avatar for uonsin
0
345
Member Avatar for smitsky

Hi. Can someone tell me how to output a two-dimensional priority queue please? In particular I am using an array of priority queues. The method I use to output an array of vectors is not working. I will show the one that is working (array of vectors): if(!diskQueues[i].empty()) { for …

Member Avatar for tinstaafl
0
922
Member Avatar for smitsky

Hi. I want to output all of the processes in the printer queue here, and I'm not able to figure out quite how to do that. The only process that shows up is the last one I entered. For instance, if I put a process into printer queue 1 and …

0
121
Member Avatar for smitsky

If I prompt the user for n number of printers, is there a way of creating n number of vectors on the fly as opposed to creating vectors and putting them in your class structure at the start? I have to create as many printer queues as a user specifys. …

Member Avatar for smitsky
0
195
Member Avatar for smitsky

Hi. I'm having a problem accessing a function of an object which I put into a vector. When I try to read the vector at lines 503-506 , I get an output of whatever number I set my setTau() function, instead of the correct number. The beginning value for the …

Member Avatar for Ancient Dragon
0
216
Member Avatar for smitsky

I'm trying to understand this function. I try to compile an run it, but it gives an error message at line 12. Thanks. #include <iostream> #include <string> #include <cmath> using namespace std; int stringConvertInt(string raw) { int sum=0, power=0; power=raw.length()-1; for(int i=0; i<raw.length(); i++) { sum=sum+(pow(10,power)*(raw[i]-48)); power--; } return sum; …

Member Avatar for smitsky
0
229
Member Avatar for smitsky

I'm having a problem accessing information between classes. The following simple program illustrates the problem. I have two classes. Int Cell and second. IntCell has a single data member: storedValue. I initialize the value of storedValue to 0, and then assign a value of 16 to it in main() on …

Member Avatar for Ancient Dragon
0
199
Member Avatar for smitsky

Hi. Why am I getting different output when I call the calculate() function? The output on line 184 gives 1.0001, while the output from line 433 gives 1. Thanks. #include <iostream> #include <string> #include <limits> #include <vector> #include <iomanip> using namespace std; /** * Global Variables */ string k; int …

Member Avatar for smitsky
0
198
Member Avatar for smitsky

Hi. I'm trying to implement a disk scheduling algorithm using a vector. I am able to find the smallest element of the vector with my findMin() function: int computer::findMin( vector<int> v ) { int minIndex = 0; for( int i = 1; i < v.size( ); i++ ) if( v[ …

Member Avatar for mike_2000_17
0
295
Member Avatar for smitsky

I'm having trouble displying the contents of a queue. When I pop the queue here: for( int i = 0; i < diskQueue.size() + 1; i++ ) { cout << left << setw(0) << "--d" << i+1 << left << setw(4) << " " << left << setw(14) << diskQueue.front().getFilename() …

Member Avatar for smitsky
0
207
Member Avatar for smitsky

Hi. Can someone explain why this isn't working? #include <iostream> #include <list> #include <string> #include <iomanip> using namespace std; /** * Global Variables */ int printer; int disk; int cd; int num; int pmem, plen; int dmem, dlen; int cmem, clen; class PCB { public: PCB() : pid( 0 ), …

Member Avatar for smitsky
0
138
Member Avatar for smitsky

Hi. I'm trying to access some data in a List using an Iterator, but I'm getting an error message: #include <iostream> #include <list> #include <string> #include <iomanip> using namespace std; /** * Global Variables */ int printer; int disk; int cd; int num; string k; int pmem, plen; int dmem, …

Member Avatar for smitsky
0
218
Member Avatar for smitsky

Hi. Can someone tell me why the following code is giving me an error message? Thank you. #include <iostream> #include <list> #include <string> #include <iomanip> using namespace std; /** * Global Variables */ int printer; int disk; int cd; int num; string k; int pmem, plen; int dmem, dlen; int …

Member Avatar for smitsky
0
418