Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .README.md.un~
Binary file not shown.
43 changes: 43 additions & 0 deletions Jet.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// Created by Andres Paz
//
#include "Jet.h"

//default constructor
Jet::Jet(string brand, string model, string fuelType, int numEngines) {
setBrand(brand);
setModel(model);
setFuelType(fuelType);
setNumberOfEngines(numEngines);
}

//set function
void Jet::setNumberOfEngines(int numEngines) {
numberOfEngines = numEngines;
}

//get function
int Jet::getNumberOfEngines() {
return numberOfEngines;
}
//deconstructor
Jet::~Jet() = default;

//needed help implementing this
//Jet message
string Jet::toString() {
return "-> Jet\n" + PoweredVehicle::toString() + "\n\tNumber of engines: " +
to_string( getNumberOfEngines() );
}

//needed help implementing this
//mileage estimate -- creates a random num (40-100) and updates milage based on credentials
double Jet::mileageEstimate(double time) {
int r = rand() % 60+40;
double mileage = r * time;
if ( getNumberOfEngines() > 2 && fuelType == "Rocket" )
{
mileage += mileage * ( 5.5 * getNumberOfEngines() );
}
return mileage;
}
28 changes: 28 additions & 0 deletions Jet.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// Created by Andres Paz
//
#ifndef DRIVINGSIMULATOR_JET_H
#define DRIVINGSIMULATOR_JET_H

#include "PoweredVehicle.h"
#include "Vehicle.h"

class Jet : public PoweredVehicle {

public:
explicit Jet(string brand, string model, int numberOfEngines = 1);

virtual ~Jet();
int getEngineCount();
void setEngineCount(int gearCount);
int getEngineCount();

virtual string toString();
virtual ~Jet();
virtual double mileageEstimate(double time);
private:
int numberOfEngines;
};


#endif
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Name: Andres Paz Vicca
FSUID: aap17e
2 changes: 2 additions & 0 deletions README.md~
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Name: Andres Paz Vicca
FSUID: AAP17E
21 changes: 21 additions & 0 deletions Skateboard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// Created by Andres Paz
//
#ifndef DRIVINGSIMULATOR_SKATEBOARD_H
#define DRIVINGSIMULATOR_SKATEBOARD_H

#include "Vehicle.h"

class Skateboard : public Vehicle {

public:
explicit Skateboard(string brand, string model);


virtual string toString();
virtual double mileageEstimate(double time);
virtual ~Skateboard();
};


#endif
33 changes: 33 additions & 0 deletions Veoride.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// Created by Andres Paz
//
#include "Veoride.h"

Veoride::~Veoride() = default;

//default constructor
Veoride::Veoride(string brand, string model, string fuelType) {
setBrand(brand);
setModel(model);
setFuelType(fuelType);
}
//default construtor
Veoride::Veoride() {
setBrand("Cheapy");
setModel("30mph");
setFuelType("manpower/electric");
}


double Veoride::mileageEstimate(double time) {
double mileage = 5 * time;
if ( fuelType == "manpower/electric" )
{
mileage += mileage * 3;
}
return mileage;
}

string Veoride::toString() {
return "-> Veoride\n" + PoweredVehicle::toString();
}
25 changes: 25 additions & 0 deletions Veoride.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// Created by Andres Paz
//
#ifndef DRIVINGSIMULATOR_VEORIDE_H
#define DRIVINGSIMULATOR_VEORIDE_H

#include "PoweredVehicle.h"

#include <ctime>
#include <cstdlib>

class Scooter : public PoweredVehicle {

public:
Veoride();

explicit Veoride(string brand, string model, string fuelType);

virtual ~Veoride();
virtual double mileageEstimate(double time);
virtual string toString();
};


#endif
72 changes: 72 additions & 0 deletions docs/answers.txt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
a)
$ git push
Enumerating objects: 12, done.
Counting objects: 100% (12/12), done.
Delta compression using up to 4 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (10/10), 992 bytes | 82.00 KiB/s, done.
Total 10 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 1 local object.
To https://github.com/aap17e/assignment2.git
ebf1259..80c2e60 master -> master

b)
$ git shortlog -s
6 Esteban Parra
5 aap17e
=11 commits in total

c)
$ git log -- .gitignore

Date: Wed Sep 25 18:13:30 2019 -0400

d)
Makes sure your code changes are verified before delivering them to other developers
-Support quality assurance/code quality/integration/testing processes
-Better support for developers working in parallel

e)
The git log command displays committed snapshots. It lets you list the project history, filter it, and search for specific changes.
While git status lets you inspect the working directory and the staging area, git log only operates on the committed history.

f)
git log --follow -- vehicle.h


g)

git log --grep=file

h)

Inheritance is the mechanism of basing an object or class upon another object or class while
retaining similar implementation.

Polymorphism is a programming language's ability to process objects differently depending on
their data type or class. More specifically, it is the ability to redefine methods for derived classes

Encapsulation describes the idea of bundling data and methods that work on that data within one unit

i) Dictator and Lieutenants Workflow: ******Distributed development and integration.******8
One central/blessed repository:Everyone makes pull from this repository. Only the dictator can push to it.
•Dictator repository: Merges changes in the lieutenant repositories and solves any arising conflicts.
•Lieutenant repositories: Merges changes for some (not all) developers and solves conflicts. A developer
pushes changes to the assigned lieutenant repository.

Integration Manager WorkflowFrom: Each developer makes push to his/her own public repository,
and pull from the blessed/central repository.
Two repositories per developer(Public/private)
Integration conflict resolution are done by the integration manager.
(Centralized integration)Each developer makes pull and push to his/her own public repository.

j)

A team of developers would benefit from the Dictator and Lieutenants workflow since they can all commit their
changes to the same repository and solve any arising conflicts, the final product is clean since only the
dictator can push to it

Object Oriented Question)
It uses both encapsulation and polymorphism.

The simulater is using encapsulation by having classes that encompass functions and by separating the member data and functions into different levels of protection. On the other hand, virtual functions are being used in the vehicle and powered vehicle classes so it has polymorphism. the common function name serves the purpose of polymorphism
5 changes: 5 additions & 0 deletions docs/status.txt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)

nothing to commit, working tree clean