1. Welcome to Tacoma World!

    You are currently viewing as a guest! To get full-access, you need to register for a FREE account.

    As a registered member, you’ll be able to:
    • Participate in all Tacoma discussion topics
    • Communicate privately with other Tacoma owners from around the world
    • Post your own photos in our Members Gallery
    • Access all special features of the site

Sort

Discussion in 'Technology' started by tarheelfan_08, Mar 1, 2010.

  1. Mar 1, 2010 at 5:21 PM
    #1
    tarheelfan_08

    tarheelfan_08 [OP] Carolina Alliance

    Joined:
    Jan 4, 2008
    Member:
    #4098
    Messages:
    2,944
    Gender:
    Male
    First Name:
    Justin
    North Carolina
    Vehicle:
    2010 White 4x4 Double Cab Tacoma Short Bed
    Chrome Grill, Chrome accessories(door handles and mirror covers), LEER Super White Cover, Mirrors with Turn Signals, Window Vent Visors, Step Rails, WeatherTech Digital Floor Mats, Mini Maglight Holder, Chrome Bull Bar
    Here is my code for my linear search, can someone please help me fix my errors. I got no clue how to fix them! And if I have done my linear search wrong then please correct me!

    Class
    Code:
    #include <iostream>
    #include <fstream>
    #include <iomanip>
    #include <functional>
    #include <algorithm>
    #include <string>
    #include <cstdlib>
    #include <sstream>
    using namespace std;
    
    //Vehicle Class
    class Car
    {
    protected:
        string make;  //make
        string model; // model
        string color;  // color
        int    year;  // year
        int mileage;  // miles on car
        int VIN;  //Vin Number of car
    
    public:
            //Constructor that will set information for a new car
        void New_vehicle (string a, string b, string c, int d, int e, int f) 
        {make = a; model = b; color = c; year = d; mileage = e; VIN = f;}
        
        Car(); //Default constructor
        Car(string, string, string, int, int,int);
        //mutator and accessor functions
        void setMake(string);
        void setModel(string);
        void setColor(string);
        void setYear(int);
        void setMileage(int);
        void setVIN(int);
    
        string getMake();
        string getModel();
        string getColor();
        int getYear();
        int getMileage();
        int getVIN();
    
        //Check mileage to see if valid
        void valid_mileage(int);
        void car_details();
        string string_car_details();
    };
    
    //Sets to default values
    Car::Car() {
        make = " ";
        model = " ";
        color = " ";
        year = 0;
        mileage = 0;
        VIN = 0;
    }
        // My Vehicle set up(Make, model, color, year, type,bedsize, bike, mileage)
    Car::Car(string make, string model, string color, int year, int mileage, int VIN) {
        Car::make =  make;
        Car::model = model;
        Car::color = color;
        Car::year = year;
        valid_mileage(mileage);
        Car::VIN = VIN;
    }
    
    void Car::setMake(string make) {
        Car::make = make;
    }
    
    void Car::setModel(string model) {
        Car::model = model;
    }
    
    void Car::setColor(string color) {
        Car::color = color;
    }
    
    void Car::setYear(int year) {
        Car::year = year;
    }
    
    void Car::setMileage(int mileage) {
        valid_mileage(mileage);
    }
    
    void Car::setVIN(int VIN) {
        Car::VIN = VIN;
    }
    
    
    string Car::getMake() {
        return make;
    }
    string Car::getModel() {
        return model;
    }
    string Car::getColor() {
        return color;
    }
    int Car::getYear() {
        return year;
    }
    int Car::getMileage() {
        return mileage;
    }
    
    int Car::getVIN() {
        return VIN;
    }
    
    
    void Car::valid_mileage(int mileage) {
        if (mileage>=0)
            Car::mileage=mileage;
        else {
            Car::mileage=0;
            cout << "WARNING! You have entered invalid mileage!\n";
        }
        }
    
        void Car::car_details() {
            cout << "The current car is a " << year << ' ' << color << ' '
            << make << ' ' << model << " with " << mileage << " miles.\n";
        }
    
        string Car::string_car_details() {
            stringstream buf;
            buf << "The current car is a " << year << ' ' << color << ' '
            << make << ' ' << model << " with " << mileage << " miles.\n";
            return buf.str();
        }
    
    
    
    CPP
    Code:
    #include "CarClass.h"
    using namespace std;
    
    int searchList(int Vin);
    
    int main() {
            
                string temp;
            int tempInt;
            int current_vehicle=0; 
            int results; //results of linear search
            
                //Array of 9 cars
        Car Car_array[9] = {Car("Porsche","911","Silver", 2005, 18990, 1237362727), 
                            Car("Ford","Mustang","Red", 2007, 49842, 7337372239),
                            Car("Chevrolet","Beretta","Black", 1989, 90332, 2873644922),
                            Car("Ford","Focus","White", 2008, 150, 9236498273),
                            Car("Voltzwagon","Jetta","Black", 2006, 28002, 4673992056),
                            Car("Rolls Royce","Ghost","Silver", 2005, 10000, 9292983855),
                            Car("Mazda","626","Blue", 2002, 84754, 7364646463),
                            Car("Toyota","Camry","Red", 2004, 50332, 2133737227),
                            Car("Bugatti","Veyron 16.4","White", 2010, 5, 5712893401)
                            };
        
        //Linear Search for VIN Number
        {
            int results = searchList( 2873644922);
    
            if (results == -1)
                cout << "You did not have a car with the VIN Number 2873644922.\n\n";
            else 
            {
                cout << "You do have a car on the lot with the VIN Number 2873644922.\n\n";
            }
        }
            return 0;
    
    }
    
    

    ERRORS:

    1>------ Build started: Project: Sorting, Configuration: Debug Win32 ------
    1> Car.cpp
    1>\car.cpp(15): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\car.cpp(15): warning C4309: 'argument' : truncation of constant value
    1>\car.cpp(17): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\car.cpp(17): warning C4309: 'argument' : truncation of constant value
    1>\car.cpp(18): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\car.cpp(18): warning C4309: 'argument' : truncation of constant value
    1>\car.cpp(19): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\car.cpp(19): warning C4309: 'argument' : truncation of constant value
    1>\car.cpp(20): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\car.cpp(20): warning C4309: 'argument' : truncation of constant value
    1>\car.cpp(22): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\car.cpp(22): warning C4309: 'argument' : truncation of constant value
    1>\car.cpp(11): warning C4101: 'results' : unreferenced local variable
    1>\car.cpp(9): warning C4101: 'tempInt' : unreferenced local variable
    1>Car.obj : error LNK2019: unresolved external symbol "int __cdecl searchList(int)" (?searchList@@YAHH@Z) referenced in function _main
    1> \Sorting.exe : fatal error LNK1120: 1 unresolved externals
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
     
  2. Mar 1, 2010 at 6:13 PM
    #2
    tarheelfan_08

    tarheelfan_08 [OP] Carolina Alliance

    Joined:
    Jan 4, 2008
    Member:
    #4098
    Messages:
    2,944
    Gender:
    Male
    First Name:
    Justin
    North Carolina
    Vehicle:
    2010 White 4x4 Double Cab Tacoma Short Bed
    Chrome Grill, Chrome accessories(door handles and mirror covers), LEER Super White Cover, Mirrors with Turn Signals, Window Vent Visors, Step Rails, WeatherTech Digital Floor Mats, Mini Maglight Holder, Chrome Bull Bar
    Here is my new CPP file


    CPP
    Code:
    #include "CarClass.h"
    int search(Car[], string, int);
    
    int main() {
            
        const int SIZE = 9;
                
        //Array of 9 cars
        Car Car_array[SIZE] = { Car("Porsche", "911", "Silver", 2005, 18990, 1237362727), 
                                Car("Ford", "Mustang", "Red", 2007, 49842, 7337372239),
                                Car("Chevrolet", "Beretta", "Black", 1989, 90332, 2873644922),
                                Car("Ford", "Focus", "White", 2008, 150, 9236498273),
                                Car("Voltzwagon", "Jetta", "Black", 2006, 28002, 4673992056),
                                Car("Rolls Royce", "Ghost", "Silver", 2005, 10000, 9292983855),
                                Car("Mazda", "626", "Blue", 2002, 84754, 7364646463),
                                Car("Toyota", "Camry", "Red", 2004, 50332, 2133737227),
                                Car("Bugatti", "Veyron 16.4", "White", 2010, 5, 5712893401)};
    
        int desiredVin;
        int manualVIN= 2873644922;
        int pos;
        char doAgain;
    
        pos = search(Car_array, SIZE, manualVIN); 
    
            
        //Linear Search for VIN Number
    
            if (pos == -1)
                cout << "You did not have a car with the VIN Number 2873644922.\n\n";
            else 
            {
                cout << "You do have a car on the lot with the VIN Number 2873644922.\n\n";
            }
        
            return 0;
    
    }
    
    Now I am getting these errors and it looks the same as my book example??
    ERRORS:

    1>------ Build started: Project: Sorting, Configuration: Debug Win32 ------
    1> Car.cpp
    1>\car.cpp(10): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\car.cpp(10): warning C4309: 'argument' : truncation of constant value
    1>\car.cpp(12): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\car.cpp(12): warning C4309: 'argument' : truncation of constant value
    1>\car.cpp(13): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\car.cpp(13): warning C4309: 'argument' : truncation of constant value
    1>\car.cpp(14): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\car.cpp(14): warning C4309: 'argument' : truncation of constant value
    1>\car.cpp(15): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\car.cpp(15): warning C4309: 'argument' : truncation of constant value
    1>\car.cpp(17): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\car.cpp(17): warning C4309: 'argument' : truncation of constant value
    1>\car.cpp(19): warning C4101: 'desiredVin' : unreferenced local variable
    1>\car.cpp(22): warning C4101: 'doAgain' : unreferenced local variable
    1>Car.obj : error LNK2019: unresolved external symbol "int __cdecl search(class Car * const,int,int)" (?search@@YAHQAVCar@@HH@Z) referenced in function _main
    1> Sorting.exe : fatal error LNK1120: 1 unresolved externals
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
     
  3. Mar 1, 2010 at 6:26 PM
    #3
    tarheelfan_08

    tarheelfan_08 [OP] Carolina Alliance

    Joined:
    Jan 4, 2008
    Member:
    #4098
    Messages:
    2,944
    Gender:
    Male
    First Name:
    Justin
    North Carolina
    Vehicle:
    2010 White 4x4 Double Cab Tacoma Short Bed
    Chrome Grill, Chrome accessories(door handles and mirror covers), LEER Super White Cover, Mirrors with Turn Signals, Window Vent Visors, Step Rails, WeatherTech Digital Floor Mats, Mini Maglight Holder, Chrome Bull Bar
    Oh and guys I am understanding my searching but the set up of the search confuses me!

    Code:
    int search(Car[], string, int);
    
    
     
  4. Mar 1, 2010 at 7:16 PM
    #4
    tarheelfan_08

    tarheelfan_08 [OP] Carolina Alliance

    Joined:
    Jan 4, 2008
    Member:
    #4098
    Messages:
    2,944
    Gender:
    Male
    First Name:
    Justin
    North Carolina
    Vehicle:
    2010 White 4x4 Double Cab Tacoma Short Bed
    Chrome Grill, Chrome accessories(door handles and mirror covers), LEER Super White Cover, Mirrors with Turn Signals, Window Vent Visors, Step Rails, WeatherTech Digital Floor Mats, Mini Maglight Holder, Chrome Bull Bar
    I added this to my code
    Code:
    #include "CarClass.h"
    using namespace std;
    
    int search(Car[], string, int);
    
    int main() {
            
        const int SIZE = 9;
                
        //Array of 9 cars
        Car Car_array[SIZE] = { Car("Porsche", "911", "Silver", 2005, 18990, 1237362727), 
                                Car("Ford", "Mustang", "Red", 2007, 49842, 7337372239),
                                Car("Chevrolet", "Beretta", "Black", 1989, 90332, 2873644922),
                                Car("Ford", "Focus", "White", 2008, 150, 9236498273),
                                Car("Voltzwagon", "Jetta", "Black", 2006, 28002, 4673992056),
                                Car("Rolls Royce", "Ghost", "Silver", 2005, 10000, 9292983855),
                                Car("Mazda", "626", "Blue", 2002, 84754, 7364646463),
                                Car("Toyota", "Camry", "Red", 2004, 50332, 2133737227),
                                Car("Bugatti", "Veyron 16.4", "White", 2010, 5, 5712893401)};
    
        int desiredVin;
        int manualVIN= 2873644922;
        int pos;
        char doAgain;
    
        pos = search(Car_array, SIZE, manualVIN); 
    
            
        //Linear Search for VIN Number
    
            if (pos == -1)
                cout << "You did not have a car with the VIN Number 2873644922.\n\n";
            else 
            {
                cout << "You do have a car on the lot with the VIN Number 2873644922.\n\n";
            }
        
            return 0;
    
    }
    
    int search(Car object[], int size, int value)
    {
       int index = 0;         // Used as a subscript to search array 
       int position = -1;     // Used to record position of search value 
       bool found = false;    // Flag to indicate if the value was found 
    
       while (index < size && !found)
       {
          if (object[index].getVIN() == value) // If the value is found
          {
             found = true;          // Set the flag 
             position = index;      // Record the value's subscript 
          }
          index++;                  // Go to the next element 
       }
       return position;             // Return the position, or -1 
    }// End search 
        
    

    Errors:

    1>------ Build started: Project: Sorting, Configuration: Debug Win32 ------
    1> Car.cpp
    1>\sorting\sorting\car.cpp(12): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\sorting\sorting\car.cpp(12): warning C4309: 'argument' : truncation of constant value
    1>\sorting\sorting\car.cpp(14): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\sorting\sorting\car.cpp(14): warning C4309: 'argument' : truncation of constant value
    1>\sorting\sorting\car.cpp(15): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\sorting\sorting\car.cpp(15): warning C4309: 'argument' : truncation of constant value
    1>\sorting\sorting\car.cpp(16): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\sorting\sorting\car.cpp(16): warning C4309: 'argument' : truncation of constant value
    1>\sorting\sorting\car.cpp(17): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\sorting\sorting\car.cpp(17): warning C4309: 'argument' : truncation of constant value
    1>\sorting\sorting\car.cpp(19): warning C4305: 'argument' : truncation from '__int64' to 'int'
    1>\sorting\sorting\car.cpp(19): warning C4309: 'argument' : truncation of constant value
    1>\sorting\sorting\car.cpp(26): error C2664: 'search' : cannot convert parameter 2 from 'const int' to 'std::string'
    1> No constructor could take the source type, or constructor overload resolution was ambiguous
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
     
  5. Mar 1, 2010 at 7:23 PM
    #5
    tarheelfan_08

    tarheelfan_08 [OP] Carolina Alliance

    Joined:
    Jan 4, 2008
    Member:
    #4098
    Messages:
    2,944
    Gender:
    Male
    First Name:
    Justin
    North Carolina
    Vehicle:
    2010 White 4x4 Double Cab Tacoma Short Bed
    Chrome Grill, Chrome accessories(door handles and mirror covers), LEER Super White Cover, Mirrors with Turn Signals, Window Vent Visors, Step Rails, WeatherTech Digital Floor Mats, Mini Maglight Holder, Chrome Bull Bar
    I got it to work guys! I changed my top line to this!

    Code:
    int search(Car[], int, int);
    [FONT=monospace]
    [/FONT]
     
  6. Mar 1, 2010 at 7:33 PM
    #6
    Chad

    Chad Well-Known Member

    Joined:
    Oct 2, 2008
    Member:
    #9636
    Messages:
    2,371
    Gender:
    Male
    First Name:
    Chad
    Cary, NC
    Vehicle:
    09 V6 Access Cab TRD Sport
    Kenwood DMX-7704S Headunit -- Blackvue DR-470 Dashcam -- Pioneer TS-A1685R Speakers in Front -- Suntek CXP 40 Front Tint -- Access Vanish Roll-up Tonneau -- Wet Okole Seat Covers -- Fog Lights on Anytime -- PnL Powered Tailgate Lock -- DTRL "Stealth Mode" -- LED Footwell and Cup Holder Lights -- Map Lights ON with Dome Light -- Shorty Antenna -- AC Line Extension Mod -- Access Cab Rear Headrest Removal
    I'm taking AP Computer Science now, and this looks a whole lot like Java, so I'm assuming that is what this is?
     
  7. Mar 2, 2010 at 11:19 AM
    #7
    tarheelfan_08

    tarheelfan_08 [OP] Carolina Alliance

    Joined:
    Jan 4, 2008
    Member:
    #4098
    Messages:
    2,944
    Gender:
    Male
    First Name:
    Justin
    North Carolina
    Vehicle:
    2010 White 4x4 Double Cab Tacoma Short Bed
    Chrome Grill, Chrome accessories(door handles and mirror covers), LEER Super White Cover, Mirrors with Turn Signals, Window Vent Visors, Step Rails, WeatherTech Digital Floor Mats, Mini Maglight Holder, Chrome Bull Bar
    Na its c++
     
  8. Mar 2, 2010 at 11:33 AM
    #8
    Avman2119

    Avman2119 Well-Known Member

    Joined:
    Feb 4, 2010
    Member:
    #30725
    Messages:
    136
    Gender:
    Male
    First Name:
    Alex
    Colorado
    Vehicle:
    2010 Tacoma TRD Sport
    You should start learning C# it's a lot easier to do OO programming with. Plus its becoming more of the industry standard. I remember doing C++ in my first few years of college like 8 years ago :)
     
  9. Mar 2, 2010 at 12:00 PM
    #9
    Chad

    Chad Well-Known Member

    Joined:
    Oct 2, 2008
    Member:
    #9636
    Messages:
    2,371
    Gender:
    Male
    First Name:
    Chad
    Cary, NC
    Vehicle:
    09 V6 Access Cab TRD Sport
    Kenwood DMX-7704S Headunit -- Blackvue DR-470 Dashcam -- Pioneer TS-A1685R Speakers in Front -- Suntek CXP 40 Front Tint -- Access Vanish Roll-up Tonneau -- Wet Okole Seat Covers -- Fog Lights on Anytime -- PnL Powered Tailgate Lock -- DTRL "Stealth Mode" -- LED Footwell and Cup Holder Lights -- Map Lights ON with Dome Light -- Shorty Antenna -- AC Line Extension Mod -- Access Cab Rear Headrest Removal
    In college, I will more than likely be doing C++ instead of Java. I've done some Visual Basic in the past, but I enjoy Java as well.
     
  10. Mar 2, 2010 at 1:37 PM
    #10
    tarheelfan_08

    tarheelfan_08 [OP] Carolina Alliance

    Joined:
    Jan 4, 2008
    Member:
    #4098
    Messages:
    2,944
    Gender:
    Male
    First Name:
    Justin
    North Carolina
    Vehicle:
    2010 White 4x4 Double Cab Tacoma Short Bed
    Chrome Grill, Chrome accessories(door handles and mirror covers), LEER Super White Cover, Mirrors with Turn Signals, Window Vent Visors, Step Rails, WeatherTech Digital Floor Mats, Mini Maglight Holder, Chrome Bull Bar
    My next part to the code is doing a selection sort and displaying my array in that sort! Can someone please tell me if it looks like I am doing this right or do I need to change something up?

    Code:
    #include "CarClass.h"
    using namespace std;
    
    //Set up Search 
    int search(Car object[], int size, int value)
    {
       int index = 0;         // Used as a subscript to search array 
       int position = -1;     // Used to record position of search value 
       bool found = false;    // Flag to indicate if the value was found 
    
       while (index < size && !found)
       {
          if (object[index].getVIN() == value) // If the value is found
          {
             found = true;          // Set the flag 
             position = index;      // Record the value's subscript 
          }
          index++;                  // Go to the next element 
       }
       return position;             // Return the position
    }// End search 
    
    //Sort Array
    void selectionSort(int array[], int size)
    {
        int startScan, minIndex, minValue;
    
        for (startScan = 0; startScan < (size - 1); startScan++)
        {
            minIndex = startScan;
            minValue = array[startScan];
            for(int index = startScan + 1; index < size; index++)
            {
                if (array[index] < minValue)
                {
                    minValue = array[index];
                    minIndex = index;
                }
          }
            array[minIndex] = array[startScan];
            array[startScan] = minValue;
        }
    }
    
    
    int search(Car[], int, int);
    void selectionSort(Car[], int, int);
    void showArray(Car[], int, int);
    
    int main() {
            
        const int SIZE = 9;
                
        //Array of 9 cars
        Car Car_array[SIZE] = { Car("Porsche", "911", "Silver", 2005, 18990, 1237362727), 
                                Car("Ford", "Mustang", "Red", 2007, 49842, 7337372239),
                                Car("Chevrolet", "Beretta", "Black", 1989, 90332, 2873644922),
                                Car("Ford", "Focus", "White", 2008, 150, 9236498273),
                                Car("Voltzwagon", "Jetta", "Black", 2006, 28002, 4673992056),
                                Car("Rolls Royce", "Ghost", "Silver", 2005, 10000, 9292983855),
                                Car("Mazda", "626", "Blue", 2002, 84754, 7364646463),
                                Car("Toyota", "Camry", "Red", 2004, 50332, 2133737227),
                                Car("Bugatti", "Veyron 16.4", "White", 2010, 5, 5712893401)};
    
        
        long long int manualVIN= 2873644922;
        long long int desiredVIN;
        int posLin; // Used to search for VIN 2873644922
        int pos;  // Used for when user wil input the vin they want to search
    
        //MANUAL LINEAR SEARCH FOR VIN NUMBER
        
            posLin = search(Car_array, SIZE, manualVIN); 
    
            if (posLin == -1)
                cout << "You do not have a car with the VIN Number 2873644922.\n";
            else 
            {
                cout << "You do have a car on the lot with the VIN Number 2873644922.\n";
            }
            cout << "_______________________________________________________\n";
        // END MANUAL LINEAR SEARCH FOR VIN NUMBER
    
        // Get the VIN to search for
    
         // LINEAR SEARCH FOR VIN NUMBER
            cout << "Enter a VIN number to search for: ";
            cin >> desiredVIN;
    
        // Linear Search for VIN Number
            pos = search(Car_array, SIZE, desiredVIN); 
    
            if (pos == -1)
                cout << "You do not have a car with the VIN Number " << desiredVIN << ".\n";
            else 
            {
                cout << "You do have a car on the lot with the VIN Number " << desiredVIN << ".\n";
            }
            cout << "_______________________________________________________\n";
    
         // END LINEAR SEARCH FOR VIN NUMBER
        
        // Loop to display car details
            for (int x=0; x<9; x++) {
                Car_array[x].car_details();
            }
    
            cout << "_______________________________________________________\n";
    
    
            //Selection Sort
    
            cout << " This is the Array of Cars in a selection sort!!\n\n";
    
            //Sort the Array
            selectionSort(Car_array, SIZE, Car::getMileage);
    
            //Display 
            showArray();
            
            //Show Array
    
            void showArray();
            {
                for (int x=0; x<9; x++) {
                        Car_array[x].car_details();
                    }
            }
            return 0;
    
    }
    
    Oh and I am sorting based on mileage!
     
  11. Mar 2, 2010 at 2:13 PM
    #11
    tarheelfan_08

    tarheelfan_08 [OP] Carolina Alliance

    Joined:
    Jan 4, 2008
    Member:
    #4098
    Messages:
    2,944
    Gender:
    Male
    First Name:
    Justin
    North Carolina
    Vehicle:
    2010 White 4x4 Double Cab Tacoma Short Bed
    Chrome Grill, Chrome accessories(door handles and mirror covers), LEER Super White Cover, Mirrors with Turn Signals, Window Vent Visors, Step Rails, WeatherTech Digital Floor Mats, Mini Maglight Holder, Chrome Bull Bar
    Can someone please tell me what I am doing wrong...this will not sort by mileage and then print it

    Code:
    
    #include "CarClass.h"
    using namespace std;
    
    //Set up Search 
    int search(Car object[], int size, int value)
    {
       int index = 0;         // Used as a subscript to search array 
       int position = -1;     // Used to record position of search value 
       bool found = false;    // Flag to indicate if the value was found 
    
       while (index < size && !found)
       {
          if (object[index].getVIN() == value) // If the value is found
          {
             found = true;          // Set the flag 
             position = index;      // Record the value's subscript 
          }
          index++;                  // Go to the next element 
       }
       return position;             // Return the position
    }// End search 
    
    //Sort Array
    void selectionSort(Car object[], int size, int value)
    {
        int startScan, minIndex, minValue;
    
        for (startScan = 0; startScan < (size - 1); startScan++)
        {
            minIndex = startScan;
            minValue = array[startScan];
            for(int index = startScan + 1; index < size; index++)
            {
                if (array[index] < minValue)
                {
                    minValue = array[index];
                    minIndex = index;
                }
          }
            array[minIndex] = array[startScan];
            array[startScan] = minValue;
        }
    }
    
    
    int search(Car[], int, int);
    void selectionSort(Car[], int, int);
    void showArray();
    int main() {
            
        const int SIZE = 9;
                
        //Array of 9 cars
        Car Car_array[SIZE] = { Car("Porsche", "911", "Silver", 2005, 18990, 1237362727), 
                                Car("Ford", "Mustang", "Red", 2007, 49842, 7337372239),
                                Car("Chevrolet", "Beretta", "Black", 1989, 90332, 2873644922),
                                Car("Ford", "Focus", "White", 2008, 150, 9236498273),
                                Car("Voltzwagon", "Jetta", "Black", 2006, 28002, 4673992056),
                                Car("Rolls Royce", "Ghost", "Silver", 2005, 10000, 9292983855),
                                Car("Mazda", "626", "Blue", 2002, 84754, 7364646463),
                                Car("Toyota", "Camry", "Red", 2004, 50332, 2133737227),
                                Car("Bugatti", "Veyron 16.4", "White", 2010, 5, 5712893401)};
    
        
        long long int manualVIN= 2873644922;
        long long int desiredVIN;
        int posLin; // Used to search for VIN 2873644922
        int pos;  // Used for when user wil input the vin they want to search
    
        //MANUAL LINEAR SEARCH FOR VIN NUMBER
        
            posLin = search(Car_array, SIZE, manualVIN); 
    
            if (posLin == -1)
                cout << "You do not have a car with the VIN Number 2873644922.\n";
            else 
            {
                cout << "You do have a car on the lot with the VIN Number 2873644922.\n";
            }
            cout << "_______________________________________________________\n";
        // END MANUAL LINEAR SEARCH FOR VIN NUMBER
    
        // Get the VIN to search for
    
         // LINEAR SEARCH FOR VIN NUMBER
            cout << "Enter a VIN number to search for: ";
            cin >> desiredVIN;
    
        // Linear Search for VIN Number
            pos = search(Car_array, SIZE, desiredVIN); 
    
            if (pos == -1)
                cout << "You do not have a car with the VIN Number " << desiredVIN << ".\n";
            else 
            {
                cout << "You do have a car on the lot with the VIN Number " << desiredVIN << ".\n";
            }
            cout << "_______________________________________________________\n";
    
         // END LINEAR SEARCH FOR VIN NUMBER
        
        // Loop to display car details
            for (int x=0; x<9; x++) {
                Car_array[x].car_details();
            }
    
            cout << "_______________________________________________________\n";
    
    
            //Selection Sort
    
            cout << " This is the Array of Cars in a selection sort!!\n\n";
    
            //Sort the Array
            selectionSort(Car_array, SIZE, Car::getMileage);
    
            //Display 
            showArray();
            
            //Show Array
    
            void showArray();
            {
                for (int x=0; x<9; x++) {
                        Car_array[x].car_details();
                    }
            }
            return 0;
    
    }
    
    
     
  12. Mar 2, 2010 at 6:20 PM
    #12
    tarheelfan_08

    tarheelfan_08 [OP] Carolina Alliance

    Joined:
    Jan 4, 2008
    Member:
    #4098
    Messages:
    2,944
    Gender:
    Male
    First Name:
    Justin
    North Carolina
    Vehicle:
    2010 White 4x4 Double Cab Tacoma Short Bed
    Chrome Grill, Chrome accessories(door handles and mirror covers), LEER Super White Cover, Mirrors with Turn Signals, Window Vent Visors, Step Rails, WeatherTech Digital Floor Mats, Mini Maglight Holder, Chrome Bull Bar
    This part of the code works, I just need to figure out how to add a sectional sort to it based of off mileage.

    Code:
    #include "CarClass.h"
    using namespace std;
    
    //Set up Search 
    int search(Car object[], int size, int value)
    {
       int index = 0;         // Used as a subscript to search array 
       int position = -1;     // Used to record position of search value 
       bool found = false;    // Flag to indicate if the value was found 
    
       while (index < size && !found)
       {
          if (object[index].getVIN() == value) // If the value is found
          {
             found = true;          // Set the flag 
             position = index;      // Record the value's subscript 
          }
          index++;                  // Go to the next element 
       }
       return position;             // Return the position
    }// End search 
    
    //Sort Array
    void selectionSort(array[], int size)
    
    {
    int startScan, minIndex, minValue;
    
    for (startScan = 0; startScan < (size - 1); startScan++)
    {
        minIndex = startScan;
        minValue = array[startScan];
            for(int index = startScan + 1; index < size; index++)
        {
            if (array[index].VIN < minValue)
    
        {
            minValue = array[index];
            minIndex = index;
        }
        }
            array[minIndex] = array[startScan];
            array[startScan] = minValue;
        }
        }
    
    
    int search(Car[], int, int);
    void selectionSort(array[], int);
    void showArray();
    int main() {
            
        const int SIZE = 9;
                
        //Array of 9 cars
        Car Car_array[SIZE] = { Car("Porsche", "911", "Silver", 2005, 18990, 1237362727), 
                                Car("Ford", "Mustang", "Red", 2007, 49842, 7337372239),
                                Car("Chevrolet", "Beretta", "Black", 1989, 90332, 2873644922),
                                Car("Ford", "Focus", "White", 2008, 150, 9236498273),
                                Car("Voltzwagon", "Jetta", "Black", 2006, 28002, 4673992056),
                                Car("Rolls Royce", "Ghost", "Silver", 2005, 10000, 9292983855),
                                Car("Mazda", "626", "Blue", 2002, 84754, 7364646463),
                                Car("Toyota", "Camry", "Red", 2004, 50332, 2133737227),
                                Car("Bugatti", "Veyron 16.4", "White", 2010, 5, 5712893401)};
    
        
        long long int manualVIN= 2873644922;
        long long int desiredVIN;
        int posLin; // Used to search for VIN 2873644922
        int pos;  // Used for when user wil input the vin they want to search
    
        //MANUAL LINEAR SEARCH FOR VIN NUMBER
        
            posLin = search(Car_array, SIZE, manualVIN); 
    
            if (posLin == -1)
                cout << "You do not have a car with the VIN Number 2873644922.\n";
            else 
            {
                cout << "You do have a car on the lot with the VIN Number 2873644922.\n";
            }
            cout << "_______________________________________________________\n";
        // END MANUAL LINEAR SEARCH FOR VIN NUMBER
    
        // Get the VIN to search for
    
         // LINEAR SEARCH FOR VIN NUMBER
            cout << "Enter a VIN number to search for: ";
            cin >> desiredVIN;
    
        // Linear Search for VIN Number
            pos = search(Car_array, SIZE, desiredVIN); 
    
            if (pos == -1)
                cout << "You do not have a car with the VIN Number " << desiredVIN << ".\n";
            else 
            {
                cout << "You do have a car on the lot with the VIN Number " << desiredVIN << ".\n";
            }
            cout << "_______________________________________________________\n";
    
         // END LINEAR SEARCH FOR VIN NUMBER
        
        // Loop to display car details
            for (int x=0; x<9; x++) {
                Car_array[x].car_details();
            }
    
            cout << "_______________________________________________________\n";
    
    
            //Selection Sort
    
            cout << " This is the Array of Cars in a selection sort!!\n\n";
    
            //Sort the Array
            selectionSort(Car_array, SIZE);
    
            //Display 
            showArray();
            
            //Show Array
    
            void showArray();
            {
                for (int x=0; x<9; x++) {
                        Car_array[x].car_details();
                    }
            }
            return 0;
    
    }
    
     
  13. Mar 2, 2010 at 8:24 PM
    #13
    Evil Monkey

    Evil Monkey There's an evil monkey in my truck

    Joined:
    Aug 8, 2007
    Member:
    #2352
    Messages:
    8,262
    Gender:
    Male
    First Name:
    Robert
    Escondido, CA
    Vehicle:
    07 4x4 DC SR5 TRD Off-road
    Weathertech front & rear mats, rear suspension TSB, Toytec AAL for TSB, Hi-Lift Jack, Bilstein 5100 & Toytec Adjustable coilovers, Built Right UCAs, KMC XD 795 Hoss Wheels, Definity Dakota MTs 285/75R16, Leer XR, Thule Tracker II & Thule MOAB basket
    You just need to compare two car objects and swap them in the array. You do that with a double for loop. You'll need a temp place holder during the swap so you don't lose the object.

    Here's the flow with a selection sort:
    iteration 1: (outer for-loop) select the first car, (inner for loop) then go down the list with each car following it in the array and swap it with the first one if it is smaller. (end inner for loop) (end outer for-loop) at the end of the first iteration, the smallest mileage number will be in position 0
    iteration 2: (begin outer for-loop run 2) you move down to the second one and repeat the search, ignoring the first slot because it is already the smallest based on the first iteration of the for-loop.

    repeat until you've run through all the cars

    pseudo-code
    Code:
    car temp =0;
    //we'll stop at size-1 vs size because we're comparing i to the one following it.  At size -1, it'll be sorted.
    for (i = 0; i<size-1; i++;)
    {
       //k starts at i+1 because we're comparing i with the ones after it.
       //if we started k at 0, we'd just be comparing an object to itself car[0]>car[0]?
       for (k=i+1; k<size; k++;)
       {
            //compare them
            if mileage of the car at i > than the mileage of the car at k
            {
                 move the car[i] into the temporary placeholder so you don't lose it
                 move the lower valued car[k] to car[i]'s slot
                 move the temporary placeholder car to car[k]'s old slot
            }
            increment to the next car[k]
        }
        increment to the next car[i] and repeat
    }
     
  14. Mar 2, 2010 at 8:28 PM
    #14
    tarheelfan_08

    tarheelfan_08 [OP] Carolina Alliance

    Joined:
    Jan 4, 2008
    Member:
    #4098
    Messages:
    2,944
    Gender:
    Male
    First Name:
    Justin
    North Carolina
    Vehicle:
    2010 White 4x4 Double Cab Tacoma Short Bed
    Chrome Grill, Chrome accessories(door handles and mirror covers), LEER Super White Cover, Mirrors with Turn Signals, Window Vent Visors, Step Rails, WeatherTech Digital Floor Mats, Mini Maglight Holder, Chrome Bull Bar

    Sweet, I will work on this some more tom...and post what i did!
     
  15. Mar 3, 2010 at 7:03 PM
    #15
    tarheelfan_08

    tarheelfan_08 [OP] Carolina Alliance

    Joined:
    Jan 4, 2008
    Member:
    #4098
    Messages:
    2,944
    Gender:
    Male
    First Name:
    Justin
    North Carolina
    Vehicle:
    2010 White 4x4 Double Cab Tacoma Short Bed
    Chrome Grill, Chrome accessories(door handles and mirror covers), LEER Super White Cover, Mirrors with Turn Signals, Window Vent Visors, Step Rails, WeatherTech Digital Floor Mats, Mini Maglight Holder, Chrome Bull Bar
    Evil Monkey, is this what you was talking about?? If not then please assist me if you do not mind!

    Code:
    #include "CarClass.h"
    using namespace std;
    
    //Set up Search 
    int search(Car object[], int size, int value)
    {
       int index = 0;         // Used as a subscript to search array 
       int position = -1;     // Used to record position of search value 
       bool found = false;    // Flag to indicate if the value was found 
    
       while (index < size && !found)
       {
          if (object[index].getVIN() == value) // If the value is found
          {
             found = true;          // Set the flag 
             position = index;      // Record the value's subscript 
          }
          index++;                  // Go to the next element 
       }
       return position;             // Return the position
    }// End search 
    
    
    int search(Car[], int, int);
    void selectionSort(Car[], int);
    void showArray(Car[], int);
    
    int main() {
            
        const int SIZE = 9;
                
        //Array of 9 cars
        Car Car_array[SIZE] = { Car("Porsche", "911", "Silver", 2005, 18990, 1237362727), 
                                Car("Ford", "Mustang", "Red", 2007, 49842, 7337372239),
                                Car("Chevrolet", "Beretta", "Black", 1989, 90332, 2873644922),
                                Car("Ford", "Focus", "White", 2008, 150, 9236498273),
                                Car("Voltzwagon", "Jetta", "Black", 2006, 28002, 4673992056),
                                Car("Rolls Royce", "Ghost", "Silver", 2005, 10000, 9292983855),
                                Car("Mazda", "626", "Blue", 2002, 84754, 7364646463),
                                Car("Toyota", "Camry", "Red", 2004, 50332, 2133737227),
                                Car("Bugatti", "Veyron 16.4", "White", 2010, 5, 5712893401)};
    
        
        long long int manualVIN= 2873644922;
        long long int desiredVIN;
        int posLin; // Used to search for VIN 2873644922
        int pos;  // Used for when user wil input the vin they want to search
        int temp;
        int sort;
        //MANUAL LINEAR SEARCH FOR VIN NUMBER
        
            posLin = search(Car_array, SIZE, manualVIN); 
    
            if (posLin == -1)
                cout << "You do not have a car with the VIN Number 2873644922.\n";
            else 
            {
                cout << "You do have a car on the lot with the VIN Number 2873644922.\n";
            }
            cout << "_______________________________________________________\n";
        // END MANUAL LINEAR SEARCH FOR VIN NUMBER
    
        // Get the VIN to search for
    
         // LINEAR SEARCH FOR VIN NUMBER
            cout << "Enter a VIN number to search for: ";
            cin >> desiredVIN;
    
        // Linear Search for VIN Number
            pos = search(Car_array, SIZE, desiredVIN); 
    
            if (pos == -1)
                cout << "You do not have a car with the VIN Number " << desiredVIN << ".\n";
            else 
            {
                cout << "You do have a car on the lot with the VIN Number " << desiredVIN << ".\n";
            }
            cout << "_______________________________________________________\n";
    
         // END LINEAR SEARCH FOR VIN NUMBER
        
        // Loop to display car details
            for (int x=0; x<9; x++) {
                Car_array[x].car_details();
            }
    
            cout << "_______________________________________________________\n";
    
    
            //Selection Sort
    
            cout << " This is the Array of Cars in a selection sort!!\n\n";
    
            temp = 0;
            for (int i = 0; i < SIZE-1; i++)
            {
                for (int k = i+1; k < SIZE; k++)
                {
                    if (i > k)
                        (i = temp;
                        k = i;
                        temp = k;
                    else {
                        i = 0;
                    }
                }
            }
    
            int getSort() {
                return sort;
            }
    
            return 0;
    
    }
    
    class
    Code:
    #include <iostream>
    #include <fstream>
    #include <iomanip>
    #include <functional>
    #include <algorithm>
    #include <string>
    #include <cstdlib>
    #include <sstream>
    using namespace std;
    
    //Vehicle Class
    class Car
    {
    protected:
        string make;  //make
        string model; // model
        string color;  // color
        int    year;  // year
        int mileage;  // miles on car
        long long int VIN;  //Vin Number of car
    
    public:
            //Constructor that will set information for a new car
        void New_vehicle (string a, string b, string c, int d, int e, int f) 
        {make = a; model = b; color = c; year = d; mileage = e; VIN = f;}
        
        Car(); //Default constructor
        Car(string, string, string, int, int,int);
        //mutator and accessor functions
        void setMake(string);
        void setModel(string);
        void setColor(string);
        void setYear(int);
        void setMileage(int);
        void setVIN(int);
    
        string getMake();
        string getModel();
        string getColor();
        int getYear();
        int getMileage();
        long long int getVIN();
    
        //Check mileage to see if valid
        void valid_mileage(int);
        void car_details();
        string string_car_details();
    };
    
    //Sets to default values
    Car::Car() {
        make = " ";
        model = " ";
        color = " ";
        year = 0;
        mileage = 0;
        VIN = 0;
    }
        // My Vehicle set up(Make, model, color, year, type,bedsize, bike, mileage)
    Car::Car(string make, string model, string color, int year, int mileage, int VIN) {
        Car::make =  make;
        Car::model = model;
        Car::color = color;
        Car::year = year;
        valid_mileage(mileage);
        Car::VIN = VIN;
    }
    
    void Car::setMake(string make) {
        Car::make = make;
    }
    
    void Car::setModel(string model) {
        Car::model = model;
    }
    
    void Car::setColor(string color) {
        Car::color = color;
    }
    
    void Car::setYear(int year) {
        Car::year = year;
    }
    
    void Car::setMileage(int mileage) {
        valid_mileage(mileage);
    }
    
    void Car::setVIN(int VIN) {
        Car::VIN = VIN;
    }
    
    
    string Car::getMake() {
        return make;
    }
    string Car::getModel() {
        return model;
    }
    string Car::getColor() {
        return color;
    }
    int Car::getYear() {
        return year;
    }
    int Car::getMileage() {
        return mileage;
    }
    
    long long int Car::getVIN() {
        return VIN;
    }
    
    
    void Car::valid_mileage(int mileage) {
        if (mileage>=0)
            Car::mileage=mileage;
        else {
            Car::mileage=0;
            cout << "WARNING! You have entered invalid mileage!\n";
        }
        }
    
        void Car::car_details() {
            cout << "The current car is a " << year << ' ' << color << ' '
                << make << ' ' << model << " with " << mileage << " miles.\n\n";
        }
    
        string Car::string_car_details() {
            stringstream buf;
            buf << "The current car is a " << year << ' ' << color << ' '
            << make << ' ' << model << " with " << mileage << " miles.\n\n";
            return buf.str();
        }
    
    
    
     
  16. Mar 4, 2010 at 7:13 AM
    #16
    Evil Monkey

    Evil Monkey There's an evil monkey in my truck

    Joined:
    Aug 8, 2007
    Member:
    #2352
    Messages:
    8,262
    Gender:
    Male
    First Name:
    Robert
    Escondido, CA
    Vehicle:
    07 4x4 DC SR5 TRD Off-road
    Weathertech front & rear mats, rear suspension TSB, Toytec AAL for TSB, Hi-Lift Jack, Bilstein 5100 & Toytec Adjustable coilovers, Built Right UCAs, KMC XD 795 Hoss Wheels, Definity Dakota MTs 285/75R16, Leer XR, Thule Tracker II & Thule MOAB basket
    Code:
    for (int i = 0; i < SIZE-1; i++)
            {
                for (int k = i+1; k < SIZE; k++)
                {
                    if (i > k)
                        (i = temp;
                        k = i;
                        temp = k;
                    else {
                        i = 0;
                    }
                }
            }
     
            
    This part of your code isn't doing anything with the cars, which is why it's not sorting. Instead of assigning i & k or comparing the variables i & k, use them to index your array of cars.


    notice the direction of the temp variable in my sample below. First you assign to the temp so that it holds something. Then you assign from it (3rd line) to put the item back in the array. In my prior example, I created the temp variable outside the for loops, but it might be better to create it inside the if block as it's not needed and it would be easier to spot a mistake as it wouldn't carry over from loop to loop. The downside is you're instantiating a new Car object with every iteration of the inner and outer loop which slows down the code.


    So, your swap code should look like this:

    temp=car; //put the car in slot i into a temp car object. temp now holds car i
    car=car[k]; //assign the car at position k to position i
    car[k]=temp; //put the temp car i into slot k. now the two objects are swapped in the array

    You also need to compare against the car's mileage, not the indexes in your if block.
    so,
    instead of:
    if(i>k)
    you would do:

    if(car.getMileage()>car[k].getMileage()) //if car i's mileage is greater than car k's swap them

    You also don't need the else block so take it out. If the car's mileage is not greater, it is smaller or equal to, so leave it as is.
     
  17. Mar 4, 2010 at 7:17 AM
    #17
    fletch aka

    fletch aka www.BeLikeBrit.org

    Joined:
    Jan 4, 2009
    Member:
    #12223
    Messages:
    7,080
    Gender:
    Male
    First Name:
    Gary
    Left Coast
    Vehicle:
    09 Magnetic Gray TRD OffRoad
    TRD cat back exhaust, TRD Cold Air Intake, differential breather mod' Hellwig rear sway bar, 16x8 TRD Ivan Stewart's, Michelin LTX A/T2, DTRL Stealth Mode Mod, custom "Texas Edition" shift knob, Sock's "Classic" bedside decals, MetalMiller custom grill emblem, 20% front tinted windows, tinted taillights, Viper alarm, ScanGauge II, Flyzeye Designs V2W Tacoma Interior LED lighting, de-mud flapped, de-badged, extra D-rings under bed bolts, WeatherTech ED floor mats, G4 Elite Fold a Cover ,Toyota bed mat, tailgate theft deterrent device and absolutely no plasti-dip!
  18. Mar 4, 2010 at 7:33 AM
    #18
    NetMonkey

    NetMonkey Well-Known Member

    Joined:
    Aug 14, 2008
    Member:
    #8536
    Messages:
    1,734
    Gender:
    Male
    Geogetown, TX
    Vehicle:
    2010, 4x4, DC, off-road, shortbed, automatic
    Toytec Ultimate Lift @ 3", Mickey Thompson MTZ's 285/75/16, Moto Metal 955b, rear 2" ALL, Marlin Crawler sliders
    heh.... you just made an infinate loop with that else statement :)
    also, you described a bubble sort, not a selection sort :)


    here is a selection sort:
    http://www.codecodex.com/wiki/index.php?title=Selection_sort

    Code:
    void selectionSort(int numbers[], int array_size)
    {
      int i, j;
      int min, temp;
     
      for (i = 0; i < array_size-1; i++)
      {
        min = i;
        for (j = i+1; j < array_size; j++)
        {
          if (numbers[j] < numbers[min])
            min = j;
        }
        temp = numbers[i];
        numbers[i] = numbers[min];
        numbers[min] = temp;
      }
    }
    


    here is a bubble sort:
    http://www.codecodex.com/wiki/Bubble_sort

    Code:
    void bubbleSort(int numbers[], int array_size)
    {
        int i, j, temp;
        for (i = 0; i < array_size-1; i++))
            for (j = i+1; j < array_size; j++))
                if (numbers[i] < numbers[j])
                {
                     temp = numbers[i];
                     numbers[i] = numbers[j];
                     numbers[i] = temp;
                 }
    }
    
    the algorithms are very similar and they both have a big O notaion of N^2.
     
  19. Mar 4, 2010 at 10:48 AM
    #19
    Evil Monkey

    Evil Monkey There's an evil monkey in my truck

    Joined:
    Aug 8, 2007
    Member:
    #2352
    Messages:
    8,262
    Gender:
    Male
    First Name:
    Robert
    Escondido, CA
    Vehicle:
    07 4x4 DC SR5 TRD Off-road
    Weathertech front & rear mats, rear suspension TSB, Toytec AAL for TSB, Hi-Lift Jack, Bilstein 5100 & Toytec Adjustable coilovers, Built Right UCAs, KMC XD 795 Hoss Wheels, Definity Dakota MTs 285/75R16, Leer XR, Thule Tracker II & Thule MOAB basket
    That was from his code. I just quoted it to show it's useless. For clarity's sake for the OP, it's because "i" is always 1 at the beginning of subsequent loops. "i" will never be greater than "k" since k initializes at i+1 so the else branch will always be entered setting "i" at 0. At the end of the first loop i is incremented to 1. "k" is initialized at 2, and "i" is again reset to 0 (because it's not greater than k).

    You're correct, it's been a while. My mistake. Both are very innefficient but my guess is selection sort was what he was asked to use.
     
  20. Mar 4, 2010 at 9:24 PM
    #20
    tarheelfan_08

    tarheelfan_08 [OP] Carolina Alliance

    Joined:
    Jan 4, 2008
    Member:
    #4098
    Messages:
    2,944
    Gender:
    Male
    First Name:
    Justin
    North Carolina
    Vehicle:
    2010 White 4x4 Double Cab Tacoma Short Bed
    Chrome Grill, Chrome accessories(door handles and mirror covers), LEER Super White Cover, Mirrors with Turn Signals, Window Vent Visors, Step Rails, WeatherTech Digital Floor Mats, Mini Maglight Holder, Chrome Bull Bar
    Thanks for the help guys!
     

Products Discussed in

To Top