SlideShare a Scribd company logo
To write a program that implements the following C++ concepts 1. Data Encapsulation 2.
Instantiate classes 3. Composition Class 4. Aggregation Class 5. Dynamic Memory 6. File
Stream Make a program that reads a file and can generate reports. Each file will have phone calls
records (see section 4). The program will process the data gathering all minutes and total amount
for each report. The program should have a menu (see section 1): 1. New Report – this option
will ask a file name (TE??????.tel). This option will instantiate an object of Report class, loading
the whole file into memory. 2. Delete a report – this option will display all reports available in
memory and ask which one you would like to delete. 3. Display a report – this option will
display all reports available in memory and ask you which one you would like to generate a
report. 4. Exit – Program ends. For option 1, you do not know how many reports are, meaning
that you will create dynamically the reports. For long distance calls the formula will be (minutes
call x $1.50). For local phone calls the formula will be (minutes call x $0.25)
--------------------------------------------------------------------------------------------------------------------
----------------------------
//Main.cpp
*#define between(x,y,z) ((x>=y && x<=z)? true:false)
#include
#include
#include
#include "Data.h"
#include "Report.h"
#include "Menu.h"
using namespace std;
//uses class Report to create reports
//uses class Menu to display a menu to choose
int main() {
int idx = 0;
int count = idx;
Menu menu("Reports");
Data temp;
string fileName;
Report* phoneCompany;
Report* newReport(Report*, int&);
Report* deleteReport(Report*, int&, int);
int displayReport(Report*, int);
bool fileNameExists(string);
menu.addMenuItem("New Report");
menu.addMenuItem("Delete a Report");
menu.addMenuItem("Display a Report");
ofstream openFile;
phoneCompany = NULL;
phoneCompany = new Report[count];
do {
cout << menu;
cin >> menu;
switch (menu.getChoice()) {
case '1':
cout << " tEnter report name (TE??????): ";
cin >> fileName;
openFile.open(fileName + ".tel");
if (openFile.good()) {
cout << " tReport succesfully created. ";
phoneCompany[count].setFileName(fileName);
count++;
}
else {
cout << " terror: Could not create report. ";
}
break;
case '2':
if (count != 0) {
do {
system("cls");
cout << "  tDelete a Report:  ";
idx = displayReport(phoneCompany, count);
if (between(idx, 0, count - 1)) {
phoneCompany = deleteReport(phoneCompany, count, idx);
idx = 0;
}
else
cout << " terror: Report could not be deleted. ";
} while (idx != count);
}
else {
cout << "  tNo reports to delete.  ";
system("pause");
}
break;
case '3':
if (count != 0) {
do {
system("cls");
cout << "Display a Report:  ";
idx = displayReport(phoneCompany, count);
system("cls");
cout << " t" << phoneCompany[idx].getFileName();
cout << "  tWould you like to edit the report?";
cout << " t1. Yes";
cout << " t2. No";
char ch;
cin >> ch;
do {
switch (ch) {
case '1':
cin >> temp;
phoneCompany[idx].setRecord(temp);
case '2':
cout << phoneCompany[idx];
default:
cin.ignore();
break;
}
} while (ch != '2');
} while (idx != count);
}
else {
cout << "  tNo reports to display.  ";
system("pause");
}
break;
case '4':
cout << "tThank you for using this Report System.  ";
break;
default:
cin.ignore();
break;
}
} while (menu.getChoice() != 4);
delete[]phoneCompany;
system("pause");
}
Report* newReport(Report* report, int& total) {
if (total == 0) {
report = new Report[1];
}
else {
Report* temp = new Report[total];
for (int i = 0; i < total; i++) {
temp[i] = report[i];
}
delete[]report;
report = new Report[total + 1];
for (int i = 0; i < total; i++) {
report[i] = temp[i];
}
delete[]temp;
}
total++;
return report;
}
Report* deleteReport(Report* report, int& total, int idx) {
Report* temp = new Report[total - 1];
string fileName = report[idx].getFileName();
for (int i = 0; i < total; i++) {
temp[i] = report[i];
}
delete[]report;
total--;
report = new Report[total];
for (int i = 0; i < total; i++) {
report[i] = temp[i];
}
delete[]temp;
cout << "Report " << fileName << " has been deleted.  ";
if (total == 0)
report = NULL;
return report;
}
int displayReports(Report* report, int total) {
int choice;
int i;
for (i = 0; i < total; i++) {
cout << "t" << i + 1 << ". " << report[i].getFileName() << endl;
}
cout << "t" << i + 1 << ". Return  ";
cout << "Choose: ";
cin >> choice;
return (choice - 1);
}*/
// Report.h
#pragma once
#include
#include
#include "Data.h"
using namespace std;
//uses class Data to create a dynamic array containing client phone information
class Report {
friend ostream&operator<<(ostream&, const Report&);
private:
Data* records;
string fileName;
int totalRecords;
float totalMinutes;
float totalAmount;
public:
Report();
Report(const Data&, string);
Report(const Report&);
~Report();
void setRecord(const Data&);
void setFileName(string);
void setTotalMinutes(float);
void setTotalAmount(int);
Data getRecord(int)const;
string getFileName()const;
int getTotalRecords()const;
float getTotalMinutes()const;
float getTotalAmount()const;
};
//Report.cpp
#include
#include
#include "Data.h"
#include "Report.h"
using namespace std;
ostream&operator<<(ostream& output, const Report& aReport) {
for (int i = 0; i < aReport.getTotalRecords(); i++) {
output << "Report number is: " << aReport.getRecord(i) << endl;
}
return output;
}
Report::Report() {
totalRecords = 0;
fileName = "";
}
Report::Report(const Data& aData, string name) {
records[0] = aData;
fileName = name;
totalRecords = 1;
}
Report::Report(const Report& aReport) {
setRecord(*aReport.records);
setFileName(aReport.fileName);
setTotalMinutes(aReport.totalMinutes);
setTotalAmount(aReport.totalAmount);
}
Report::~Report() {}
void Report::setRecord(const Data& aData) {
int idx = totalRecords;
if (totalRecords == 0) {
records = new Data[1];
}
else {
Data* temp = new Data[totalRecords];
for (int i = 0; i < totalRecords; i++) {
temp[i] = records[i];
}
delete[]records;
records = new Data[totalRecords + 1];
for (int i = 0; i < totalRecords; i++) {
records[i] = temp[i];
}
delete[]temp;
}
records[idx] = aData;
totalRecords++;
}
void Report::setFileName(string name) {
fileName = name;
}
void Report::setTotalMinutes(float minutes) {
totalMinutes = minutes;
}
void Report::setTotalAmount(int idx) {
if (records[idx].getLongDistance() == 1) {
totalAmount = getTotalMinutes()*1.25;
}
else {
totalAmount = getTotalMinutes()*0.25;
}
}
Data Report::getRecord(int idx)const {
return records[idx];
}
string Report::getFileName()const {
return fileName;
}
int Report::getTotalRecords()const {
return totalRecords;
}
float Report::getTotalMinutes()const {
return totalMinutes;
}
float Report::getTotalAmount()const {
return totalAmount;
}
// Person.h
#pragma once
#include
using namespace std;
//stores a Persons' information
class Person {
friend ostream&operator<<(ostream&, const Person&);
friend istream&operator>>(istream&, Person&);
private:
string firstName;
string middleName;
string lastName;
string maidenName;
public:
Person();
Person(string, string, string, string);
Person(const Person&);
~Person();
void setFirstName(string);
void setMiddleName(string);
void setLastName(string);
void setMaidenName(string);
string getFirstName()const;
string getMiddleName()const;
string getLastName()const;
string getMaidenName()const;
};
//Person.cpp
#include
#include
#include "Person.h"
using namespace std;
ostream & operator <<(ostream & output, const Person & aPerson) {
output << " First Name:  " << aPerson.firstName;
output << " LastName:  " << aPerson.lastName;
output << "MiddleName: " << aPerson.middleName;
output << " Maiden Name: " << aPerson.maidenName;
return output;
}
istream & operator >>(istream & input, Person & aPerson) {
cout << " tEnter First Name, Middle Name, Last Name, and Maiden Name " << endl;
input >> aPerson.firstName;
input >> aPerson.middleName;
input >> aPerson.lastName;
input >> aPerson.maidenName;
return input;
}
Person::Person() {
firstName = "";
middleName = "";
lastName = "";
maidenName = "";
}
Person::Person(string first, string middle, string last, string maiden) {
firstName = first;
middleName = middle;
lastName = last;
maidenName = maiden;
}
Person::Person(const Person & aPerson) {
setFirstName(aPerson.firstName);
setMiddleName(aPerson.middleName);
setLastName(aPerson.lastName);
setMaidenName(aPerson.maidenName);
}
Person::~Person(){}
void Person::setFirstName(string first) {
firstName = first;
}
void Person::setMiddleName(string middle) {
middleName = middle;
}
void Person::setLastName(string last) {
lastName = last;
}
void Person::setMaidenName(string maiden) {
maidenName = maiden;
}
string Person::getFirstName()const {
return firstName;
}
string Person::getMiddleName()const {
return middleName;
}
string Person::getLastName()const {
return lastName;
}
string Person::getMaidenName()const {
return maidenName;
}
//Report.h
#pragma once
#include
#include
#include "Data.h"
using namespace std;
//uses class Data to create a dynamic array containing client phone information
class Report {
friend ostream&operator<<(ostream&, const Report&);
private:
Data* records;
string fileName;
int totalRecords;
float totalMinutes;
float totalAmount;
public:
Report();
Report(const Data&, string);
Report(const Report&);
~Report();
void setRecord(const Data&);
void setFileName(string);
void setTotalMinutes(float);
void setTotalAmount(int);
Data getRecord(int)const;
string getFileName()const;
int getTotalRecords()const;
float getTotalMinutes()const;
float getTotalAmount()const;
};
//Report.cpp
#include
#include
#include "Data.h"
#include "Report.h"
using namespace std;
ostream&operator<<(ostream& output, const Report& aReport) {
for (int i = 0; i < aReport.getTotalRecords(); i++) {
output << "Report number is: " << aReport.getRecord(i) << endl;
}
return output;
}
Report::Report() {
totalRecords = 0;
fileName = "";
}
Report::Report(const Data& aData, string name) {
records[0] = aData;
fileName = name;
totalRecords = 1;
}
Report::Report(const Report& aReport) {
setRecord(*aReport.records);
setFileName(aReport.fileName);
setTotalMinutes(aReport.totalMinutes);
setTotalAmount(aReport.totalAmount);
}
Report::~Report() {}
void Report::setRecord(const Data& aData) {
int idx = totalRecords;
if (totalRecords == 0) {
records = new Data[1];
}
else {
Data* temp = new Data[totalRecords];
for (int i = 0; i < totalRecords; i++) {
temp[i] = records[i];
}
delete[]records;
records = new Data[totalRecords + 1];
for (int i = 0; i < totalRecords; i++) {
records[i] = temp[i];
}
delete[]temp;
}
records[idx] = aData;
totalRecords++;
}
void Report::setFileName(string name) {
fileName = name;
}
void Report::setTotalMinutes(float minutes) {
totalMinutes = minutes;
}
void Report::setTotalAmount(int idx) {
if (records[idx].getLongDistance() == 1) {
totalAmount = getTotalMinutes()*1.25;
}
else {
totalAmount = getTotalMinutes()*0.25;
}
}
Data Report::getRecord(int idx)const {
return records[idx];
}
string Report::getFileName()const {
return fileName;
}
int Report::getTotalRecords()const {
return totalRecords;
}
float Report::getTotalMinutes()const {
return totalMinutes;
}
float Report::getTotalAmount()const {
return totalAmount;
}
//Menu.h
#pragma once
#include
#include
using namespace std;
//displays choices
class Menu {
friend ostream&operator<<(ostream& output, const Menu& aMenu) {
system("cls");
int i;
output << aMenu.title << endl << endl;
for (i = 0; i < aMenu.totalItems; i++) {
output << "tt" << i + 1 << ". " << aMenu.menuItems[i] << endl;
}
output << "tt" << i + 1 << ". Exit";
output << "  Choose: ";
return output;
}
friend istream&operator>>(istream& input, Menu& aMenu) {
do {
char ch;
input >> ch;
aMenu.setChoice(ch);
if (!aMenu.check()) {
cout << " ERROR.";
system("pause");
cout << aMenu;
}
} while (!aMenu.check());
return input;
}
private:
string* menuItems;
string title;
int totalItems;
int choice;
public:
Menu() {
menuItems = NULL;
title = "Title";
totalItems = 0;
}
Menu(const char* ttl) {
Menu();
title = ttl;
}
Menu(const Menu& aMenu) {
}
~Menu() {
delete[]menuItems;
}
void addMenuItem(string item) {
int idx = totalItems;
string* temp;
if (idx == 0) {
menuItems = new string[1];
}
else {
temp = new string[totalItems];
for (int i = 0; i < totalItems; i++) {
temp[i] = menuItems[i];
}
delete[]menuItems;
menuItems = new string[totalItems + 1];
for (int i = 0; i < totalItems; i++) {
menuItems[i] = temp[i];
}
delete[]temp;
}
menuItems[idx] = item;
totalItems++;
}
void setTitle(string ttl) {
title = ttl;
}
void setChoice(char choose) {
choice = choose;
}
int getChoice()const {
return choice;
}
int getLast()const {
return totalItems + 1;
}
bool check() {
bool validate;
if (choice > 0 && choice <= (totalItems + 1)) {
validate = true;
}
else
validate = false;
return validate;
}
};
//Data.h
#pragma once
#include
#include
#include "Person.h"
using namespace std;
//uses class Person to create a profile for a client
class Data {
friend ostream&operator<<(ostream&, const Data&);
friend istream&operator>>(istream&, Data&);
private:
Person client;
string callDate;
bool longDistance;
string timeCallBegin;
string timeCallEnd;
string callNoFrom;
string callNoTo;
public:
Data();
Data(const Person&, string, bool, string, string, string, string);
Data(const Data&);
~Data();
void setClient(const Person&);
void setCallDate(string);
void setLongDistance(bool);
void setTimeCallBegin(string);
void setTimeCallEnd(string);
void setCallNoFrom(string);
void setCallNoTo(string);
Person getClient()const;
string getCallDate()const;
bool getLongDistance()const;
string getTimeCallBegin()const;
string getTimeCallEnd()const;
string getCallNoFrom()const;
string getCallNoTo()const;
Data operator=(const Data&);
};
//Data.cpp
#include
#include
#include "Person.h"
#include "Data.h"
using namespace std;
ostream & operator <<(ostream & output, const Data & aData) {
Person person;
output << "Providing Client Information:" << endl;
output << person.getFirstName();
output << person.getLastName();
output << person.getMiddleName();
output << person.getMaidenName();
output << endl << "Call Date: " << aData.callDate << endl;
output << "longDistance Charge: " << aData.longDistance ? " Y " : " N ";//Yes or No
question
output << "Time Call Begin: " << aData.timeCallBegin;
output << "Time Call End: " << aData.timeCallEnd;
output << "Call # From: " << aData.callNoFrom;
output << "Call # to: " << aData.callNoTo;
return output;
}
istream & operator >>(istream & input, Data & aData) {
cout << "Client Information: " << endl;
input >> aData.client;
cout << "Call Date: " << endl;
input >> aData.callDate;
cout << " Long Distance: " << endl;
input >> aData.longDistance;
cout << " Time Call Begin: " << endl;
input >> aData.timeCallBegin;
cout << " Time Call End: " << endl;
input >> aData.timeCallEnd;
cout << " Call # From : " << endl;
input >> aData.callNoFrom;
cout << " Call # To: " << endl;
input >> aData.callNoTo;
return input;
}
Data::Data() {
setClient(Person("", "", "", ""));
setCallDate(" ");
setLongDistance(false);
setTimeCallBegin(" ");
setTimeCallEnd(" ");
setCallNoFrom(" ");
setCallNoTo(" ");
}
Data::Data(const Person& aPerson, string date, bool longD, string begin, string end, string from,
string to) {
setClient(aPerson);
setCallDate(date);
setLongDistance(longD);
setTimeCallBegin(begin);
setTimeCallEnd(end);
setCallNoFrom(from);
setCallNoTo(to);
}
Data::Data(const Data& aData) {
setClient(aData.client);
setCallDate(aData.callDate);
setLongDistance(aData.longDistance);
setTimeCallBegin(aData.timeCallBegin);
setTimeCallEnd(aData.timeCallEnd);
setCallNoFrom(aData.callNoFrom);
setCallNoTo(aData.callNoTo);
}
Data::~Data() {}
void Data::setClient(const Person& person) {
client = person;
}
void Data::setCallDate(string date) {
callDate = date;
}
void Data::setLongDistance(bool longD) {
longDistance = longD;
}
void Data::setTimeCallBegin(string begin) {
timeCallBegin = begin;
}
void Data::setTimeCallEnd(string end) {
timeCallEnd = end;
}
void Data::setCallNoFrom(string from) {
callNoFrom = from;
}
void Data::setCallNoTo(string to) {
callNoTo = to;
}
Person Data::getClient()const {
return client;
}
string Data::getCallDate()const {
return callDate;
}
bool Data::getLongDistance()const {
return longDistance;
}
string Data::getTimeCallBegin()const {
return timeCallBegin;
}
string Data::getTimeCallEnd()const {
return timeCallEnd;
}
string Data::getCallNoFrom()const {
return callNoFrom;
}
string Data::getCallNoTo()const {
return callNoTo;
}
Data Data::operator=(const Data& aData) {
client = aData.client;
callDate = aData.callDate;
longDistance = aData.longDistance;
timeCallBegin = aData.timeCallBegin;
timeCallEnd = aData.timeCallEnd;
callNoFrom = aData.callNoFrom;
callNoTo = aData.callNoTo;
return *this;
}
//DataParser.h
#pragma once
#include
#include
#include "Data.h"
using namespace std;
//separates the information from a file to store in Data.h
class DataParser {
private:
Data record;
public:
DataParser();
DataParser(const Data&);
DataParser(const DataParser&);
DataParser(string);
~DataParser();
void setRecord(string);
Data getRecord()const;
Data parse(string);
};
//DataParser.cpp
#include
#include
#include "Data.h"
#include "DataParser.h"
using namespace std;
DataParser::DataParser() {
record;
}
DataParser::DataParser(const Data& aData) {
record = aData;
}
DataParser::DataParser(const DataParser& aDataParser) {
record = aDataParser.record;
}
DataParser::DataParser(string line) {
parse(line);
}
DataParser::~DataParser() {}
void DataParser::setRecord(string line) {
parse(line);
}
Data DataParser::getRecord()const {
return record;
}
Data DataParser::parse(string line) {
Person client;
string callDate;
bool longDistance;
string timeCallBegin;
string timeCallEnd;
string callNoFrom;
string callNoTo;
string firstName;
string lastName;
string middleName;
string maidenName;
string blank;
firstName = line.substr(0, 25);
middleName = line.substr(26, 50);
lastName = line.substr(51, 100);
maidenName = line.substr(101, 150);
callDate = line.substr(151, 158);
if (line.substr(159, 159) == "1")
longDistance = true;
else
longDistance = false;
timeCallBegin = line.substr(160, 165);
timeCallEnd = line.substr(166, 171);
callNoFrom = line.substr(172, 181);
callNoTo = line.substr(182, 191);
blank = line.substr(192, 250);
record.setClient(Person(firstName, middleName, lastName, maidenName));
record.setCallDate(callDate);
record.setLongDistance(longDistance);
record.setTimeCallBegin(timeCallBegin);
record.setTimeCallEnd(timeCallEnd);
record.setCallNoFrom(callNoFrom);
record.setCallNoTo(callNoTo);
return record;
}
=====================================================================
======
This is what I have so far
I need the program to give me the following output but it giving me error in the Main.cpp and
such, any help would be appreaciated. Section 5 Output cmd.exe eport Date: 01/26/2015 eport
from: TE20150126.tel ast Name First Name Call Date Long From To Mins odriguez Soto Carlos
M 01/26/2015N 787-399-2234 787-234-2345 26 6.50 1/19/2015 N 787-234-5643 787-345-1234
38 9.50 2/23/2014787-356-2345 305-456-234567 100.50 Felix G David P erez Roman Grand
Total: 131 116.50 C:UsersCarlosDocuments
Solution
Sum of Natural Numbers Using while Loop

More Related Content

Similar to To write a program that implements the following C++ concepts 1. Dat.pdf

Program 1 (Practicing an example of function using call by referenc.pdf
Program 1 (Practicing an example of function using call by referenc.pdfProgram 1 (Practicing an example of function using call by referenc.pdf
Program 1 (Practicing an example of function using call by referenc.pdf
ezhilvizhiyan
 
[10] Write a Java application which first reads data from the phoneb.pdf
[10] Write a Java application which first reads data from the phoneb.pdf[10] Write a Java application which first reads data from the phoneb.pdf
[10] Write a Java application which first reads data from the phoneb.pdf
archiespink
 
How to tune a query - ODTUG 2012
How to tune a query - ODTUG 2012How to tune a query - ODTUG 2012
How to tune a query - ODTUG 2012
Connor McDonald
 
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdfProgramming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
ssuser6254411
 
Linux_C_LabBasics.ppt
Linux_C_LabBasics.pptLinux_C_LabBasics.ppt
Linux_C_LabBasics.ppt
CharuJain396881
 
Operating system labs
Operating system labsOperating system labs
Operating system labs
bhaktisagar4
 
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
rafbolet0
 
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docxPROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
amrit47
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
javaTpoint s
 
Deep Dumpster Diving
Deep Dumpster DivingDeep Dumpster Diving
Deep Dumpster Diving
RonnBlack
 
Keep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfKeep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdf
AroraRajinder1
 
Classes(or Libraries)#include #include #include #include.docx
Classes(or Libraries)#include #include #include #include.docxClasses(or Libraries)#include #include #include #include.docx
Classes(or Libraries)#include #include #include #include.docx
brownliecarmella
 
5 Rmi Print
5  Rmi Print5  Rmi Print
5 Rmi Print
varadasuren
 
C intro
C introC intro
C intro
Kamran
 
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Mario Fusco
 
C-Program Custom Library, Header File, and Implementation FilesI .pdf
C-Program Custom Library, Header File, and Implementation FilesI .pdfC-Program Custom Library, Header File, and Implementation FilesI .pdf
C-Program Custom Library, Header File, and Implementation FilesI .pdf
herminaherman
 
File & Exception Handling in C++.pptx
File & Exception Handling in C++.pptxFile & Exception Handling in C++.pptx
File & Exception Handling in C++.pptx
RutujaTandalwade
 
C++ course start
C++ course startC++ course start
C++ course startNet3lem
 
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docxfilesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
ssuser454af01
 

Similar to To write a program that implements the following C++ concepts 1. Dat.pdf (20)

Program 1 (Practicing an example of function using call by referenc.pdf
Program 1 (Practicing an example of function using call by referenc.pdfProgram 1 (Practicing an example of function using call by referenc.pdf
Program 1 (Practicing an example of function using call by referenc.pdf
 
[10] Write a Java application which first reads data from the phoneb.pdf
[10] Write a Java application which first reads data from the phoneb.pdf[10] Write a Java application which first reads data from the phoneb.pdf
[10] Write a Java application which first reads data from the phoneb.pdf
 
Introduction to c ++ part -2
Introduction to c ++   part -2Introduction to c ++   part -2
Introduction to c ++ part -2
 
How to tune a query - ODTUG 2012
How to tune a query - ODTUG 2012How to tune a query - ODTUG 2012
How to tune a query - ODTUG 2012
 
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdfProgramming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
 
Linux_C_LabBasics.ppt
Linux_C_LabBasics.pptLinux_C_LabBasics.ppt
Linux_C_LabBasics.ppt
 
Operating system labs
Operating system labsOperating system labs
Operating system labs
 
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
 
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docxPROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
 
Deep Dumpster Diving
Deep Dumpster DivingDeep Dumpster Diving
Deep Dumpster Diving
 
Keep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfKeep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdf
 
Classes(or Libraries)#include #include #include #include.docx
Classes(or Libraries)#include #include #include #include.docxClasses(or Libraries)#include #include #include #include.docx
Classes(or Libraries)#include #include #include #include.docx
 
5 Rmi Print
5  Rmi Print5  Rmi Print
5 Rmi Print
 
C intro
C introC intro
C intro
 
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...
 
C-Program Custom Library, Header File, and Implementation FilesI .pdf
C-Program Custom Library, Header File, and Implementation FilesI .pdfC-Program Custom Library, Header File, and Implementation FilesI .pdf
C-Program Custom Library, Header File, and Implementation FilesI .pdf
 
File & Exception Handling in C++.pptx
File & Exception Handling in C++.pptxFile & Exception Handling in C++.pptx
File & Exception Handling in C++.pptx
 
C++ course start
C++ course startC++ course start
C++ course start
 
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docxfilesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
 

More from SANDEEPARIHANT

Do markets erode moral valuesDo markets erode moral values.pdf
Do markets erode moral valuesDo markets erode moral values.pdfDo markets erode moral valuesDo markets erode moral values.pdf
Do markets erode moral valuesDo markets erode moral values.pdf
SANDEEPARIHANT
 
Concept Simulation 25.2 illustrates the concepts pertinent to this pr.pdf
Concept Simulation 25.2 illustrates the concepts pertinent to this pr.pdfConcept Simulation 25.2 illustrates the concepts pertinent to this pr.pdf
Concept Simulation 25.2 illustrates the concepts pertinent to this pr.pdf
SANDEEPARIHANT
 
Based on what you have learned about the aquatic environment and the .pdf
Based on what you have learned about the aquatic environment and the .pdfBased on what you have learned about the aquatic environment and the .pdf
Based on what you have learned about the aquatic environment and the .pdf
SANDEEPARIHANT
 
A) If A, then B. If B, then C. Therefore, if A, then C There are 350.pdf
A) If A, then B. If B, then C. Therefore, if A, then C There are 350.pdfA) If A, then B. If B, then C. Therefore, if A, then C There are 350.pdf
A) If A, then B. If B, then C. Therefore, if A, then C There are 350.pdf
SANDEEPARIHANT
 
Describe the therapeutic goal in treating acid-peptic disease.So.pdf
Describe the therapeutic goal in treating acid-peptic disease.So.pdfDescribe the therapeutic goal in treating acid-peptic disease.So.pdf
Describe the therapeutic goal in treating acid-peptic disease.So.pdf
SANDEEPARIHANT
 
Compare structure and culture of two or more firms. Which would you .pdf
Compare structure and culture of two or more firms. Which would you .pdfCompare structure and culture of two or more firms. Which would you .pdf
Compare structure and culture of two or more firms. Which would you .pdf
SANDEEPARIHANT
 
WRITE A program that displays the values in the list numbers in desc.pdf
WRITE A program that displays the values in the list numbers in desc.pdfWRITE A program that displays the values in the list numbers in desc.pdf
WRITE A program that displays the values in the list numbers in desc.pdf
SANDEEPARIHANT
 
What is an oligopotent stem cell and what is an exampleSolution.pdf
What is an oligopotent stem cell and what is an exampleSolution.pdfWhat is an oligopotent stem cell and what is an exampleSolution.pdf
What is an oligopotent stem cell and what is an exampleSolution.pdf
SANDEEPARIHANT
 
What are 4 different types of CVI systemsSolutionThe four typ.pdf
What are 4 different types of CVI systemsSolutionThe four typ.pdfWhat are 4 different types of CVI systemsSolutionThe four typ.pdf
What are 4 different types of CVI systemsSolutionThe four typ.pdf
SANDEEPARIHANT
 
Why is RNA more prone than DNA to forming secondary structures.pdf
Why is RNA more prone than DNA to forming secondary structures.pdfWhy is RNA more prone than DNA to forming secondary structures.pdf
Why is RNA more prone than DNA to forming secondary structures.pdf
SANDEEPARIHANT
 
What are the advantages and disadvantage of using the metric system o.pdf
What are the advantages and disadvantage of using the metric system o.pdfWhat are the advantages and disadvantage of using the metric system o.pdf
What are the advantages and disadvantage of using the metric system o.pdf
SANDEEPARIHANT
 
Which of the following model organisms would be the best choice if y.pdf
Which of the following model organisms would be the best choice if y.pdfWhich of the following model organisms would be the best choice if y.pdf
Which of the following model organisms would be the best choice if y.pdf
SANDEEPARIHANT
 
Write a C program that reads the words the user types at the command.pdf
Write a C program that reads the words the user types at the command.pdfWrite a C program that reads the words the user types at the command.pdf
Write a C program that reads the words the user types at the command.pdf
SANDEEPARIHANT
 
What happens to jointly held stock between two siblings when one .pdf
What happens to jointly held stock between two siblings when one .pdfWhat happens to jointly held stock between two siblings when one .pdf
What happens to jointly held stock between two siblings when one .pdf
SANDEEPARIHANT
 
The HER incentive programs incentive payments to eligible hospitals, .pdf
The HER incentive programs incentive payments to eligible hospitals, .pdfThe HER incentive programs incentive payments to eligible hospitals, .pdf
The HER incentive programs incentive payments to eligible hospitals, .pdf
SANDEEPARIHANT
 
The comet Shoemaker-Levy 9 broke up into a number of pieces called t.pdf
The comet Shoemaker-Levy 9 broke up into a number of pieces called t.pdfThe comet Shoemaker-Levy 9 broke up into a number of pieces called t.pdf
The comet Shoemaker-Levy 9 broke up into a number of pieces called t.pdf
SANDEEPARIHANT
 
The existence of universal values is still a matter of debate. But e.pdf
The existence of universal values is still a matter of debate. But e.pdfThe existence of universal values is still a matter of debate. But e.pdf
The existence of universal values is still a matter of debate. But e.pdf
SANDEEPARIHANT
 
The c program will implement the Caesar Cipher. Your program shou.pdf
The c program will implement the Caesar Cipher. Your program shou.pdfThe c program will implement the Caesar Cipher. Your program shou.pdf
The c program will implement the Caesar Cipher. Your program shou.pdf
SANDEEPARIHANT
 
Amino acids are acids because they contain which functional group S.pdf
Amino acids are acids because they contain which functional group  S.pdfAmino acids are acids because they contain which functional group  S.pdf
Amino acids are acids because they contain which functional group S.pdf
SANDEEPARIHANT
 
Suppose that theta is an acute angle of a right triangle and tan (the.pdf
Suppose that theta is an acute angle of a right triangle and tan (the.pdfSuppose that theta is an acute angle of a right triangle and tan (the.pdf
Suppose that theta is an acute angle of a right triangle and tan (the.pdf
SANDEEPARIHANT
 

More from SANDEEPARIHANT (20)

Do markets erode moral valuesDo markets erode moral values.pdf
Do markets erode moral valuesDo markets erode moral values.pdfDo markets erode moral valuesDo markets erode moral values.pdf
Do markets erode moral valuesDo markets erode moral values.pdf
 
Concept Simulation 25.2 illustrates the concepts pertinent to this pr.pdf
Concept Simulation 25.2 illustrates the concepts pertinent to this pr.pdfConcept Simulation 25.2 illustrates the concepts pertinent to this pr.pdf
Concept Simulation 25.2 illustrates the concepts pertinent to this pr.pdf
 
Based on what you have learned about the aquatic environment and the .pdf
Based on what you have learned about the aquatic environment and the .pdfBased on what you have learned about the aquatic environment and the .pdf
Based on what you have learned about the aquatic environment and the .pdf
 
A) If A, then B. If B, then C. Therefore, if A, then C There are 350.pdf
A) If A, then B. If B, then C. Therefore, if A, then C There are 350.pdfA) If A, then B. If B, then C. Therefore, if A, then C There are 350.pdf
A) If A, then B. If B, then C. Therefore, if A, then C There are 350.pdf
 
Describe the therapeutic goal in treating acid-peptic disease.So.pdf
Describe the therapeutic goal in treating acid-peptic disease.So.pdfDescribe the therapeutic goal in treating acid-peptic disease.So.pdf
Describe the therapeutic goal in treating acid-peptic disease.So.pdf
 
Compare structure and culture of two or more firms. Which would you .pdf
Compare structure and culture of two or more firms. Which would you .pdfCompare structure and culture of two or more firms. Which would you .pdf
Compare structure and culture of two or more firms. Which would you .pdf
 
WRITE A program that displays the values in the list numbers in desc.pdf
WRITE A program that displays the values in the list numbers in desc.pdfWRITE A program that displays the values in the list numbers in desc.pdf
WRITE A program that displays the values in the list numbers in desc.pdf
 
What is an oligopotent stem cell and what is an exampleSolution.pdf
What is an oligopotent stem cell and what is an exampleSolution.pdfWhat is an oligopotent stem cell and what is an exampleSolution.pdf
What is an oligopotent stem cell and what is an exampleSolution.pdf
 
What are 4 different types of CVI systemsSolutionThe four typ.pdf
What are 4 different types of CVI systemsSolutionThe four typ.pdfWhat are 4 different types of CVI systemsSolutionThe four typ.pdf
What are 4 different types of CVI systemsSolutionThe four typ.pdf
 
Why is RNA more prone than DNA to forming secondary structures.pdf
Why is RNA more prone than DNA to forming secondary structures.pdfWhy is RNA more prone than DNA to forming secondary structures.pdf
Why is RNA more prone than DNA to forming secondary structures.pdf
 
What are the advantages and disadvantage of using the metric system o.pdf
What are the advantages and disadvantage of using the metric system o.pdfWhat are the advantages and disadvantage of using the metric system o.pdf
What are the advantages and disadvantage of using the metric system o.pdf
 
Which of the following model organisms would be the best choice if y.pdf
Which of the following model organisms would be the best choice if y.pdfWhich of the following model organisms would be the best choice if y.pdf
Which of the following model organisms would be the best choice if y.pdf
 
Write a C program that reads the words the user types at the command.pdf
Write a C program that reads the words the user types at the command.pdfWrite a C program that reads the words the user types at the command.pdf
Write a C program that reads the words the user types at the command.pdf
 
What happens to jointly held stock between two siblings when one .pdf
What happens to jointly held stock between two siblings when one .pdfWhat happens to jointly held stock between two siblings when one .pdf
What happens to jointly held stock between two siblings when one .pdf
 
The HER incentive programs incentive payments to eligible hospitals, .pdf
The HER incentive programs incentive payments to eligible hospitals, .pdfThe HER incentive programs incentive payments to eligible hospitals, .pdf
The HER incentive programs incentive payments to eligible hospitals, .pdf
 
The comet Shoemaker-Levy 9 broke up into a number of pieces called t.pdf
The comet Shoemaker-Levy 9 broke up into a number of pieces called t.pdfThe comet Shoemaker-Levy 9 broke up into a number of pieces called t.pdf
The comet Shoemaker-Levy 9 broke up into a number of pieces called t.pdf
 
The existence of universal values is still a matter of debate. But e.pdf
The existence of universal values is still a matter of debate. But e.pdfThe existence of universal values is still a matter of debate. But e.pdf
The existence of universal values is still a matter of debate. But e.pdf
 
The c program will implement the Caesar Cipher. Your program shou.pdf
The c program will implement the Caesar Cipher. Your program shou.pdfThe c program will implement the Caesar Cipher. Your program shou.pdf
The c program will implement the Caesar Cipher. Your program shou.pdf
 
Amino acids are acids because they contain which functional group S.pdf
Amino acids are acids because they contain which functional group  S.pdfAmino acids are acids because they contain which functional group  S.pdf
Amino acids are acids because they contain which functional group S.pdf
 
Suppose that theta is an acute angle of a right triangle and tan (the.pdf
Suppose that theta is an acute angle of a right triangle and tan (the.pdfSuppose that theta is an acute angle of a right triangle and tan (the.pdf
Suppose that theta is an acute angle of a right triangle and tan (the.pdf
 

Recently uploaded

Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 

Recently uploaded (20)

Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 

To write a program that implements the following C++ concepts 1. Dat.pdf

  • 1. To write a program that implements the following C++ concepts 1. Data Encapsulation 2. Instantiate classes 3. Composition Class 4. Aggregation Class 5. Dynamic Memory 6. File Stream Make a program that reads a file and can generate reports. Each file will have phone calls records (see section 4). The program will process the data gathering all minutes and total amount for each report. The program should have a menu (see section 1): 1. New Report – this option will ask a file name (TE??????.tel). This option will instantiate an object of Report class, loading the whole file into memory. 2. Delete a report – this option will display all reports available in memory and ask which one you would like to delete. 3. Display a report – this option will display all reports available in memory and ask you which one you would like to generate a report. 4. Exit – Program ends. For option 1, you do not know how many reports are, meaning that you will create dynamically the reports. For long distance calls the formula will be (minutes call x $1.50). For local phone calls the formula will be (minutes call x $0.25) -------------------------------------------------------------------------------------------------------------------- ---------------------------- //Main.cpp *#define between(x,y,z) ((x>=y && x<=z)? true:false) #include #include #include #include "Data.h" #include "Report.h" #include "Menu.h" using namespace std; //uses class Report to create reports //uses class Menu to display a menu to choose int main() { int idx = 0; int count = idx; Menu menu("Reports"); Data temp; string fileName; Report* phoneCompany; Report* newReport(Report*, int&); Report* deleteReport(Report*, int&, int); int displayReport(Report*, int);
  • 2. bool fileNameExists(string); menu.addMenuItem("New Report"); menu.addMenuItem("Delete a Report"); menu.addMenuItem("Display a Report"); ofstream openFile; phoneCompany = NULL; phoneCompany = new Report[count]; do { cout << menu; cin >> menu; switch (menu.getChoice()) { case '1': cout << " tEnter report name (TE??????): "; cin >> fileName; openFile.open(fileName + ".tel"); if (openFile.good()) { cout << " tReport succesfully created. "; phoneCompany[count].setFileName(fileName); count++; } else { cout << " terror: Could not create report. "; } break; case '2': if (count != 0) { do { system("cls"); cout << " tDelete a Report: "; idx = displayReport(phoneCompany, count); if (between(idx, 0, count - 1)) { phoneCompany = deleteReport(phoneCompany, count, idx); idx = 0; } else cout << " terror: Report could not be deleted. ";
  • 3. } while (idx != count); } else { cout << " tNo reports to delete. "; system("pause"); } break; case '3': if (count != 0) { do { system("cls"); cout << "Display a Report: "; idx = displayReport(phoneCompany, count); system("cls"); cout << " t" << phoneCompany[idx].getFileName(); cout << " tWould you like to edit the report?"; cout << " t1. Yes"; cout << " t2. No"; char ch; cin >> ch; do { switch (ch) { case '1': cin >> temp; phoneCompany[idx].setRecord(temp); case '2': cout << phoneCompany[idx]; default: cin.ignore(); break; } } while (ch != '2'); } while (idx != count); } else { cout << " tNo reports to display. ";
  • 4. system("pause"); } break; case '4': cout << "tThank you for using this Report System. "; break; default: cin.ignore(); break; } } while (menu.getChoice() != 4); delete[]phoneCompany; system("pause"); } Report* newReport(Report* report, int& total) { if (total == 0) { report = new Report[1]; } else { Report* temp = new Report[total]; for (int i = 0; i < total; i++) { temp[i] = report[i]; } delete[]report; report = new Report[total + 1]; for (int i = 0; i < total; i++) { report[i] = temp[i]; } delete[]temp; } total++; return report; } Report* deleteReport(Report* report, int& total, int idx) { Report* temp = new Report[total - 1]; string fileName = report[idx].getFileName();
  • 5. for (int i = 0; i < total; i++) { temp[i] = report[i]; } delete[]report; total--; report = new Report[total]; for (int i = 0; i < total; i++) { report[i] = temp[i]; } delete[]temp; cout << "Report " << fileName << " has been deleted. "; if (total == 0) report = NULL; return report; } int displayReports(Report* report, int total) { int choice; int i; for (i = 0; i < total; i++) { cout << "t" << i + 1 << ". " << report[i].getFileName() << endl; } cout << "t" << i + 1 << ". Return "; cout << "Choose: "; cin >> choice; return (choice - 1); }*/ // Report.h #pragma once #include #include #include "Data.h" using namespace std; //uses class Data to create a dynamic array containing client phone information class Report { friend ostream&operator<<(ostream&, const Report&); private:
  • 6. Data* records; string fileName; int totalRecords; float totalMinutes; float totalAmount; public: Report(); Report(const Data&, string); Report(const Report&); ~Report(); void setRecord(const Data&); void setFileName(string); void setTotalMinutes(float); void setTotalAmount(int); Data getRecord(int)const; string getFileName()const; int getTotalRecords()const; float getTotalMinutes()const; float getTotalAmount()const; }; //Report.cpp #include #include #include "Data.h" #include "Report.h" using namespace std; ostream&operator<<(ostream& output, const Report& aReport) { for (int i = 0; i < aReport.getTotalRecords(); i++) { output << "Report number is: " << aReport.getRecord(i) << endl; } return output; } Report::Report() { totalRecords = 0; fileName = ""; }
  • 7. Report::Report(const Data& aData, string name) { records[0] = aData; fileName = name; totalRecords = 1; } Report::Report(const Report& aReport) { setRecord(*aReport.records); setFileName(aReport.fileName); setTotalMinutes(aReport.totalMinutes); setTotalAmount(aReport.totalAmount); } Report::~Report() {} void Report::setRecord(const Data& aData) { int idx = totalRecords; if (totalRecords == 0) { records = new Data[1]; } else { Data* temp = new Data[totalRecords]; for (int i = 0; i < totalRecords; i++) { temp[i] = records[i]; } delete[]records; records = new Data[totalRecords + 1]; for (int i = 0; i < totalRecords; i++) { records[i] = temp[i]; } delete[]temp; } records[idx] = aData; totalRecords++; } void Report::setFileName(string name) { fileName = name; } void Report::setTotalMinutes(float minutes) {
  • 8. totalMinutes = minutes; } void Report::setTotalAmount(int idx) { if (records[idx].getLongDistance() == 1) { totalAmount = getTotalMinutes()*1.25; } else { totalAmount = getTotalMinutes()*0.25; } } Data Report::getRecord(int idx)const { return records[idx]; } string Report::getFileName()const { return fileName; } int Report::getTotalRecords()const { return totalRecords; } float Report::getTotalMinutes()const { return totalMinutes; } float Report::getTotalAmount()const { return totalAmount; } // Person.h #pragma once #include using namespace std; //stores a Persons' information class Person { friend ostream&operator<<(ostream&, const Person&); friend istream&operator>>(istream&, Person&); private: string firstName; string middleName;
  • 9. string lastName; string maidenName; public: Person(); Person(string, string, string, string); Person(const Person&); ~Person(); void setFirstName(string); void setMiddleName(string); void setLastName(string); void setMaidenName(string); string getFirstName()const; string getMiddleName()const; string getLastName()const; string getMaidenName()const; }; //Person.cpp #include #include #include "Person.h" using namespace std; ostream & operator <<(ostream & output, const Person & aPerson) { output << " First Name: " << aPerson.firstName; output << " LastName: " << aPerson.lastName; output << "MiddleName: " << aPerson.middleName; output << " Maiden Name: " << aPerson.maidenName; return output; } istream & operator >>(istream & input, Person & aPerson) { cout << " tEnter First Name, Middle Name, Last Name, and Maiden Name " << endl; input >> aPerson.firstName; input >> aPerson.middleName; input >> aPerson.lastName; input >> aPerson.maidenName; return input; }
  • 10. Person::Person() { firstName = ""; middleName = ""; lastName = ""; maidenName = ""; } Person::Person(string first, string middle, string last, string maiden) { firstName = first; middleName = middle; lastName = last; maidenName = maiden; } Person::Person(const Person & aPerson) { setFirstName(aPerson.firstName); setMiddleName(aPerson.middleName); setLastName(aPerson.lastName); setMaidenName(aPerson.maidenName); } Person::~Person(){} void Person::setFirstName(string first) { firstName = first; } void Person::setMiddleName(string middle) { middleName = middle; } void Person::setLastName(string last) { lastName = last; } void Person::setMaidenName(string maiden) { maidenName = maiden; } string Person::getFirstName()const { return firstName; } string Person::getMiddleName()const { return middleName;
  • 11. } string Person::getLastName()const { return lastName; } string Person::getMaidenName()const { return maidenName; } //Report.h #pragma once #include #include #include "Data.h" using namespace std; //uses class Data to create a dynamic array containing client phone information class Report { friend ostream&operator<<(ostream&, const Report&); private: Data* records; string fileName; int totalRecords; float totalMinutes; float totalAmount; public: Report(); Report(const Data&, string); Report(const Report&); ~Report(); void setRecord(const Data&); void setFileName(string); void setTotalMinutes(float); void setTotalAmount(int); Data getRecord(int)const; string getFileName()const; int getTotalRecords()const; float getTotalMinutes()const; float getTotalAmount()const;
  • 12. }; //Report.cpp #include #include #include "Data.h" #include "Report.h" using namespace std; ostream&operator<<(ostream& output, const Report& aReport) { for (int i = 0; i < aReport.getTotalRecords(); i++) { output << "Report number is: " << aReport.getRecord(i) << endl; } return output; } Report::Report() { totalRecords = 0; fileName = ""; } Report::Report(const Data& aData, string name) { records[0] = aData; fileName = name; totalRecords = 1; } Report::Report(const Report& aReport) { setRecord(*aReport.records); setFileName(aReport.fileName); setTotalMinutes(aReport.totalMinutes); setTotalAmount(aReport.totalAmount); } Report::~Report() {} void Report::setRecord(const Data& aData) { int idx = totalRecords; if (totalRecords == 0) { records = new Data[1]; } else { Data* temp = new Data[totalRecords];
  • 13. for (int i = 0; i < totalRecords; i++) { temp[i] = records[i]; } delete[]records; records = new Data[totalRecords + 1]; for (int i = 0; i < totalRecords; i++) { records[i] = temp[i]; } delete[]temp; } records[idx] = aData; totalRecords++; } void Report::setFileName(string name) { fileName = name; } void Report::setTotalMinutes(float minutes) { totalMinutes = minutes; } void Report::setTotalAmount(int idx) { if (records[idx].getLongDistance() == 1) { totalAmount = getTotalMinutes()*1.25; } else { totalAmount = getTotalMinutes()*0.25; } } Data Report::getRecord(int idx)const { return records[idx]; } string Report::getFileName()const { return fileName; } int Report::getTotalRecords()const { return totalRecords; }
  • 14. float Report::getTotalMinutes()const { return totalMinutes; } float Report::getTotalAmount()const { return totalAmount; } //Menu.h #pragma once #include #include using namespace std; //displays choices class Menu { friend ostream&operator<<(ostream& output, const Menu& aMenu) { system("cls"); int i; output << aMenu.title << endl << endl; for (i = 0; i < aMenu.totalItems; i++) { output << "tt" << i + 1 << ". " << aMenu.menuItems[i] << endl; } output << "tt" << i + 1 << ". Exit"; output << " Choose: "; return output; } friend istream&operator>>(istream& input, Menu& aMenu) { do { char ch; input >> ch; aMenu.setChoice(ch); if (!aMenu.check()) { cout << " ERROR."; system("pause"); cout << aMenu; } } while (!aMenu.check()); return input;
  • 15. } private: string* menuItems; string title; int totalItems; int choice; public: Menu() { menuItems = NULL; title = "Title"; totalItems = 0; } Menu(const char* ttl) { Menu(); title = ttl; } Menu(const Menu& aMenu) { } ~Menu() { delete[]menuItems; } void addMenuItem(string item) { int idx = totalItems; string* temp; if (idx == 0) { menuItems = new string[1]; } else { temp = new string[totalItems]; for (int i = 0; i < totalItems; i++) { temp[i] = menuItems[i]; } delete[]menuItems; menuItems = new string[totalItems + 1]; for (int i = 0; i < totalItems; i++) { menuItems[i] = temp[i];
  • 16. } delete[]temp; } menuItems[idx] = item; totalItems++; } void setTitle(string ttl) { title = ttl; } void setChoice(char choose) { choice = choose; } int getChoice()const { return choice; } int getLast()const { return totalItems + 1; } bool check() { bool validate; if (choice > 0 && choice <= (totalItems + 1)) { validate = true; } else validate = false; return validate; } }; //Data.h #pragma once #include #include #include "Person.h" using namespace std; //uses class Person to create a profile for a client class Data {
  • 17. friend ostream&operator<<(ostream&, const Data&); friend istream&operator>>(istream&, Data&); private: Person client; string callDate; bool longDistance; string timeCallBegin; string timeCallEnd; string callNoFrom; string callNoTo; public: Data(); Data(const Person&, string, bool, string, string, string, string); Data(const Data&); ~Data(); void setClient(const Person&); void setCallDate(string); void setLongDistance(bool); void setTimeCallBegin(string); void setTimeCallEnd(string); void setCallNoFrom(string); void setCallNoTo(string); Person getClient()const; string getCallDate()const; bool getLongDistance()const; string getTimeCallBegin()const; string getTimeCallEnd()const; string getCallNoFrom()const; string getCallNoTo()const; Data operator=(const Data&); }; //Data.cpp #include #include #include "Person.h" #include "Data.h"
  • 18. using namespace std; ostream & operator <<(ostream & output, const Data & aData) { Person person; output << "Providing Client Information:" << endl; output << person.getFirstName(); output << person.getLastName(); output << person.getMiddleName(); output << person.getMaidenName(); output << endl << "Call Date: " << aData.callDate << endl; output << "longDistance Charge: " << aData.longDistance ? " Y " : " N ";//Yes or No question output << "Time Call Begin: " << aData.timeCallBegin; output << "Time Call End: " << aData.timeCallEnd; output << "Call # From: " << aData.callNoFrom; output << "Call # to: " << aData.callNoTo; return output; } istream & operator >>(istream & input, Data & aData) { cout << "Client Information: " << endl; input >> aData.client; cout << "Call Date: " << endl; input >> aData.callDate; cout << " Long Distance: " << endl; input >> aData.longDistance; cout << " Time Call Begin: " << endl; input >> aData.timeCallBegin; cout << " Time Call End: " << endl; input >> aData.timeCallEnd; cout << " Call # From : " << endl; input >> aData.callNoFrom; cout << " Call # To: " << endl; input >> aData.callNoTo; return input; } Data::Data() { setClient(Person("", "", "", ""));
  • 19. setCallDate(" "); setLongDistance(false); setTimeCallBegin(" "); setTimeCallEnd(" "); setCallNoFrom(" "); setCallNoTo(" "); } Data::Data(const Person& aPerson, string date, bool longD, string begin, string end, string from, string to) { setClient(aPerson); setCallDate(date); setLongDistance(longD); setTimeCallBegin(begin); setTimeCallEnd(end); setCallNoFrom(from); setCallNoTo(to); } Data::Data(const Data& aData) { setClient(aData.client); setCallDate(aData.callDate); setLongDistance(aData.longDistance); setTimeCallBegin(aData.timeCallBegin); setTimeCallEnd(aData.timeCallEnd); setCallNoFrom(aData.callNoFrom); setCallNoTo(aData.callNoTo); } Data::~Data() {} void Data::setClient(const Person& person) { client = person; } void Data::setCallDate(string date) { callDate = date; } void Data::setLongDistance(bool longD) { longDistance = longD; }
  • 20. void Data::setTimeCallBegin(string begin) { timeCallBegin = begin; } void Data::setTimeCallEnd(string end) { timeCallEnd = end; } void Data::setCallNoFrom(string from) { callNoFrom = from; } void Data::setCallNoTo(string to) { callNoTo = to; } Person Data::getClient()const { return client; } string Data::getCallDate()const { return callDate; } bool Data::getLongDistance()const { return longDistance; } string Data::getTimeCallBegin()const { return timeCallBegin; } string Data::getTimeCallEnd()const { return timeCallEnd; } string Data::getCallNoFrom()const { return callNoFrom; } string Data::getCallNoTo()const { return callNoTo; } Data Data::operator=(const Data& aData) { client = aData.client; callDate = aData.callDate;
  • 21. longDistance = aData.longDistance; timeCallBegin = aData.timeCallBegin; timeCallEnd = aData.timeCallEnd; callNoFrom = aData.callNoFrom; callNoTo = aData.callNoTo; return *this; } //DataParser.h #pragma once #include #include #include "Data.h" using namespace std; //separates the information from a file to store in Data.h class DataParser { private: Data record; public: DataParser(); DataParser(const Data&); DataParser(const DataParser&); DataParser(string); ~DataParser(); void setRecord(string); Data getRecord()const; Data parse(string); }; //DataParser.cpp #include #include #include "Data.h" #include "DataParser.h" using namespace std; DataParser::DataParser() { record; }
  • 22. DataParser::DataParser(const Data& aData) { record = aData; } DataParser::DataParser(const DataParser& aDataParser) { record = aDataParser.record; } DataParser::DataParser(string line) { parse(line); } DataParser::~DataParser() {} void DataParser::setRecord(string line) { parse(line); } Data DataParser::getRecord()const { return record; } Data DataParser::parse(string line) { Person client; string callDate; bool longDistance; string timeCallBegin; string timeCallEnd; string callNoFrom; string callNoTo; string firstName; string lastName; string middleName; string maidenName; string blank; firstName = line.substr(0, 25); middleName = line.substr(26, 50); lastName = line.substr(51, 100); maidenName = line.substr(101, 150); callDate = line.substr(151, 158); if (line.substr(159, 159) == "1")
  • 23. longDistance = true; else longDistance = false; timeCallBegin = line.substr(160, 165); timeCallEnd = line.substr(166, 171); callNoFrom = line.substr(172, 181); callNoTo = line.substr(182, 191); blank = line.substr(192, 250); record.setClient(Person(firstName, middleName, lastName, maidenName)); record.setCallDate(callDate); record.setLongDistance(longDistance); record.setTimeCallBegin(timeCallBegin); record.setTimeCallEnd(timeCallEnd); record.setCallNoFrom(callNoFrom); record.setCallNoTo(callNoTo); return record; } ===================================================================== ====== This is what I have so far I need the program to give me the following output but it giving me error in the Main.cpp and such, any help would be appreaciated. Section 5 Output cmd.exe eport Date: 01/26/2015 eport from: TE20150126.tel ast Name First Name Call Date Long From To Mins odriguez Soto Carlos M 01/26/2015N 787-399-2234 787-234-2345 26 6.50 1/19/2015 N 787-234-5643 787-345-1234 38 9.50 2/23/2014787-356-2345 305-456-234567 100.50 Felix G David P erez Roman Grand Total: 131 116.50 C:UsersCarlosDocuments Solution Sum of Natural Numbers Using while Loop