Question: C++ code cpp file hpp file main file Secure https://oregonstate.instructure.com/courses/1674347/assignments/7242238?module... ao Write a class called Taxicab that has three int fhelds (data members) to store
Secure https://oregonstate.instructure.com/courses/1674347/assignments/7242238?module... ao Write a class called Taxicab that has three int fhelds (data members) to store its current x- and y-coordinates and the total distance it has driven so far. The class should have a constructor that takes two parameters and uses them to initialize the coordinates, and also initializes the odometer to zero. The class should have a default constructor that sets all three fields to zero. The data members of this class do nat need to be set bus ules utor Media eCoach lia Gallery after they are initialized, so this class doesn't need any set methods- therefore the constructors will directly assign values to the data members instead of calling set methods to do it. The class should have a get method for each data member. It should have a method called moveX that takes an int parameter that tells how far the Taxicab should shift left or right. It should have a method called moveY that takes an int parameter that tells how far the Taxicab should shift up or down. The Taxicab class might be used as follows: Taxicab cab1; Taxicab cab205, -8); cab1. movex(3); cab1.moveYC-4); cab1.moveXC-1); cout ks cab1.getDistance Traveled) c endl; cab2. moveYC) cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
