Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It's probably a reagional thing -- no one in my part of the planet says "three-fold".

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I bought my grandaughter a Surface for college about 6-8 months ago -- it's a tablet at more than laptop prices.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Oxford dictionary: cheaper just means it costs less mony than something else. See "cheaper by the dozen".

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Started out rainy but the clods moved away, the sun shined and it warmed up a lot. Grass is green now and growing fast.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I agree -- I like to capitalize SQL reserved words and make everything else lower-case or a mixture of upper/lower case. That makes reserved words stand out.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

On today's fast computers, probably not at all, or at least not enough to be measurable. If you are using a really old and slow computer you can profile it to find out how it performs on your computer.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The only time I've seen it make any real difference is when the class object is a reference, in that case you have to initialize it the way you showed.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Do I need a header file and a .cpp file both to use a custom defined class?

Depends on the how complex the class is. In the simplest case the class and implementation can both be in the header file. I like to use inline for very short methods. For example you can put all this in a header file.

class Foo
{
public:
   Foo() { _x = 0; } // inline method
   void setX(int x) {_x = x;} // another inline method
   int getX() {return _x;} // another inline function
private:
   int _x;
};

Template classes and their implementation code almost always has to be in a header file, implementation can't be compiled separately in *.cpp file(s) because the compiler doesn't know the data type at that time.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Yes, for loop control one-letter variable names are ok, for example common ones are i, j, k, and m.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Microsoft has already Updates available to bring back common features to the Millions of Users relying on a 'familiar' SCREEN for their Win 8+ Version

You mean the windows 8 to 8.1 upgrade? And what a farce that was! All they did was put a new button on the lower left corner of the task menu named "Start", and all it does is display the metro window. But not all is lost, you can get a free Windows 7-style Start button.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Here (click here) is a working select sort

void selectSort(char* arr, int n)
{
    //pos_min is short for position of min
    int pos_min, temp;

    for (int i = 0; i < n - 1; i++)
    {
        pos_min = i;//set pos_min to the current index of array

        for (int j = i + 1; j < n; j++)
        {

            if (arr[j] < arr[pos_min])
                pos_min = j;
            //pos_min will keep track of the index that min is in, this is needed when a swap happens
        }

        //if pos_min no longer equals i than a smaller value must have been found, so a swap must occur
        if (pos_min != i)
        {
            temp = arr[i];
            arr[i] = arr[pos_min];
            arr[pos_min] = temp;
        }
    }
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

for (rintIndex = rintLoopCount; rintIndex < intCount -1; rintIndex++)

That loop on line 29 is incorrect. don't subtract 1 from intCount

for (rintIndex = rintLoopCount; rintIndex < intCount; rintIndex++)

This is the output I got, but it too has a problem (double e)

The sorted string is: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdeefghijklmnopqrstuvxyz

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Do you mean selection sort algorithm? There are lots of sorting algorithms, some better than others.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Pogramming books, especially older ones, sometimes contain errors. Go the the publisher's web site and see if it has free download of the source code in the book which will generally have all the bugs fixed. Another good source is google, for example good for "c++ selection sort".

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Where did you get that algorithm? Here's another for you to study.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

depends on data type

sUserName -- string
iUserID -- integer

I don't write php or java, just c and c++.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Is that supposed to be written in java or c++? There is a java form for such questions.

In either event, no one here will do your homework for you. Post the code you have written and ask questions about what you don't understand. It is YOUR responsibility to do this program, not ours.

Of course, I'll be glad to write it for you after you deposit $10,000.00 USD in my personal PayPal account :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That explains a great deal :) You are using Turbo C because you are a hobyist, not a student who is forced to use it by his/her university. Sorry, but I can't help you either because I havn't used it since about 1987 myself.

If you are still trying to write code for that old XT compatible computer, or for anything older than Windows XP then Turbot C should work ok. You might have a lot of problems on newer versions of Windows.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

include (iostream) --- wont let me do the less than sign

It should be like this: #include <iostream>

Post the code you have written so that we can help you with the part(s) you don't understand.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Lexmark all in one printer that doesn't work in Window 7.

Is it an old printer you had laying about the house, or a new one? Did you try to download new drivers from Lexmark web site?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I'm not going to write your whole assignment for you. Doesn't your book cover operator overloading? There are lots of online tutorials, such as this one.

Don't worry about step E until you have the others finished.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

first line is pointer to an array of 5 integers

Those are char pointers, not integers.

The first line declares an array of unknown number of pointers, each pointer points to a memory block of 5 bytes.

The second line allocates a single block of memory with size n*5. This is much faster and more efficient than allocating each of the n pointers individually.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Use a friend method to overload those operators, for example

#include <iostream>
#include <fstream>
using namespace std;

class SavingsAccount
{
public:
    friend ofstream& operator<<(ofstream& out, SavingsAccount& obj);
public:
    string firstName;
    string lastName;
    float savingBalance;
    float annualInterestRate;
    int objectnumber;
...
...

};


ofstream& operator<<(ofstream& out, SavingsAccount& obj)
{
    out << obj.firstName << " " << obj.lastName
        << " " << obj.savingBalance << " " << obj.annualInterestRate << '\n';
    return out;

}

The other operators are similar to the above. For the >> operator use istream instead of ofstream and call it with cin

SavingsAccount obj;
cin >> obj;

For the << operator which I showed you how to code you just open an output stream.

SavingsAccount obj;
ofstream out("filename.txt");
out << obj;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The only program I miss from XP is the original version of Diablo RPG. There are several MS-DOS games I liked. Otherwise, I don't miss a thing from XP.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Another way to do it is to call strdup() and you can delete the strcpy() line.

argv[i] = strdup(temp);

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

objects can't be declared in case statements without { and }, for example:

switch(choice)
            {
            case 1:
            {
                ifstream levelOne;
                    levelOne.open("level1.txt");
            }
            break;

That also means that the stream will be closed as soon as the break statement is executed and the switch is exited. I think you need to rethink what you are doing here and devise a different solution. You would just declare one fstream object before the switch then use it to open the correct file

ifstream in;
switch(choice)
            {
            case 1:
                    in.open("level1.txt");
                    break;
            case 2: 
                    in.open("level2.txt");
                    break;
            case 3: 
                    in.open("level3.txt");
                    break;
            case 4: 
                    in.open("level4.txt");
                    break;
            case 5: 
                    in.open("level5.txt");
                    break;
            default:    cout << "Invalid option please try again" << endl;//when an incorrect option 
JasonHippy commented: I was just about to suggest the same thing! You beat me to it! :) +9
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Please re-read my previous post for additional problems.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

To be similar to argv in main argument you need to allocate one more than count pointers, the last pointer is NULL. That will also let you pass argv to other functions without needing to also pass the number of strings it contains.

Next, argv needs to have it's own copy of all strings so that the pointers do not get invalidated when the origianal strings are destroyed.

You also need to rename the function because it conflicts with argv array name.

#include <stdarg.h>
char **makeArgv(int count, ...)
{
    va_list args;
    int i;
    char **argv = malloc((count+1) * sizeof(char*));
    char *temp;
    va_start(args, count);
    for (i = 0; i < count; i++) {
        temp = va_arg(args, char*);
        argv[i] = malloc(sizeof(temp+1));
        strcpy(argv[i],temp);
    }
    argv[i] = NULL;
    va_end(args);
    return argv;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

He's talking about animals, not people. Very vew people have helth insurance for their pets.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 66 is wrong. Check it with my previous post.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The problem appears to be in this function

ListNode *LinkedList::insert(ListNode *item, ListNode *sortedList)

That function is destroying the original list. It should be inserting item into SortedList and returning SortedList. Instead, it is doing just the opposite.

One way to solve the problem is for insert() to create a new node and add to sortedList, leaving item list link intact.

ListNode *LinkedList::insert(ListNode *item, ListNode *sortedList)
{
    // If sortedList is empty or first member of the  sorted list
    // is greater or equal to item then item becomes the first
    // member of the augmented list

    if (sortedList == NULL || sortedList->value >= item->value)
    {
        //item->next = sortedList;
        return new ListNode(item->value, sortedList);
    }

    // Use recursion to insert the item at the right place in the tail
    sortedList->next = insert(item, sortedList->next);
    return sortedList;
}

You also have to change this function so that it can iterate through the entire original linked list. The problem is that the last line will cause a memory leak, so before changing head = SortedList you have to delete the linked list pointed to by head.

void LinkedList::sort()
{
    ListNode *sortedList = NULL;

    //
    // USE A while LOOP TO CONTINUE LOOPING
    // AS LONG AS HEAD IS NOT EQUAL TO NULL
    ListNode *item = head;
    while (item != NULL)
    {
        //
        // TO MOVE POINTER TO NEXT
        sortedList = insert(item, sortedList);
        item = item->next;
    }
    head = sortedList;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Good. Now get a college bachelor's degree and you will be on your way.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

vb is not an ide but a programming language, just like C# is a programming language. Probably the best IDE is Visual Studio. The Express version is free.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The metod that starts on line 92 is a copy constructure, which means you have to create a copy of the contents of the parameter. In this case you have to copy the contents of the list from other parameter into this. A simple one-line statement is not sufficient.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

after the last valid character in the string. See this post I made a week ago that told you how.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

should be 90, 90 and 80. What did you get when you ran the program?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what compiler are you using? Turbo C has a goto() function that moves the cursor somewhere then you would just print spaces. If you are using a more modern compiler then you will have to use some of the win32 api console functions to move the cursor to the beginning of the line you want to delete.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I'd get different insurance. Or was it that you were not covered for flood and hail damage? In that case you might consider expanding the coverage you have. My town had a very bad hail storm a couple years ago and everyone in town had to have their homes reroofed and resided. My insurance covered almost all of it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

For char arrays you can use strcmp() which is defined in string.h to check if the two character arrays are the same or not. strcmp() returns 0 if the two are identical.

if( strcmp(str,"hello") == 0) cout<<"world";

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Yes, I think I do understand the problem, maybe you don't understand the solution.

#include<iostream>
using namespace std;
int main()
{
    int a[10] = { 5, 2, 10, 25, 4, 9, 7, 25, 8, 3 };
    int largest_1 = 0, largest_2 = 0, largest_3 = 0;

    for (int i = 0; i<10; i++)
    {
        if (a[i] >= largest_3 && a[i] <= largest_2)
        {
            largest_3 = a[i];
        }
        else if (a[i] >= largest_2 && a[i] <= largest_1)
        {
            largest_3 = largest_2;
            largest_2 = a[i];
        }
        else if (a[i] >= largest_1)
        {
            largest_3 = largest_2;
            largest_2 = largest_1;
            largest_1 = a[i];
        }
    }
    cout << "largest :" << largest_1 << endl;
    cout << "2nd largest :" << largest_2 << endl;
    cout << "3rd largest :" << largest_3 << endl;
    cin.get();
    return 0;
}

And the output is this:

largest :25
2nd largest :25
3rd largest :10

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

probably very similar to the way you looped through them in the print function. Instead of printing, just call Add() method. I can't give you actual code because I have no idea how to iterate through the shapes.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Warm, but wind, rain storms and tornados all day. We have had four major wind/tornado storms come through during the last 24 hours and they will continue for another 6 hours or so. The only problems I have had so far is loss of electricity for about an hour (my neighborhood has underground utilities which helps a lot).

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The constructor needs to duplicate the items in the parameter. Iterate through each of the shapes in list parameter and call list2.Add() method to add the shape to list2. Since you have already coded other functions that iterate through all the shapes this constructor should not be all that difficult for you.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 23: after allocating the new node you need to set the next pointer to NULL so that the program can detect the end of the list.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Ok, it's probably just a timing issue then.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

After the time has expired to edit a post can you just remove the Edit Post button? It's somewhat confusing to make changes then no Save button.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

And with a pair of unsterilised cissors even, recipe for serious infections.

I'd wipe then off on my muddy cow-shit ridden cloths first :)

I was actully just joking when I made that remark, then someone pointed out it was a serious option.

Stuugie commented: lmfao, does nobody here see this humour? +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

So if you have 3 numbers all the same you want the 1st, 2nd and 3d largest to be that same number?

I just tried it -- use <= and >= instead of < and > in each of the if statements.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

the clipboard is the operating system (Windows) way to copy/paste. You can copy from one process and paste it in the same or another process. Similar concept to shared memory in linux os but not nearly as versatile.