I\'m having issues with my new project. I included links to my previous project
ID: 3886982 • Letter: I
Question
I'm having issues with my new project. I included links to my previous project for context. This must be in C++. Let me know if you have any issues. Thak you for your time and have a great day!
Link to Previous Project Requirments
https://docs.google.com/document/d/190jKi6WR7jFKW5sOpkWhtjZPcfyEi1ZIafukW2MrFn0/edit?usp=sharing
This is a link to the my previous project Code
https://docs.google.com/document/d/1C1Bg_jaAJ2ofKWBsB_OE0C194LUk22NeCmmntymykY8/edit?usp=sharing
Current Project:
New Input File: (Agencies.txt)
Hertz 93619
2014 Toyota Tacoma 115.12 1
2012 Honda CRV 85.10 02015 Ford Fusion 90.89 0
2013 GMC Yukon 110.43 0
2009 Dodge Neon 45.25 1
Alamo 89502
2011 Toyota Rav4 65.02 1
2012 Mazda CX5 86.75 1
2016 Subaru Outback 71.27 0
2015 Ford F150 112.83 1
2010 Toyota Corolla 50.36 1
Budget 93035
2008 Ford Fiesta 42.48 0
2009 Dodge Charger 55.36 1
2012 Chevy Volt 89.03 0
2007 Subaru Legacy 59.19 0
2010 Nissan Maxima 51.68 1
Sample output for menu option 2:
Hertz 93619
2014 Toyota Tacoma , $115.12 per day , Available: true
2012 Honda CRV , $85.1 per day , Available: false
2015 Ford Fusion , $90.89 per day , Available: false
2013 GMC Yukon , $110.43 per day , Available: false
2009 Dodge Neon , $45.25 per day , Available: true
Alamo 89502
2011 Toyota Rav4 , $65.02 per day , Available: true
2012 Mazda CX5 , $86.75 per day , Available: true
2016 Subaru Outback , $71.27 per day , Available: false
2015 Ford F150 , $112.83 per day , Available: true
2010 Toyota Corolla , $50.36 per day , Available: true
Budget 93035
2008 Ford Fiesta , $42.48 per day , Available: false
2009 Dodge Charger , $55.36 per day , Available: true
2012 Chevy Volt , $89.03 per day , Available: false
2007 Subaru Legacy , $59.19 per day , Available: false
2010 Nissan Maxima , $51.68 per day , Available: true
Please let me know if you have any questions. Thank you very much for your help!
Description: This project will expand Project 2 by adding additional functionality, using pointers, and implementing abstract data types (ADTs) through classes. Pointers must be used for all array manipulation, including arrays with ADTs (structs, classes) e.g, rental cars, rental agencies. Pointers must be used in function prototypes and function parameter lists not square brackets. Make sure pointers (parameters list and function implementation). Square brackets are to be used only when (e.g.string copy, string compare, etc.) work with For this project, pointers can only be moved by conducting post/pre- in increment/decrement operations on them (ie., ++ or-), or by setting the pointer back to the base address using the array name. All pointers must be passed by value. Note Try to use the arrow operator (->) with Class Object pointers for member access, if you use such in your code.) The new functionality is as follows: You are given an updated data file (e.g. Agencies.txt) where there are 3 rental Car Agency locations, where each of the 3 locations (RentalAgency) has 5 cars (RentalCar). You will have similar menu options, but the functionality has been updated below. Note: using multiple helper functions to do smaller tasks will make this project significantly easier. You may want to create a function that will get a car from a location based on the location and car indices.Explanation / Answer
#include<iostream>
using namespace std;
//#default constant intial values..
const int year = 2001;
const string make = "Honda";
const string model = "City";
const float price = 4500000;
const bool available = true;
class RentalCar
{
//data members..
private://accessed with class
int m_year;
string m_make;
string m_model;
float m_price;
bool m_available;
public:
//default constructor..
//to set default values..
RentalCar()
{
m_year = year;
m_make = make;
m_model = model;
m_price = price;
m_available = available;
}
//parameterized constructor...
RentalCar(int y,string m,string mo,float p,bool a)
{
m_year = y;
m_make = m;
m_model = m;
m_price = p;
m_available = a;
}
//get methods to get the values of data members..
int get_year()
{
return m_year;
}
string get_make()
{
return m_make;
}
string get_model()
{
return m_model;
}
float get_price()
{
return m_price;
}
bool get_available()
{
return m_available;
}
//setter methods to reset the values of data members..
void set_year(int y)
{
m_year=y;
}
void set_make(string ma)
{
m_make=ma;
}
void set_model(string mo)
{
m_model=mo;
}
void set_price(float p)
{
m_price=p;
}
void set_available(bool a)
{
m_available=a;
}
//estimatedcost...method..estimates cost for given days.
float estimate_cost(int days)
{
return days*m_price
;
}
};
//RentalAgency struct
struct RentalAgency
{
string name;
int zipcode[5];
RentalCar inventory[5];
};
int main()
{
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.