I am trying to come up with an efficient sorting algorithm to sort a set of values from 0 to 30,000. There are no duplicate numbers in the set, and I want to use as little memory requirements as...
Type: Posts; User: GCNDoug
I am trying to come up with an efficient sorting algorithm to sort a set of values from 0 to 30,000. There are no duplicate numbers in the set, and I want to use as little memory requirements as...
Thanks for the help everyone!
I worked the second part out and hopefully you guys can check me.
L1.append(10);
L1.append(20);
L1.append(15);
<| 10, 20, 15>
L1.setStart(); - "Place fence at list start, making left...
Left partition
Start W
Edn X
Right partiton
Start Y
End Z
This is for a data organization class. The fence is '|' I had never heard of a fence until this programming class I thought maybe it was the current pointer I'm not sure. The right partition would...
Quick list question.
If I have an empty list where would I append the first value of the list.
The definition of append in the question says "append an element at the end of the right...
I am have some trouble implementing my client code for this program could someone give me some ideas.
This problem is an exercise in the implementation of queue. We will look at the...
Alright I'll see what I can do I'm trying to make a program using recursion to set all of the lights to off (0) when they are initially set to on (1).
We have not got to vectors in class. I don't know if I can use that I will play with it anyway thanks.
void main()
{
const int size;
cout << "Please enter a amount of lights" << endl;
cin >> size;
int lights[size];
for (int i = 0; i < n; i++)
I am pretty sure that I tried it earlier with the () but I'm not sure will post results when I get a chance to compile again
already tried, if I take it out it still gives a compiler error.
case 1:
sellProduct (productlist[0].returnname, counter);
break;
1>c:\users\doug\documents\visual studio...
Well after I fixed the class functions it says this for every line of the switch statement.
1>c:\users\doug\documents\visual studio 2008\projects\lab5candy\lab5candy\candymachinelab.cpp(62) :...
I want the name lol! I fixed the class functions though. Will keep working on the other stuff thanks again for ur help!
void sellProduct(dispenserType product[], cashRegister& pCounter);...
#include <string>
#include <iostream>
class dispenserType
{
public:
int getNoOfItems() const;
int getCost() const;
void makeSale();
dispenserType(int setNoOfItems = 50, int setCost...
Like this?
#include <string>
#include <iostream>
class dispenserType
{
public:
int getNoOfItems() const;
That sounds awesome I would love to make all of that information no longer private although I'm not sure that's what I'm suppose to do.
I need to be able to access the information in the switch...
I guess i need to do all of the work that was originally done in main through the class functions now?
Well I need to display all of the items with a number in order to select them. Then work...
Well now I have all the data, I just need to figure out now how to use it lol.
hmm appears to have compiled fine without the #include statements but either way I added them. This issues is solved wooooo!
Thanks guys!
So then how do I send the opened file to the function?
And once i send it will I be able to access all of those class objects anywhere?
Change last two lines to this?
for (int i = 0; i <...
oh sorry, that is totally new to me; have not learned in class. Will try now! Thanks you rock! lol
Elysia does this look like the right set up for main in order to send the opened file?
ifstream inStud;
dispenserType productlist[8];
inStud.open("items.txt");
if (!inStud)
{
still no luck.
std::ifstream // or std::ifstream;
std::string // or std::string;
class dispenserType
{
public:
int getNoOfItems() const;
int getCost() const;
#include <string>
#include <fstream>
class dispenserType
{
public:
int getNoOfItems() const;
int getCost() const;
void makeSale();
dispenserType(int setNoOfItems = 50, int setCost =...