SlideShare a Scribd company logo
1 of 21
Parking Ticket Simulator
For this assignment you will design a set of classes that work
together to simulate a police officer issuing a parking ticket.
The classes you should design are:
· The ParkedCar Class: This class should simulate a parked car.
The class’s responsibilities are:
· To know the car’s, make, model, color, license number, and
the number of minutes that the car has been parked.
· The ParkingMeter Class: This class should simulate a parking
meter. The class’s only responsibility is:
· To know the number of minutes of parking time that has bene
purchased.
· The ParkingTicket Class: The class should simulate a parking
ticket. The class’s responsibilities are:
· To report the make, model, color, and license number of the
illegally parked car
· To report the amount of the fine which is $25 for the first hour
or part of an hour that the car is illegally parked, plus $01 for
every additional hour or part of an hour that the car is illegally
parked part of an hour that the car is illegally parked.
· To report the name and badge number of the police officer
issuing the ticket.
· The PoliceOfficer Class: This class should simulate a police
officer inspecting parked cars. The class’s responsibility are:
· To know the police office’s name and badge number
· To examine a ParkedCar object and a ParkingMeter object,
and determine whether the car’s time has expired.
· To issue a parking ticket (generate a ParkingTicket object) if
the car’s time has expired.
Write a program that demonstrates hoe the classes collaborate.
Assignment Details
Case Study: Sergeant Lou Maynard
CJ345-2: Evaluate the implementation of problem-oriented
policing within criminal justice entities.
Before starting this assignment, please take a few minutes and
complete the practice learning activity associated with this
outcome.
Write a 2–4-page paper (excluding cover page) responding to
the following:
Read the case study on page 103 in Effective Police Supervision
and apply critical thinking to construct persuasive arguments as
to what you would you do if you were Sergeant Lou Maynard.
Use the questions at the end of the case study to help you
construct your paper and be sure to address the following:
1. Describe the motivational issues that exist.
2. The basic need drives for each officer.
3. Assess your management style and how it relates to Theory
X.
4. If your level of formal education, or the education of the
officers, would be an obstacle.
For assistance with this Assignment, refer to Chapter 4 of your
text.
(PLEASE NOTE: This essay may require outside research.)
You may consult the Kaplan Online Library, the internet, the
textbook, other course material, and any other outside resources
in supporting your task, using proper citations in APA style.
Directions for Submitting Your Case Study
Write your essay in a Word document and save it in a location
and with a name that you will remember. Be sure to include
your name, class, and section number in your essay. Submit
your Assignment by selecting the Unit 2: Assignment in the
Dropbox by the end of Unit 2.
Parking Ticket Code/ParkedCar.cppParking Ticket
Code/ParkedCar.cpp// Implementation file for the ParkedCar cla
ss
#include<iostream>
#include"ParkedCar.h"
usingnamespace std;
// Default Constructor
ParkedCar::ParkedCar()
{
make ="";
model ="";
color ="";
licenseNumber ="";
minutesParked =0;
}
// Constructor
// Parameters:
// mk The car's make.
// mod The car's model.
// col The car's color.
// lic The car's license number.
// min The number of minutes parked.
ParkedCar::ParkedCar(string mk, string mod, string col,
string lic,int min)
{
make = mk;
model = mod;
color = col;
licenseNumber = lic;
minutesParked = min;
}
// Copy constructor
ParkedCar::ParkedCar(constParkedCar&car2)
{
make = car2.make;
model = car2.model;
color = car2.color;
licenseNumber = car2.licenseNumber;
minutesParked = car2.minutesParked;
}
// print function
voidParkedCar::print()
{
cout <<"Car Information:n";
cout <<"tMake: "<< make << endl;
cout <<"tmodel: "<< model << endl;
cout <<"tColor: "<< color << endl;
cout <<"tLicense Number: "<< licenseNumber << endl;
cout <<"tMinutes Parked: "<< minutesParked << endl;
}
Parking Ticket Code/ParkedCar.h
// Specification file for the ParkedCar class
#ifndef PARKED_CAR_H
#define PARKED_CAR_H
#include<string>
using namespace std;
// ParkedCar class
class ParkedCar
{
private:
string make; // The car's make
string model; // The car's model
string color; // The car's color
string licenseNumber; // The car's license number
int minutesParked; // Minutes parked
public:
// Default constructor
ParkedCar();
// Constructor
ParkedCar(string, string, string, string, int);
// Copy constructor
ParkedCar(const ParkedCar &);
// Mutators
void setMake(string m)
{ make = m; }
void setModel(string m)
{ model = m; }
void setColor(string c)
{ color = c; }
void setLicenseNumber(string lic)
{ licenseNumber = lic; }
void setMinutesParked(int m)
{ minutesParked = m; }
// Accessors
string getMake() const
{ return make; }
string getModel() const
{ return model;}
string getColor() const
{ return color; }
string getLicenseNumber() const
{ return licenseNumber; }
int getMinutesParked() const
{ return minutesParked; }
// print function
void print();
};
#endif
Parking Ticket Code/ParkingMeter.h
// Specification file for the ParkingMeter class
#ifndef PARKING_METER_H
#define PARKING_METER_H
#include <iostream>
using namespace std;
// ParkingMeter class
class ParkingMeter
{
private:
int minutesPurchased; // Minutes purchased
public:
// Default constructor
ParkingMeter()
{ minutesPurchased = 0; }
// Constructor. The parameter m is
// the number of minutes purchased.
ParkingMeter(int m)
{ minutesPurchased = m; }
// Mutator
void setMinutesPurchased(int m)
{ minutesPurchased = m; }
// Accessor
int getMinutesPurchased() const
{ return minutesPurchased; }
// print function
void print()
{ cout << "Meter Information:n";
cout << "tMinutes Purchases: "
<< minutesPurchased << endl;
}
};
#endif
Parking Ticket Code/ParkingTicket.cppParking Ticket
Code/ParkingTicket.cpp// Implementation file for the ParkingTi
cket class
#include"ParkingTicket.h"
#include<iostream>
#include<iomanip>
usingnamespace std;
// Default constructor
ParkingTicket::ParkingTicket()
{
fine =0.0;
minutes =0;
}
// Constructor
// Parameters:
// aCar - A ParkedCar object.
// min - Minutes illegally parked.
ParkingTicket::ParkingTicket(ParkedCar aCar,int min)
{
car = aCar;
minutes = min;
// Calculate the fine.
calculateFine();
}
// Copy constructor
ParkingTicket::ParkingTicket(constParkingTicket&ticket2)
{
car = ticket2.car;
fine = ticket2.fine;
}
// calculateFine method
// This method calculates the amount of the parking fine.
voidParkingTicket::calculateFine()
{
// Get the time parked in hours.
double hours = minutes /60.0;
// Get the hours as an int.
int hoursAsInt =static_cast<int>(hours);
// If there was a portion of an hour, round up.
if((hours - hoursAsInt)>0)
hoursAsInt++;
// Assign the base fine.
fine = BASE_FINE;
// Add the additional hourly fines.
fine +=(hoursAsInt * HOURLY_FINE);
}
// print function
voidParkingTicket::print()
{
// Print car information.
car.print();
// Print ticket information.
cout <<"Ticket Information:n";
cout <<"tMinutes in violation: "<< minutes << endl;
cout <<"tFine: $ "<< setprecision(2)<< fixed
<< showpoint << fine << endl;
}
Parking Ticket Code/ParkingTicket.h
// Specification file for the ParkingTicket class
#ifndef PARKING_TICKET_H
#define PARKING_TICKET_H
#include "ParkedCar.h"
// Constant for the base fine.
const double BASE_FINE = 25.0;
// Constant for the additional hourly fine.
const double HOURLY_FINE = 10.0;
// ParkingTicket class
class ParkingTicket
{
private:
ParkedCar car; // The parked car
double fine; // The parking fine
int minutes; // Minutes illegally parked
// calculateFine method
// This method calculates the amount of the parking fine.
void calculateFine();
public:
// Default Constructor
ParkingTicket();
// Constructor
ParkingTicket(ParkedCar, int);
// Copy constructor
ParkingTicket(const ParkingTicket &);
// Mutators
void setCar(ParkedCar c)
{
car = c;
}
void setMinutes(int m)
{
minutes = m;
}
// Accessors
ParkedCar getCar() const
{
return car;
}
double getFine() const
{
return fine;
}
// print function
void print();
};
#endif
Parking Ticket Code/PoliceOfficer.cppParking Ticket
Code/PoliceOfficer.cpp// Implementation file for the PoliceOffi
cer class
#include"ParkedCar.h"
#include"ParkingMeter.h"
#include"ParkingTicket.h"
#include"PoliceOfficer.h"
#include<iostream>
usingnamespace std;
// The patrol function looks at the number of
// minutes a car has been parked and the number
// of minutes purchased. If the minutes parked is
// greater than the minutes purchased, a pointer
// to a ParkingTicket object is returned. Otherwise
// the function returns a nullptr.
ParkingTicket*PoliceOfficer::patrol(ParkedCar car,ParkingMete
r meter)
{
// Get the minutes parked over the amount purchased.
int illegalMinutes = car.getMinutesParked()-
meter.getMinutesPurchased();
// Determine whether the car is illegally parked.
if(illegalMinutes >0)
{
// Yes, it is illegally parked.
// Create a ParkingTicket object.
ticket =newParkingTicket(car, illegalMinutes);
}
// Return the ticket, if any.
return ticket;
}
// print function
voidPoliceOfficer::print()
{
cout <<"Police Officer Information:n";
cout <<"tName: "<< name << endl;
cout <<"tBadge Number: "<< badgeNumber << endl;
}
Parking Ticket Code/PoliceOfficer.h
// Specification file for the PoliceOfficer class
#ifndef POLICE_OFFICER_H
#define POLICE_OFFICER_H
#include "ParkedCar.h"
#include "ParkingMeter.h"
#include "ParkingTicket.h"
// PoliceOfficer class
class PoliceOfficer
{
private:
string name; // Officer's name
string badgeNumber; // Badge number
ParkingTicket *ticket; // Pointer to a ticket
public:
// Default constructor
PoliceOfficer()
{ name = ""; badgeNumber = ""; ticket = nullptr; }
// Constructor
// The parameter n is the officer's name.
// The parameter bn is the officer's badge number.
PoliceOfficer(string n, string bn)
{
name = n;
badgeNumber = bn;
ticket = nullptr;
}
// Copy constructor
PoliceOfficer(const PoliceOfficer &officer2)
{
name = officer2.name;
badgeNumber = officer2.badgeNumber;
ticket = new ParkingTicket(*officer2.ticket);
}
// Mutators
void setName(string n)
{
name = n;
}
void setBadgeNumber(string b)
{
badgeNumber = b;
}
// Accessors
string getName()
{
return name;
}
string getBadgeNumber()
{
return badgeNumber;
}
// patrol function
ParkingTicket *patrol(ParkedCar, ParkingMeter);
// print function
void print();
};
#endif
Parking Ticket Code/spc14-14.cppParking Ticket Code/spc14-
14.cpp// Chapter 14, Programming Challenge 14: Parking Ticket
Simulator
#include<iostream>
#include"ParkedCar.h"
#include"ParkingMeter.h"
#include"ParkingTicket.h"
#include"PoliceOfficer.h"
usingnamespace std;
int main()
{
// Create a ParkingTicket pointer. If a parking ticket
// is issued, this will point to it.
ParkingTicket*ticket =nullptr;
// Create a ParkedCar object.
// The car was parked for 125 minutes.
ParkedCar car("Volkswagen","1972","Red","147RHZM",125);
// Create a ParkingMeter object.
// 60 minutes were purchased.
ParkingMeter meter(60);
// Create a PoliceOfficer object.
PoliceOfficer officer("Joe Friday","4788");
// Let the officer patrol.
ticket = officer.patrol(car, meter);
if(ticket !=nullptr)
{
// Display the officer information.
officer.print();
// Display the ticket information.
ticket->print();
// We're done with the ticket, so delete it.
delete ticket;
ticket =nullptr;
}
else
cout <<"No crimes were committed.n";
return0;
}

More Related Content

What's hot

Les commandes CISCO (routeur)
Les commandes CISCO (routeur)Les commandes CISCO (routeur)
Les commandes CISCO (routeur)EL AMRI El Hassan
 
Presentation tunibourse
Presentation tuniboursePresentation tunibourse
Presentation tunibourseyesoun
 
Rapport med wahabi hamdi jan 2010
Rapport med wahabi hamdi jan 2010Rapport med wahabi hamdi jan 2010
Rapport med wahabi hamdi jan 2010Jihene Zahouna
 
Formation elastix
Formation elastixFormation elastix
Formation elastixbincoul
 
STM32F4+Android Application
STM32F4+Android ApplicationSTM32F4+Android Application
STM32F4+Android ApplicationHajer Dahech
 
Đồ án điện tử viễn thông Nghiên cứu về OPENSIPS - sdt/ ZALO 093 189 2701
Đồ án điện tử viễn thông Nghiên cứu về OPENSIPS - sdt/ ZALO 093 189 2701Đồ án điện tử viễn thông Nghiên cứu về OPENSIPS - sdt/ ZALO 093 189 2701
Đồ án điện tử viễn thông Nghiên cứu về OPENSIPS - sdt/ ZALO 093 189 2701Viết thuê báo cáo thực tập giá rẻ
 
Détection et suivi de virages routiers à partir de panneaux routiers indiquan...
Détection et suivi de virages routiers à partir de panneaux routiers indiquan...Détection et suivi de virages routiers à partir de panneaux routiers indiquan...
Détection et suivi de virages routiers à partir de panneaux routiers indiquan...Rabii Elbeji
 
Sécurité asterisk web
Sécurité asterisk webSécurité asterisk web
Sécurité asterisk webAgarik
 
Rapport stage ingenieur (2017)
Rapport stage ingenieur (2017)Rapport stage ingenieur (2017)
Rapport stage ingenieur (2017)Mohamed Boubaya
 
réaliser une plateforme d’automatisation et de génération des rapports de test
réaliser une plateforme d’automatisation et de génération des rapports de testréaliser une plateforme d’automatisation et de génération des rapports de test
réaliser une plateforme d’automatisation et de génération des rapports de testahmed oumezzine
 
Chapitre 4 heritage et polymorphisme
Chapitre 4 heritage et polymorphismeChapitre 4 heritage et polymorphisme
Chapitre 4 heritage et polymorphismeAmir Souissi
 
Parlez vous IoT - Présentation du protocole MQTT
Parlez vous IoT - Présentation du protocole MQTTParlez vous IoT - Présentation du protocole MQTT
Parlez vous IoT - Présentation du protocole MQTTArnaud Thorel
 

What's hot (20)

Les commandes CISCO (routeur)
Les commandes CISCO (routeur)Les commandes CISCO (routeur)
Les commandes CISCO (routeur)
 
Presentation tunibourse
Presentation tuniboursePresentation tunibourse
Presentation tunibourse
 
Đề tài: Công nghệ IPTV và khả năng phát triển ở Việt nam, HAY
Đề tài: Công nghệ IPTV và khả năng phát triển ở Việt nam, HAYĐề tài: Công nghệ IPTV và khả năng phát triển ở Việt nam, HAY
Đề tài: Công nghệ IPTV và khả năng phát triển ở Việt nam, HAY
 
Theses Soutenues sous Direction et Co-Direction du Pr YOUSSFI
Theses Soutenues sous Direction et Co-Direction du Pr YOUSSFITheses Soutenues sous Direction et Co-Direction du Pr YOUSSFI
Theses Soutenues sous Direction et Co-Direction du Pr YOUSSFI
 
Phasor series operating_manual
Phasor series operating_manualPhasor series operating_manual
Phasor series operating_manual
 
Envoi SMS JAVA
Envoi SMS JAVAEnvoi SMS JAVA
Envoi SMS JAVA
 
Rapport med wahabi hamdi jan 2010
Rapport med wahabi hamdi jan 2010Rapport med wahabi hamdi jan 2010
Rapport med wahabi hamdi jan 2010
 
Formation elastix
Formation elastixFormation elastix
Formation elastix
 
Rapport tp1 j2ee
Rapport tp1 j2eeRapport tp1 j2ee
Rapport tp1 j2ee
 
STM32F4+Android Application
STM32F4+Android ApplicationSTM32F4+Android Application
STM32F4+Android Application
 
Đồ án điện tử viễn thông Nghiên cứu về OPENSIPS - sdt/ ZALO 093 189 2701
Đồ án điện tử viễn thông Nghiên cứu về OPENSIPS - sdt/ ZALO 093 189 2701Đồ án điện tử viễn thông Nghiên cứu về OPENSIPS - sdt/ ZALO 093 189 2701
Đồ án điện tử viễn thông Nghiên cứu về OPENSIPS - sdt/ ZALO 093 189 2701
 
Détection et suivi de virages routiers à partir de panneaux routiers indiquan...
Détection et suivi de virages routiers à partir de panneaux routiers indiquan...Détection et suivi de virages routiers à partir de panneaux routiers indiquan...
Détection et suivi de virages routiers à partir de panneaux routiers indiquan...
 
Tests unitaires : Utilisation de la librairie CUnit
Tests unitaires : Utilisation de la librairie CUnitTests unitaires : Utilisation de la librairie CUnit
Tests unitaires : Utilisation de la librairie CUnit
 
Sécurité asterisk web
Sécurité asterisk webSécurité asterisk web
Sécurité asterisk web
 
Rapport stage ingenieur (2017)
Rapport stage ingenieur (2017)Rapport stage ingenieur (2017)
Rapport stage ingenieur (2017)
 
réaliser une plateforme d’automatisation et de génération des rapports de test
réaliser une plateforme d’automatisation et de génération des rapports de testréaliser une plateforme d’automatisation et de génération des rapports de test
réaliser une plateforme d’automatisation et de génération des rapports de test
 
Maven
MavenMaven
Maven
 
Création d'un botnet et défense
Création d'un botnet et défenseCréation d'un botnet et défense
Création d'un botnet et défense
 
Chapitre 4 heritage et polymorphisme
Chapitre 4 heritage et polymorphismeChapitre 4 heritage et polymorphisme
Chapitre 4 heritage et polymorphisme
 
Parlez vous IoT - Présentation du protocole MQTT
Parlez vous IoT - Présentation du protocole MQTTParlez vous IoT - Présentation du protocole MQTT
Parlez vous IoT - Présentation du protocole MQTT
 

Similar to Parking Ticket SimulatorFor this assignment you will design a se.docx

#includeiostream #includecmath #includestringusing na.pdf
 #includeiostream #includecmath #includestringusing na.pdf #includeiostream #includecmath #includestringusing na.pdf
#includeiostream #includecmath #includestringusing na.pdfanuradhaartjwellery
 
CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT )
CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT ) CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT )
CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT ) Mauryasuraj98
 
Software Engineer Screening Question - OOP
Software Engineer Screening Question - OOPSoftware Engineer Screening Question - OOP
Software Engineer Screening Question - OOPjason_scorebig
 
Parking ticket simulator program
Parking ticket simulator programParking ticket simulator program
Parking ticket simulator programDaman Toor
 
#include iostream #include string #include fstream std.docx
#include iostream #include string #include fstream  std.docx#include iostream #include string #include fstream  std.docx
#include iostream #include string #include fstream std.docxajoy21
 
Assignment DIn Problem D1 we will use a file to contain the dat.pdf
Assignment DIn Problem D1 we will use a file to contain the dat.pdfAssignment DIn Problem D1 we will use a file to contain the dat.pdf
Assignment DIn Problem D1 we will use a file to contain the dat.pdffasttrackscardecors
 
(7) cpp abstractions inheritance_part_ii
(7) cpp abstractions inheritance_part_ii(7) cpp abstractions inheritance_part_ii
(7) cpp abstractions inheritance_part_iiNico Ludwig
 
C#i need help creating the instance of stream reader to read from .pdf
C#i need help creating the instance of stream reader to read from .pdfC#i need help creating the instance of stream reader to read from .pdf
C#i need help creating the instance of stream reader to read from .pdfajantha11
 
#include iostream#include string#include iomanip#inclu.docx
#include iostream#include string#include iomanip#inclu.docx#include iostream#include string#include iomanip#inclu.docx
#include iostream#include string#include iomanip#inclu.docxmayank272369
 
(5) c sharp introduction_object_orientation_part_ii
(5) c sharp introduction_object_orientation_part_ii(5) c sharp introduction_object_orientation_part_ii
(5) c sharp introduction_object_orientation_part_iiNico Ludwig
 
ONLY EDIT CapacityOptimizer.java, Simulator.java, and TriangularD.pdf
ONLY EDIT  CapacityOptimizer.java, Simulator.java, and TriangularD.pdfONLY EDIT  CapacityOptimizer.java, Simulator.java, and TriangularD.pdf
ONLY EDIT CapacityOptimizer.java, Simulator.java, and TriangularD.pdfvinodagrawal6699
 
cbse 12 computer science investigatory project
cbse 12 computer science investigatory project  cbse 12 computer science investigatory project
cbse 12 computer science investigatory project D. j Vicky
 
cbse 12 computer science investigatory project
cbse 12 computer science investigatory project  cbse 12 computer science investigatory project
cbse 12 computer science investigatory project D. j Vicky
 
Goal The goal of this assignment is to help students understand the.pdf
Goal The goal of this assignment is to help students understand the.pdfGoal The goal of this assignment is to help students understand the.pdf
Goal The goal of this assignment is to help students understand the.pdfarsmobiles
 
Gift-VT Tools Development Overview
Gift-VT Tools Development OverviewGift-VT Tools Development Overview
Gift-VT Tools Development Overviewstn_tkiller
 
Volumetric efficiency  calculating your cars volumetric efficiency
Volumetric efficiency  calculating your cars volumetric efficiencyVolumetric efficiency  calculating your cars volumetric efficiency
Volumetric efficiency  calculating your cars volumetric efficiencyZulkarnian Nasrulllah
 
COIT20245, 2016 Term One - Page 1 of 9 Assessment detail.docx
COIT20245, 2016 Term One - Page 1 of 9 Assessment detail.docxCOIT20245, 2016 Term One - Page 1 of 9 Assessment detail.docx
COIT20245, 2016 Term One - Page 1 of 9 Assessment detail.docxclarebernice
 
C++ Program Auto workshop service system
C++ Program Auto workshop service systemC++ Program Auto workshop service system
C++ Program Auto workshop service systemShahzaib Farooq
 
cbse 12 computer science IP
cbse 12 computer science IPcbse 12 computer science IP
cbse 12 computer science IPD. j Vicky
 

Similar to Parking Ticket SimulatorFor this assignment you will design a se.docx (20)

#includeiostream #includecmath #includestringusing na.pdf
 #includeiostream #includecmath #includestringusing na.pdf #includeiostream #includecmath #includestringusing na.pdf
#includeiostream #includecmath #includestringusing na.pdf
 
CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT )
CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT ) CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT )
CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT )
 
Software Engineer Screening Question - OOP
Software Engineer Screening Question - OOPSoftware Engineer Screening Question - OOP
Software Engineer Screening Question - OOP
 
Parking ticket simulator program
Parking ticket simulator programParking ticket simulator program
Parking ticket simulator program
 
#include iostream #include string #include fstream std.docx
#include iostream #include string #include fstream  std.docx#include iostream #include string #include fstream  std.docx
#include iostream #include string #include fstream std.docx
 
Assignment DIn Problem D1 we will use a file to contain the dat.pdf
Assignment DIn Problem D1 we will use a file to contain the dat.pdfAssignment DIn Problem D1 we will use a file to contain the dat.pdf
Assignment DIn Problem D1 we will use a file to contain the dat.pdf
 
(7) cpp abstractions inheritance_part_ii
(7) cpp abstractions inheritance_part_ii(7) cpp abstractions inheritance_part_ii
(7) cpp abstractions inheritance_part_ii
 
C#i need help creating the instance of stream reader to read from .pdf
C#i need help creating the instance of stream reader to read from .pdfC#i need help creating the instance of stream reader to read from .pdf
C#i need help creating the instance of stream reader to read from .pdf
 
#include iostream#include string#include iomanip#inclu.docx
#include iostream#include string#include iomanip#inclu.docx#include iostream#include string#include iomanip#inclu.docx
#include iostream#include string#include iomanip#inclu.docx
 
(5) c sharp introduction_object_orientation_part_ii
(5) c sharp introduction_object_orientation_part_ii(5) c sharp introduction_object_orientation_part_ii
(5) c sharp introduction_object_orientation_part_ii
 
ONLY EDIT CapacityOptimizer.java, Simulator.java, and TriangularD.pdf
ONLY EDIT  CapacityOptimizer.java, Simulator.java, and TriangularD.pdfONLY EDIT  CapacityOptimizer.java, Simulator.java, and TriangularD.pdf
ONLY EDIT CapacityOptimizer.java, Simulator.java, and TriangularD.pdf
 
cbse 12 computer science investigatory project
cbse 12 computer science investigatory project  cbse 12 computer science investigatory project
cbse 12 computer science investigatory project
 
cbse 12 computer science investigatory project
cbse 12 computer science investigatory project  cbse 12 computer science investigatory project
cbse 12 computer science investigatory project
 
C# Programming Help
C# Programming HelpC# Programming Help
C# Programming Help
 
Goal The goal of this assignment is to help students understand the.pdf
Goal The goal of this assignment is to help students understand the.pdfGoal The goal of this assignment is to help students understand the.pdf
Goal The goal of this assignment is to help students understand the.pdf
 
Gift-VT Tools Development Overview
Gift-VT Tools Development OverviewGift-VT Tools Development Overview
Gift-VT Tools Development Overview
 
Volumetric efficiency  calculating your cars volumetric efficiency
Volumetric efficiency  calculating your cars volumetric efficiencyVolumetric efficiency  calculating your cars volumetric efficiency
Volumetric efficiency  calculating your cars volumetric efficiency
 
COIT20245, 2016 Term One - Page 1 of 9 Assessment detail.docx
COIT20245, 2016 Term One - Page 1 of 9 Assessment detail.docxCOIT20245, 2016 Term One - Page 1 of 9 Assessment detail.docx
COIT20245, 2016 Term One - Page 1 of 9 Assessment detail.docx
 
C++ Program Auto workshop service system
C++ Program Auto workshop service systemC++ Program Auto workshop service system
C++ Program Auto workshop service system
 
cbse 12 computer science IP
cbse 12 computer science IPcbse 12 computer science IP
cbse 12 computer science IP
 

More from danhaley45372

Your initial post should be 2-3 paragraphs in length.Inclu.docx
Your initial post should be 2-3 paragraphs in length.Inclu.docxYour initial post should be 2-3 paragraphs in length.Inclu.docx
Your initial post should be 2-3 paragraphs in length.Inclu.docxdanhaley45372
 
Your initial post should be made during Unit 2,  January 21st at 4.docx
Your initial post should be made during Unit 2,  January 21st at 4.docxYour initial post should be made during Unit 2,  January 21st at 4.docx
Your initial post should be made during Unit 2,  January 21st at 4.docxdanhaley45372
 
Your initial post should be at least 450+ words and in APA forma.docx
Your initial post should be at least 450+ words and in APA forma.docxYour initial post should be at least 450+ words and in APA forma.docx
Your initial post should be at least 450+ words and in APA forma.docxdanhaley45372
 
Your initial post should be made during Unit 2, january 21st at 4.docx
Your initial post should be made during Unit 2, january 21st at 4.docxYour initial post should be made during Unit 2, january 21st at 4.docx
Your initial post should be made during Unit 2, january 21st at 4.docxdanhaley45372
 
Your initial post should be made during, Submissions after this time.docx
Your initial post should be made during, Submissions after this time.docxYour initial post should be made during, Submissions after this time.docx
Your initial post should be made during, Submissions after this time.docxdanhaley45372
 
Your essay should address the following.(a) How  is the biologic.docx
Your essay should address the following.(a) How  is the biologic.docxYour essay should address the following.(a) How  is the biologic.docx
Your essay should address the following.(a) How  is the biologic.docxdanhaley45372
 
Your initial post is due by midnight (1159 PM) on Thursday. You mus.docx
Your initial post is due by midnight (1159 PM) on Thursday. You mus.docxYour initial post is due by midnight (1159 PM) on Thursday. You mus.docx
Your initial post is due by midnight (1159 PM) on Thursday. You mus.docxdanhaley45372
 
Your individual sub-topic written (MIN of 1, MAX 3 pages)You.docx
Your individual sub-topic written (MIN of 1, MAX 3 pages)You.docxYour individual sub-topic written (MIN of 1, MAX 3 pages)You.docx
Your individual sub-topic written (MIN of 1, MAX 3 pages)You.docxdanhaley45372
 
Your HR project to develop a centralized model of deliveri.docx
Your HR project to develop a centralized model of deliveri.docxYour HR project to develop a centralized model of deliveri.docx
Your HR project to develop a centralized model of deliveri.docxdanhaley45372
 
Your Immersion Project for this course is essentially ethnographic r.docx
Your Immersion Project for this course is essentially ethnographic r.docxYour Immersion Project for this course is essentially ethnographic r.docx
Your Immersion Project for this course is essentially ethnographic r.docxdanhaley45372
 
Your country just overthrew its dictator, and you are the newly .docx
Your country just overthrew its dictator, and you are the newly .docxYour country just overthrew its dictator, and you are the newly .docx
Your country just overthrew its dictator, and you are the newly .docxdanhaley45372
 
Your have been contracted by HealthFirst Hospital Foundation (HHF),.docx
Your have been contracted by HealthFirst Hospital Foundation (HHF),.docxYour have been contracted by HealthFirst Hospital Foundation (HHF),.docx
Your have been contracted by HealthFirst Hospital Foundation (HHF),.docxdanhaley45372
 
Your group presentationWhat you need to do.docx
Your group presentationWhat you need to do.docxYour group presentationWhat you need to do.docx
Your group presentationWhat you need to do.docxdanhaley45372
 
Your contribution(s) must add significant information to the dis.docx
Your contribution(s) must add significant information to the dis.docxYour contribution(s) must add significant information to the dis.docx
Your contribution(s) must add significant information to the dis.docxdanhaley45372
 
Your good friends have just adopted a four-year-old child. At th.docx
Your good friends have just adopted a four-year-old child. At th.docxYour good friends have just adopted a four-year-old child. At th.docx
Your good friends have just adopted a four-year-old child. At th.docxdanhaley45372
 
Your good friends have just adopted a four-year-old child. At this p.docx
Your good friends have just adopted a four-year-old child. At this p.docxYour good friends have just adopted a four-year-old child. At this p.docx
Your good friends have just adopted a four-year-old child. At this p.docxdanhaley45372
 
Your goals as the IT architect and IT security specialist are to.docx
Your goals as the IT architect and IT security specialist are to.docxYour goals as the IT architect and IT security specialist are to.docx
Your goals as the IT architect and IT security specialist are to.docxdanhaley45372
 
Your essay should address the following problem.(a) What is .docx
Your essay should address the following problem.(a) What is .docxYour essay should address the following problem.(a) What is .docx
Your essay should address the following problem.(a) What is .docxdanhaley45372
 
Your future financial needs will be based on the income you can reas.docx
Your future financial needs will be based on the income you can reas.docxYour future financial needs will be based on the income you can reas.docx
Your future financial needs will be based on the income you can reas.docxdanhaley45372
 
Your friend Lydia is having difficulty taking in the informati.docx
Your friend Lydia is having difficulty taking in the informati.docxYour friend Lydia is having difficulty taking in the informati.docx
Your friend Lydia is having difficulty taking in the informati.docxdanhaley45372
 

More from danhaley45372 (20)

Your initial post should be 2-3 paragraphs in length.Inclu.docx
Your initial post should be 2-3 paragraphs in length.Inclu.docxYour initial post should be 2-3 paragraphs in length.Inclu.docx
Your initial post should be 2-3 paragraphs in length.Inclu.docx
 
Your initial post should be made during Unit 2,  January 21st at 4.docx
Your initial post should be made during Unit 2,  January 21st at 4.docxYour initial post should be made during Unit 2,  January 21st at 4.docx
Your initial post should be made during Unit 2,  January 21st at 4.docx
 
Your initial post should be at least 450+ words and in APA forma.docx
Your initial post should be at least 450+ words and in APA forma.docxYour initial post should be at least 450+ words and in APA forma.docx
Your initial post should be at least 450+ words and in APA forma.docx
 
Your initial post should be made during Unit 2, january 21st at 4.docx
Your initial post should be made during Unit 2, january 21st at 4.docxYour initial post should be made during Unit 2, january 21st at 4.docx
Your initial post should be made during Unit 2, january 21st at 4.docx
 
Your initial post should be made during, Submissions after this time.docx
Your initial post should be made during, Submissions after this time.docxYour initial post should be made during, Submissions after this time.docx
Your initial post should be made during, Submissions after this time.docx
 
Your essay should address the following.(a) How  is the biologic.docx
Your essay should address the following.(a) How  is the biologic.docxYour essay should address the following.(a) How  is the biologic.docx
Your essay should address the following.(a) How  is the biologic.docx
 
Your initial post is due by midnight (1159 PM) on Thursday. You mus.docx
Your initial post is due by midnight (1159 PM) on Thursday. You mus.docxYour initial post is due by midnight (1159 PM) on Thursday. You mus.docx
Your initial post is due by midnight (1159 PM) on Thursday. You mus.docx
 
Your individual sub-topic written (MIN of 1, MAX 3 pages)You.docx
Your individual sub-topic written (MIN of 1, MAX 3 pages)You.docxYour individual sub-topic written (MIN of 1, MAX 3 pages)You.docx
Your individual sub-topic written (MIN of 1, MAX 3 pages)You.docx
 
Your HR project to develop a centralized model of deliveri.docx
Your HR project to develop a centralized model of deliveri.docxYour HR project to develop a centralized model of deliveri.docx
Your HR project to develop a centralized model of deliveri.docx
 
Your Immersion Project for this course is essentially ethnographic r.docx
Your Immersion Project for this course is essentially ethnographic r.docxYour Immersion Project for this course is essentially ethnographic r.docx
Your Immersion Project for this course is essentially ethnographic r.docx
 
Your country just overthrew its dictator, and you are the newly .docx
Your country just overthrew its dictator, and you are the newly .docxYour country just overthrew its dictator, and you are the newly .docx
Your country just overthrew its dictator, and you are the newly .docx
 
Your have been contracted by HealthFirst Hospital Foundation (HHF),.docx
Your have been contracted by HealthFirst Hospital Foundation (HHF),.docxYour have been contracted by HealthFirst Hospital Foundation (HHF),.docx
Your have been contracted by HealthFirst Hospital Foundation (HHF),.docx
 
Your group presentationWhat you need to do.docx
Your group presentationWhat you need to do.docxYour group presentationWhat you need to do.docx
Your group presentationWhat you need to do.docx
 
Your contribution(s) must add significant information to the dis.docx
Your contribution(s) must add significant information to the dis.docxYour contribution(s) must add significant information to the dis.docx
Your contribution(s) must add significant information to the dis.docx
 
Your good friends have just adopted a four-year-old child. At th.docx
Your good friends have just adopted a four-year-old child. At th.docxYour good friends have just adopted a four-year-old child. At th.docx
Your good friends have just adopted a four-year-old child. At th.docx
 
Your good friends have just adopted a four-year-old child. At this p.docx
Your good friends have just adopted a four-year-old child. At this p.docxYour good friends have just adopted a four-year-old child. At this p.docx
Your good friends have just adopted a four-year-old child. At this p.docx
 
Your goals as the IT architect and IT security specialist are to.docx
Your goals as the IT architect and IT security specialist are to.docxYour goals as the IT architect and IT security specialist are to.docx
Your goals as the IT architect and IT security specialist are to.docx
 
Your essay should address the following problem.(a) What is .docx
Your essay should address the following problem.(a) What is .docxYour essay should address the following problem.(a) What is .docx
Your essay should address the following problem.(a) What is .docx
 
Your future financial needs will be based on the income you can reas.docx
Your future financial needs will be based on the income you can reas.docxYour future financial needs will be based on the income you can reas.docx
Your future financial needs will be based on the income you can reas.docx
 
Your friend Lydia is having difficulty taking in the informati.docx
Your friend Lydia is having difficulty taking in the informati.docxYour friend Lydia is having difficulty taking in the informati.docx
Your friend Lydia is having difficulty taking in the informati.docx
 

Recently uploaded

9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 

Recently uploaded (20)

9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 

Parking Ticket SimulatorFor this assignment you will design a se.docx

  • 1. Parking Ticket Simulator For this assignment you will design a set of classes that work together to simulate a police officer issuing a parking ticket. The classes you should design are: · The ParkedCar Class: This class should simulate a parked car. The class’s responsibilities are: · To know the car’s, make, model, color, license number, and the number of minutes that the car has been parked. · The ParkingMeter Class: This class should simulate a parking meter. The class’s only responsibility is: · To know the number of minutes of parking time that has bene purchased. · The ParkingTicket Class: The class should simulate a parking ticket. The class’s responsibilities are: · To report the make, model, color, and license number of the illegally parked car · To report the amount of the fine which is $25 for the first hour or part of an hour that the car is illegally parked, plus $01 for every additional hour or part of an hour that the car is illegally parked part of an hour that the car is illegally parked. · To report the name and badge number of the police officer issuing the ticket. · The PoliceOfficer Class: This class should simulate a police officer inspecting parked cars. The class’s responsibility are: · To know the police office’s name and badge number · To examine a ParkedCar object and a ParkingMeter object, and determine whether the car’s time has expired. · To issue a parking ticket (generate a ParkingTicket object) if the car’s time has expired. Write a program that demonstrates hoe the classes collaborate. Assignment Details Case Study: Sergeant Lou Maynard
  • 2. CJ345-2: Evaluate the implementation of problem-oriented policing within criminal justice entities. Before starting this assignment, please take a few minutes and complete the practice learning activity associated with this outcome. Write a 2–4-page paper (excluding cover page) responding to the following: Read the case study on page 103 in Effective Police Supervision and apply critical thinking to construct persuasive arguments as to what you would you do if you were Sergeant Lou Maynard. Use the questions at the end of the case study to help you construct your paper and be sure to address the following: 1. Describe the motivational issues that exist. 2. The basic need drives for each officer. 3. Assess your management style and how it relates to Theory X. 4. If your level of formal education, or the education of the officers, would be an obstacle. For assistance with this Assignment, refer to Chapter 4 of your text. (PLEASE NOTE: This essay may require outside research.) You may consult the Kaplan Online Library, the internet, the textbook, other course material, and any other outside resources in supporting your task, using proper citations in APA style. Directions for Submitting Your Case Study Write your essay in a Word document and save it in a location and with a name that you will remember. Be sure to include your name, class, and section number in your essay. Submit your Assignment by selecting the Unit 2: Assignment in the Dropbox by the end of Unit 2. Parking Ticket Code/ParkedCar.cppParking Ticket Code/ParkedCar.cpp// Implementation file for the ParkedCar cla ss
  • 3. #include<iostream> #include"ParkedCar.h" usingnamespace std; // Default Constructor ParkedCar::ParkedCar() { make =""; model =""; color =""; licenseNumber =""; minutesParked =0; } // Constructor // Parameters: // mk The car's make. // mod The car's model. // col The car's color. // lic The car's license number. // min The number of minutes parked. ParkedCar::ParkedCar(string mk, string mod, string col, string lic,int min) { make = mk; model = mod; color = col; licenseNumber = lic; minutesParked = min; } // Copy constructor ParkedCar::ParkedCar(constParkedCar&car2) { make = car2.make; model = car2.model;
  • 4. color = car2.color; licenseNumber = car2.licenseNumber; minutesParked = car2.minutesParked; } // print function voidParkedCar::print() { cout <<"Car Information:n"; cout <<"tMake: "<< make << endl; cout <<"tmodel: "<< model << endl; cout <<"tColor: "<< color << endl; cout <<"tLicense Number: "<< licenseNumber << endl; cout <<"tMinutes Parked: "<< minutesParked << endl; } Parking Ticket Code/ParkedCar.h // Specification file for the ParkedCar class #ifndef PARKED_CAR_H #define PARKED_CAR_H #include<string> using namespace std; // ParkedCar class class ParkedCar {
  • 5. private: string make; // The car's make string model; // The car's model string color; // The car's color string licenseNumber; // The car's license number int minutesParked; // Minutes parked public: // Default constructor ParkedCar(); // Constructor ParkedCar(string, string, string, string, int); // Copy constructor ParkedCar(const ParkedCar &); // Mutators
  • 6. void setMake(string m) { make = m; } void setModel(string m) { model = m; } void setColor(string c) { color = c; } void setLicenseNumber(string lic) { licenseNumber = lic; } void setMinutesParked(int m) { minutesParked = m; } // Accessors string getMake() const { return make; }
  • 7. string getModel() const { return model;} string getColor() const { return color; } string getLicenseNumber() const { return licenseNumber; } int getMinutesParked() const { return minutesParked; } // print function void print(); }; #endif
  • 8. Parking Ticket Code/ParkingMeter.h // Specification file for the ParkingMeter class #ifndef PARKING_METER_H #define PARKING_METER_H #include <iostream> using namespace std; // ParkingMeter class class ParkingMeter { private: int minutesPurchased; // Minutes purchased public: // Default constructor ParkingMeter() { minutesPurchased = 0; } // Constructor. The parameter m is
  • 9. // the number of minutes purchased. ParkingMeter(int m) { minutesPurchased = m; } // Mutator void setMinutesPurchased(int m) { minutesPurchased = m; } // Accessor int getMinutesPurchased() const { return minutesPurchased; } // print function void print() { cout << "Meter Information:n"; cout << "tMinutes Purchases: " << minutesPurchased << endl; }
  • 10. }; #endif Parking Ticket Code/ParkingTicket.cppParking Ticket Code/ParkingTicket.cpp// Implementation file for the ParkingTi cket class #include"ParkingTicket.h" #include<iostream> #include<iomanip> usingnamespace std; // Default constructor ParkingTicket::ParkingTicket() { fine =0.0; minutes =0; } // Constructor // Parameters: // aCar - A ParkedCar object. // min - Minutes illegally parked. ParkingTicket::ParkingTicket(ParkedCar aCar,int min) { car = aCar; minutes = min; // Calculate the fine. calculateFine(); } // Copy constructor
  • 11. ParkingTicket::ParkingTicket(constParkingTicket&ticket2) { car = ticket2.car; fine = ticket2.fine; } // calculateFine method // This method calculates the amount of the parking fine. voidParkingTicket::calculateFine() { // Get the time parked in hours. double hours = minutes /60.0; // Get the hours as an int. int hoursAsInt =static_cast<int>(hours); // If there was a portion of an hour, round up. if((hours - hoursAsInt)>0) hoursAsInt++; // Assign the base fine. fine = BASE_FINE; // Add the additional hourly fines. fine +=(hoursAsInt * HOURLY_FINE); } // print function voidParkingTicket::print() { // Print car information. car.print(); // Print ticket information. cout <<"Ticket Information:n"; cout <<"tMinutes in violation: "<< minutes << endl;
  • 12. cout <<"tFine: $ "<< setprecision(2)<< fixed << showpoint << fine << endl; } Parking Ticket Code/ParkingTicket.h // Specification file for the ParkingTicket class #ifndef PARKING_TICKET_H #define PARKING_TICKET_H #include "ParkedCar.h" // Constant for the base fine. const double BASE_FINE = 25.0; // Constant for the additional hourly fine. const double HOURLY_FINE = 10.0; // ParkingTicket class class ParkingTicket { private:
  • 13. ParkedCar car; // The parked car double fine; // The parking fine int minutes; // Minutes illegally parked // calculateFine method // This method calculates the amount of the parking fine. void calculateFine(); public: // Default Constructor ParkingTicket(); // Constructor ParkingTicket(ParkedCar, int); // Copy constructor ParkingTicket(const ParkingTicket &);
  • 14. // Mutators void setCar(ParkedCar c) { car = c; } void setMinutes(int m) { minutes = m; } // Accessors ParkedCar getCar() const { return car; } double getFine() const
  • 15. { return fine; } // print function void print(); }; #endif Parking Ticket Code/PoliceOfficer.cppParking Ticket Code/PoliceOfficer.cpp// Implementation file for the PoliceOffi cer class #include"ParkedCar.h" #include"ParkingMeter.h" #include"ParkingTicket.h" #include"PoliceOfficer.h" #include<iostream> usingnamespace std; // The patrol function looks at the number of // minutes a car has been parked and the number // of minutes purchased. If the minutes parked is // greater than the minutes purchased, a pointer // to a ParkingTicket object is returned. Otherwise // the function returns a nullptr. ParkingTicket*PoliceOfficer::patrol(ParkedCar car,ParkingMete r meter)
  • 16. { // Get the minutes parked over the amount purchased. int illegalMinutes = car.getMinutesParked()- meter.getMinutesPurchased(); // Determine whether the car is illegally parked. if(illegalMinutes >0) { // Yes, it is illegally parked. // Create a ParkingTicket object. ticket =newParkingTicket(car, illegalMinutes); } // Return the ticket, if any. return ticket; } // print function voidPoliceOfficer::print() { cout <<"Police Officer Information:n"; cout <<"tName: "<< name << endl; cout <<"tBadge Number: "<< badgeNumber << endl; } Parking Ticket Code/PoliceOfficer.h // Specification file for the PoliceOfficer class #ifndef POLICE_OFFICER_H #define POLICE_OFFICER_H #include "ParkedCar.h" #include "ParkingMeter.h"
  • 17. #include "ParkingTicket.h" // PoliceOfficer class class PoliceOfficer { private: string name; // Officer's name string badgeNumber; // Badge number ParkingTicket *ticket; // Pointer to a ticket public: // Default constructor PoliceOfficer() { name = ""; badgeNumber = ""; ticket = nullptr; } // Constructor // The parameter n is the officer's name. // The parameter bn is the officer's badge number.
  • 18. PoliceOfficer(string n, string bn) { name = n; badgeNumber = bn; ticket = nullptr; } // Copy constructor PoliceOfficer(const PoliceOfficer &officer2) { name = officer2.name; badgeNumber = officer2.badgeNumber; ticket = new ParkingTicket(*officer2.ticket); } // Mutators void setName(string n) {
  • 19. name = n; } void setBadgeNumber(string b) { badgeNumber = b; } // Accessors string getName() { return name; } string getBadgeNumber() { return badgeNumber; }
  • 20. // patrol function ParkingTicket *patrol(ParkedCar, ParkingMeter); // print function void print(); }; #endif Parking Ticket Code/spc14-14.cppParking Ticket Code/spc14- 14.cpp// Chapter 14, Programming Challenge 14: Parking Ticket Simulator #include<iostream> #include"ParkedCar.h" #include"ParkingMeter.h" #include"ParkingTicket.h" #include"PoliceOfficer.h" usingnamespace std; int main() { // Create a ParkingTicket pointer. If a parking ticket // is issued, this will point to it. ParkingTicket*ticket =nullptr; // Create a ParkedCar object.
  • 21. // The car was parked for 125 minutes. ParkedCar car("Volkswagen","1972","Red","147RHZM",125); // Create a ParkingMeter object. // 60 minutes were purchased. ParkingMeter meter(60); // Create a PoliceOfficer object. PoliceOfficer officer("Joe Friday","4788"); // Let the officer patrol. ticket = officer.patrol(car, meter); if(ticket !=nullptr) { // Display the officer information. officer.print(); // Display the ticket information. ticket->print(); // We're done with the ticket, so delete it. delete ticket; ticket =nullptr; } else cout <<"No crimes were committed.n"; return0; }