SlideShare a Scribd company logo
1 of 31
Download to read offline
main.cpp
#include
#include
#include "SwimmingPool.h"
using namespace std;
void printMainMenu();
void printPoolVolume();
void printGetPoolDimensions(bool);
void printHasDimensions();
void checkDimensions();
void printError();
void printPoolDimensions();
double editValue(double);
void printGetFillRate();
void printGetDrainRate();
void printAddWater();
void printDrainRate();
void printFillRate();
char printWantwer();
SwimmingPool pool;
int _response;
int _numResponses;
double _length;
double _width;
double _depth;
//double _currentwerVolume;
double _drainRate;
double _fillRate;
bool _end;
char _newValue[5];
int main()
{
int fillTime;
int drainTime;
double drained;
// Set output style and precision
cout << fixed << showpoint << setprecision(2);
// Main program loop
// ends when _end==true
while (!_end)
{
// Prints main option list
printMainMenu();
// Switch based on response
switch (_response)
{
// Sets pool dimensions
case 1:
if (pool.hasDimensions())
printHasDimensions();
else
{
printPoolDimensions();
printPoolVolume();
}
break;
// Prints pool dimensions
case 2:
printGetPoolDimensions(false);
system("pause");
break;
// Prints fill rate
case 3:
printGetFillRate();
break;
// Prints drain rate
case 4:
printGetDrainRate();
break;
// Determine water need to fill pool to capacity
case 5:
checkDimensions();
if (!pool.hasWater())
cout << " The pool is currently empty";
else
{
cout << " The pool currently has "
<< pool.getwerVolume()
<< " units"
<< endl;
}
cout << "  Water needed: "
<< pool.getFillAmount(pool.getwerVolume())
<< " units of water  ";
system("pause");
break;
// Determine time required to fill pool at rate
case 6:
if (!pool.hasDimensions())
{
cout << " Pool dimensions not yet entered. ";
printGetPoolDimensions(false);
}
if (pool.getFillRate() <= 0)
printGetFillRate();
cout << " Time to fill pool: "
<< pool.getFillTime()
<< endl
<< endl;
system("pause");
break;
// Determine time required to drain pool at rate
case 7:
checkDimensions();
if (_drainRate <= 0)
printGetDrainRate();
if (!pool.hasWater())
{
char response = printWantwer();
while (response != 'y' && response != 'n')
{
printError();
response = printWantwer();
}
if (response == 'y')
printAddWater();
else
break;;
}
cout << " Time to drain pool: "
<< pool.getDrainTime()
<< endl
<< endl;
system("pause");
break;
case 8:
checkDimensions();
if (pool.getFillRate() <= 0)
printGetFillRate();
else
printFillRate();
cout << " Enter fill time: ";
cin >> fillTime;
pool.setFillTime(fillTime);
pool.setwerVolume(pool.getwerVolume() + pool.fill());
cout << endl
<< pool.fill()
<< " units of water were added to the pool  "
<< " The pool now contains "
<< pool.getwerVolume()
<< " units of water  ";
system("pause");
break;
case 9:
checkDimensions();
if (pool.getDrainRate() <= 0)
printGetDrainRate();
else
printDrainRate();
cout << " Enter drain time: ";
cin >> drainTime;
pool.setDrainTime(drainTime);
if (!pool.hasWater())
{
char response = printWantwer();
while (response != 'y' && response != 'n')
{
printError();
response = printWantwer();
cout << "  Response is "
<< response;
}
if (response == 'y')
printAddWater();
else
break;
}
drained = pool.drain();
cout << endl
<< " "
<< drained
<< " units of water were removed from the pool  "
<< " The pool now contains "
<< pool.getwerVolume()
<< " units of water  ";
system("pause");
break;
case 10:
_end = true;
break;
default:
printError();
break;
}
}
return EXIT_SUCCESS;
}
void printMainMenu()
{
_numResponses = 6;
cout << " Type the number cooresponding to the task you would like to complete:   "
<< " 1) Set pool dimensions "
<< " 2) Print pool dimensions "
<< " 3) Set fill rate "
<< " 4) Set drain rate "
<< " Print fill and drain rates "
<< " Add water to pool "
<< " Remove water from pool "
<< " 5) Determine water needed to fill pool to capacity  "
<< " Determine time required to:  "
<< " 6) fill pool "
<< " 7) drain pool  "
<< " For a specific amount of time:  "
<< " 8) fill pool "
<< " 9) drain pool "
<< " 10) Exit Program  "
<< " Choice: ";
cin >> _response;
}
void printPoolVolume()
{
cout << " Pool volume is "
<< pool.getVolume()
<< endl
<< endl;
}
void printGetPoolDimensions(bool edit)
{
cout << " Enter pool dimensions:"
<< endl
<< " Length: ";
if (edit)
editValue(_length);
cin >> _length;
pool.setLength(_length);
cout << " Width: ";
if (edit)
editValue(_width);
cin >> _width;
pool.setWidth(_width);
cout << " Depth: ";
if (edit)
editValue(_depth);
cin >> _depth;
pool.setDepth(_depth);
printPoolVolume();
}
double editValue(double value)
{
cout << value;
cin.seekg(0, cin.beg);
cin.getline(_newValue, 5);
return atof(_newValue);
}
void printHasDimensions()
{
_numResponses = 2;
cout << " The pool already has dimensions"
<< endl
<< endl
<< "1) Create new dimensions"
//<< endl
//<< "2) Edit current dimensions"
<< endl
<< "2) Return to main menu"
<< endl
<< "Response: ";
cin >> _response;
switch (_response)
{
case 1:
printGetPoolDimensions(false);
break;
//case 2:
// // Print pool dimensions prompt with existing values
// printGetPoolDimensions(true);
// break;
case 2:
printMainMenu();
break;
default:
printError();
printHasDimensions();
break;
}
}
// Function that prints an error when invalid option entered at menu
void printError()
{
cout << "a" // make an error sound
// print error
<< " You entered an invalid response, please try again"
<< endl
<< endl;
}
void printPoolDimensions()
{
cout << "  Pool Dimensions  "
<< " Length: "
<< _length
<< endl
<< " Width: "
<< _width
<< endl
<< " Depth: "
<< _depth
<< endl
<< endl;
printPoolVolume();
}
void checkDimensions()
{
if (!pool.hasDimensions())
{
cout << " Pool dimensions not yet entered. ";
printGetPoolDimensions(false);
}
}
void printGetFillRate()
{
cout << " Enter the fill rate: ";
cin >> _fillRate;
pool.setFillRate(_fillRate);
}
void printGetDrainRate()
{
cout << " Enter the drain rate: ";
cin >> _drainRate;
pool.setDrainRate(_drainRate);
}
void printAddWater()
{
double currentwerVolume;
cout << " How much water would you like to add?  "
<< " Response: ";
cin >> currentwerVolume;
if (currentwerVolume > pool.getVolume())
{
currentwerVolume = pool.getVolume();
cout << " You entered more than the pool could hold ("
<< pool.getVolume()
<< ") but I fixed that for you. ";
}
pool.setwerVolume(currentwerVolume);
}
void printDrainRate()
{
cout << " Drain rate is currently: "
<< pool.getDrainRate()
<< endl
<< endl;
}
void printFillRate()
{
cout << " Fill rate is currently: "
<< pool.getFillRate()
<< endl
<< endl;
}
char printWantwer()
{
char response;
cout << " The pool has no water to drain! "
<< " Would you like to add water?"
<< endl
<< endl
<< " Response: ";
cin >> response;
return response;
}
SwimmingPool.h
#pragma once
class SwimmingPool
{
public:
SwimmingPool();
SwimmingPool(double, double, double);
SwimmingPool(double, double, double, double, double);
void setLength(double);
void setWidth(double);
void setDepth(double);
void setDrainRate(double);
double getDrainRate();
void setFillRate(double);
double getFillRate();
void setFillTime(int);
void setDrainTime(int);
void setwerVolume(double);
double getVolume();
double getwerVolume();
double getFillAmount(double);
int getDrainTime();
int getFillTime();
double drain();
double fill();
double fill(int);
bool hasDimensions();
bool hasWater();
private:
double _length;
double _width;
double _depth;
double _fillRate;
double _drainRate;
int _fillTime;
int _drainTime;
double _volume;
double _waterVolume;
};
SwimmingPool.cpp
#include "SwimmingPool.h"
using namespace std;
// Default constructor
SwimmingPool::SwimmingPool()
{
_length = 0;
_width = 0;
_depth = 0;
}
// Basic constructor defined with member initialization
SwimmingPool::SwimmingPool (double l, double w, double d) :_length(l), _width(w),
_depth(d)
{
// Assign to the instance variables the arguments passed to constructo
_volume = _length * _width * _depth;
}
// Full Constructor
SwimmingPool::SwimmingPool(double length, double width, double depth, double fillRate,
double drainRate)
{
// Assign to the instance variables the arguments passed to constructor
_length = length;
_width = width;
_depth = depth;
_fillRate = fillRate;
_drainRate = drainRate;
_volume = getVolume();
// Get the volume
}
void SwimmingPool::setLength(double l)
{
_length = l;
}
void SwimmingPool::setWidth(double w)
{
_width = w;
}
void SwimmingPool::setDepth(double d)
{
_depth = d;
}
void SwimmingPool::setDrainRate(double r)
{
_drainRate = r;
}
double SwimmingPool::getDrainRate()
{
return _drainRate;
}
void SwimmingPool::setFillRate(double r)
{
_fillRate = r;
}
double SwimmingPool::getFillRate()
{
return _fillRate;
}
void SwimmingPool::setFillTime(int t)
{
_fillTime = t;
}
void SwimmingPool::setDrainTime(int t)
{
_drainTime = t;
}
// Member function to calculate volume
double SwimmingPool::getVolume()
{
// No need to check values of instance variables
// Return the volume
return _length * _width * _depth;
}
void SwimmingPool::setwerVolume(double v)
{
_waterVolume = v;
}
double SwimmingPool::getwerVolume()
{
return _waterVolume;
}
// Returns amount of water needed to fill an empty or partially filled pool
double SwimmingPool::getFillAmount(double currentwerVolume)
{
return getVolume() - currentwerVolume;
}
// Returns time needed to completely or partially drain the pool
int SwimmingPool::getDrainTime()
{
return (int)(_waterVolume/_drainRate);
}
// Returns the time need to completely or partially drain the pool
int SwimmingPool::getFillTime()
{
return (int)(getVolume()/_fillRate);
}
// Drain the pool for a specified time period
// Returns adjusted water volume
double SwimmingPool::drain()
{
double waterDrained = _drainRate * _drainTime;
_waterVolume -= waterDrained;
if (_waterVolume < 0)
_waterVolume = 0;
return waterDrained;
}
double SwimmingPool::fill()
{
_waterVolume += _fillRate * _fillTime;
return _waterVolume;
}
// Fill the pool for a specified time period
// Returns adjusted water volume
double SwimmingPool::fill(int time)
{
return 0;
}
bool SwimmingPool::hasDimensions()
{
if (_length > 0 && _width > 0 && _depth > 0)
return true;
else
return false;
}
bool SwimmingPool::hasWater()
{
if (_waterVolume > 0)
return true;
else
return false;
}
Solution
main.cpp
#include
#include
#include "SwimmingPool.h"
using namespace std;
void printMainMenu();
void printPoolVolume();
void printGetPoolDimensions(bool);
void printHasDimensions();
void checkDimensions();
void printError();
void printPoolDimensions();
double editValue(double);
void printGetFillRate();
void printGetDrainRate();
void printAddWater();
void printDrainRate();
void printFillRate();
char printWantwer();
SwimmingPool pool;
int _response;
int _numResponses;
double _length;
double _width;
double _depth;
//double _currentwerVolume;
double _drainRate;
double _fillRate;
bool _end;
char _newValue[5];
int main()
{
int fillTime;
int drainTime;
double drained;
// Set output style and precision
cout << fixed << showpoint << setprecision(2);
// Main program loop
// ends when _end==true
while (!_end)
{
// Prints main option list
printMainMenu();
// Switch based on response
switch (_response)
{
// Sets pool dimensions
case 1:
if (pool.hasDimensions())
printHasDimensions();
else
{
printPoolDimensions();
printPoolVolume();
}
break;
// Prints pool dimensions
case 2:
printGetPoolDimensions(false);
system("pause");
break;
// Prints fill rate
case 3:
printGetFillRate();
break;
// Prints drain rate
case 4:
printGetDrainRate();
break;
// Determine water need to fill pool to capacity
case 5:
checkDimensions();
if (!pool.hasWater())
cout << " The pool is currently empty";
else
{
cout << " The pool currently has "
<< pool.getwerVolume()
<< " units"
<< endl;
}
cout << "  Water needed: "
<< pool.getFillAmount(pool.getwerVolume())
<< " units of water  ";
system("pause");
break;
// Determine time required to fill pool at rate
case 6:
if (!pool.hasDimensions())
{
cout << " Pool dimensions not yet entered. ";
printGetPoolDimensions(false);
}
if (pool.getFillRate() <= 0)
printGetFillRate();
cout << " Time to fill pool: "
<< pool.getFillTime()
<< endl
<< endl;
system("pause");
break;
// Determine time required to drain pool at rate
case 7:
checkDimensions();
if (_drainRate <= 0)
printGetDrainRate();
if (!pool.hasWater())
{
char response = printWantwer();
while (response != 'y' && response != 'n')
{
printError();
response = printWantwer();
}
if (response == 'y')
printAddWater();
else
break;;
}
cout << " Time to drain pool: "
<< pool.getDrainTime()
<< endl
<< endl;
system("pause");
break;
case 8:
checkDimensions();
if (pool.getFillRate() <= 0)
printGetFillRate();
else
printFillRate();
cout << " Enter fill time: ";
cin >> fillTime;
pool.setFillTime(fillTime);
pool.setwerVolume(pool.getwerVolume() + pool.fill());
cout << endl
<< pool.fill()
<< " units of water were added to the pool  "
<< " The pool now contains "
<< pool.getwerVolume()
<< " units of water  ";
system("pause");
break;
case 9:
checkDimensions();
if (pool.getDrainRate() <= 0)
printGetDrainRate();
else
printDrainRate();
cout << " Enter drain time: ";
cin >> drainTime;
pool.setDrainTime(drainTime);
if (!pool.hasWater())
{
char response = printWantwer();
while (response != 'y' && response != 'n')
{
printError();
response = printWantwer();
cout << "  Response is "
<< response;
}
if (response == 'y')
printAddWater();
else
break;
}
drained = pool.drain();
cout << endl
<< " "
<< drained
<< " units of water were removed from the pool  "
<< " The pool now contains "
<< pool.getwerVolume()
<< " units of water  ";
system("pause");
break;
case 10:
_end = true;
break;
default:
printError();
break;
}
}
return EXIT_SUCCESS;
}
void printMainMenu()
{
_numResponses = 6;
cout << " Type the number cooresponding to the task you would like to complete:   "
<< " 1) Set pool dimensions "
<< " 2) Print pool dimensions "
<< " 3) Set fill rate "
<< " 4) Set drain rate "
<< " Print fill and drain rates "
<< " Add water to pool "
<< " Remove water from pool "
<< " 5) Determine water needed to fill pool to capacity  "
<< " Determine time required to:  "
<< " 6) fill pool "
<< " 7) drain pool  "
<< " For a specific amount of time:  "
<< " 8) fill pool "
<< " 9) drain pool "
<< " 10) Exit Program  "
<< " Choice: ";
cin >> _response;
}
void printPoolVolume()
{
cout << " Pool volume is "
<< pool.getVolume()
<< endl
<< endl;
}
void printGetPoolDimensions(bool edit)
{
cout << " Enter pool dimensions:"
<< endl
<< " Length: ";
if (edit)
editValue(_length);
cin >> _length;
pool.setLength(_length);
cout << " Width: ";
if (edit)
editValue(_width);
cin >> _width;
pool.setWidth(_width);
cout << " Depth: ";
if (edit)
editValue(_depth);
cin >> _depth;
pool.setDepth(_depth);
printPoolVolume();
}
double editValue(double value)
{
cout << value;
cin.seekg(0, cin.beg);
cin.getline(_newValue, 5);
return atof(_newValue);
}
void printHasDimensions()
{
_numResponses = 2;
cout << " The pool already has dimensions"
<< endl
<< endl
<< "1) Create new dimensions"
//<< endl
//<< "2) Edit current dimensions"
<< endl
<< "2) Return to main menu"
<< endl
<< "Response: ";
cin >> _response;
switch (_response)
{
case 1:
printGetPoolDimensions(false);
break;
//case 2:
// // Print pool dimensions prompt with existing values
// printGetPoolDimensions(true);
// break;
case 2:
printMainMenu();
break;
default:
printError();
printHasDimensions();
break;
}
}
// Function that prints an error when invalid option entered at menu
void printError()
{
cout << "a" // make an error sound
// print error
<< " You entered an invalid response, please try again"
<< endl
<< endl;
}
void printPoolDimensions()
{
cout << "  Pool Dimensions  "
<< " Length: "
<< _length
<< endl
<< " Width: "
<< _width
<< endl
<< " Depth: "
<< _depth
<< endl
<< endl;
printPoolVolume();
}
void checkDimensions()
{
if (!pool.hasDimensions())
{
cout << " Pool dimensions not yet entered. ";
printGetPoolDimensions(false);
}
}
void printGetFillRate()
{
cout << " Enter the fill rate: ";
cin >> _fillRate;
pool.setFillRate(_fillRate);
}
void printGetDrainRate()
{
cout << " Enter the drain rate: ";
cin >> _drainRate;
pool.setDrainRate(_drainRate);
}
void printAddWater()
{
double currentwerVolume;
cout << " How much water would you like to add?  "
<< " Response: ";
cin >> currentwerVolume;
if (currentwerVolume > pool.getVolume())
{
currentwerVolume = pool.getVolume();
cout << " You entered more than the pool could hold ("
<< pool.getVolume()
<< ") but I fixed that for you. ";
}
pool.setwerVolume(currentwerVolume);
}
void printDrainRate()
{
cout << " Drain rate is currently: "
<< pool.getDrainRate()
<< endl
<< endl;
}
void printFillRate()
{
cout << " Fill rate is currently: "
<< pool.getFillRate()
<< endl
<< endl;
}
char printWantwer()
{
char response;
cout << " The pool has no water to drain! "
<< " Would you like to add water?"
<< endl
<< endl
<< " Response: ";
cin >> response;
return response;
}
SwimmingPool.h
#pragma once
class SwimmingPool
{
public:
SwimmingPool();
SwimmingPool(double, double, double);
SwimmingPool(double, double, double, double, double);
void setLength(double);
void setWidth(double);
void setDepth(double);
void setDrainRate(double);
double getDrainRate();
void setFillRate(double);
double getFillRate();
void setFillTime(int);
void setDrainTime(int);
void setwerVolume(double);
double getVolume();
double getwerVolume();
double getFillAmount(double);
int getDrainTime();
int getFillTime();
double drain();
double fill();
double fill(int);
bool hasDimensions();
bool hasWater();
private:
double _length;
double _width;
double _depth;
double _fillRate;
double _drainRate;
int _fillTime;
int _drainTime;
double _volume;
double _waterVolume;
};
SwimmingPool.cpp
#include "SwimmingPool.h"
using namespace std;
// Default constructor
SwimmingPool::SwimmingPool()
{
_length = 0;
_width = 0;
_depth = 0;
}
// Basic constructor defined with member initialization
SwimmingPool::SwimmingPool (double l, double w, double d) :_length(l), _width(w),
_depth(d)
{
// Assign to the instance variables the arguments passed to constructo
_volume = _length * _width * _depth;
}
// Full Constructor
SwimmingPool::SwimmingPool(double length, double width, double depth, double fillRate,
double drainRate)
{
// Assign to the instance variables the arguments passed to constructor
_length = length;
_width = width;
_depth = depth;
_fillRate = fillRate;
_drainRate = drainRate;
_volume = getVolume();
// Get the volume
}
void SwimmingPool::setLength(double l)
{
_length = l;
}
void SwimmingPool::setWidth(double w)
{
_width = w;
}
void SwimmingPool::setDepth(double d)
{
_depth = d;
}
void SwimmingPool::setDrainRate(double r)
{
_drainRate = r;
}
double SwimmingPool::getDrainRate()
{
return _drainRate;
}
void SwimmingPool::setFillRate(double r)
{
_fillRate = r;
}
double SwimmingPool::getFillRate()
{
return _fillRate;
}
void SwimmingPool::setFillTime(int t)
{
_fillTime = t;
}
void SwimmingPool::setDrainTime(int t)
{
_drainTime = t;
}
// Member function to calculate volume
double SwimmingPool::getVolume()
{
// No need to check values of instance variables
// Return the volume
return _length * _width * _depth;
}
void SwimmingPool::setwerVolume(double v)
{
_waterVolume = v;
}
double SwimmingPool::getwerVolume()
{
return _waterVolume;
}
// Returns amount of water needed to fill an empty or partially filled pool
double SwimmingPool::getFillAmount(double currentwerVolume)
{
return getVolume() - currentwerVolume;
}
// Returns time needed to completely or partially drain the pool
int SwimmingPool::getDrainTime()
{
return (int)(_waterVolume/_drainRate);
}
// Returns the time need to completely or partially drain the pool
int SwimmingPool::getFillTime()
{
return (int)(getVolume()/_fillRate);
}
// Drain the pool for a specified time period
// Returns adjusted water volume
double SwimmingPool::drain()
{
double waterDrained = _drainRate * _drainTime;
_waterVolume -= waterDrained;
if (_waterVolume < 0)
_waterVolume = 0;
return waterDrained;
}
double SwimmingPool::fill()
{
_waterVolume += _fillRate * _fillTime;
return _waterVolume;
}
// Fill the pool for a specified time period
// Returns adjusted water volume
double SwimmingPool::fill(int time)
{
return 0;
}
bool SwimmingPool::hasDimensions()
{
if (_length > 0 && _width > 0 && _depth > 0)
return true;
else
return false;
}
bool SwimmingPool::hasWater()
{
if (_waterVolume > 0)
return true;
else
return false;
}

More Related Content

Similar to main.cpp #include iostream #include iomanip #include S.pdf

4 operators, expressions &amp; statements
4  operators, expressions &amp; statements4  operators, expressions &amp; statements
4 operators, expressions &amp; statementsMomenMostafa
 
Final requirement in programming niperos
Final requirement in programming   niperosFinal requirement in programming   niperos
Final requirement in programming niperosmarkings17
 
Final requirement (2)
Final requirement (2)Final requirement (2)
Final requirement (2)Anjie Sengoku
 
Powerpoint presentation final requirement in fnd prg
Powerpoint presentation final requirement in fnd prgPowerpoint presentation final requirement in fnd prg
Powerpoint presentation final requirement in fnd prgalyssa-castro2326
 
Workshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptWorkshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptVisual Engineering
 
Start with the inclusion of libraries#include iostream .docx
 Start with the inclusion of libraries#include iostream .docx Start with the inclusion of libraries#include iostream .docx
Start with the inclusion of libraries#include iostream .docxMARRY7
 
Travel management
Travel managementTravel management
Travel management1Parimal2
 
Hi,Please fidn the Answer.Sorting,h is Header .pdf
Hi,Please fidn the Answer.Sorting,h is Header .pdfHi,Please fidn the Answer.Sorting,h is Header .pdf
Hi,Please fidn the Answer.Sorting,h is Header .pdfanandf0099
 
This what Im suppose to do and this is what I have so far.In thi.pdf
This what Im suppose to do and this is what I have so far.In thi.pdfThis what Im suppose to do and this is what I have so far.In thi.pdf
This what Im suppose to do and this is what I have so far.In thi.pdfkavithaarp
 
Bangun datar dan bangun ruang
Bangun datar dan bangun ruangBangun datar dan bangun ruang
Bangun datar dan bangun ruangSanSan Yagyoo
 
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...DroidConTLV
 

Similar to main.cpp #include iostream #include iomanip #include S.pdf (20)

Tu1
Tu1Tu1
Tu1
 
4 operators, expressions &amp; statements
4  operators, expressions &amp; statements4  operators, expressions &amp; statements
4 operators, expressions &amp; statements
 
Final requirement in programming niperos
Final requirement in programming   niperosFinal requirement in programming   niperos
Final requirement in programming niperos
 
Macaraeg
MacaraegMacaraeg
Macaraeg
 
Memory Manglement in Raku
Memory Manglement in RakuMemory Manglement in Raku
Memory Manglement in Raku
 
verilog code
verilog codeverilog code
verilog code
 
Final requirement (2)
Final requirement (2)Final requirement (2)
Final requirement (2)
 
Powerpoint presentation final requirement in fnd prg
Powerpoint presentation final requirement in fnd prgPowerpoint presentation final requirement in fnd prg
Powerpoint presentation final requirement in fnd prg
 
Php 5.6
Php 5.6Php 5.6
Php 5.6
 
Workshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptWorkshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScript
 
7 functions
7  functions7  functions
7 functions
 
Start with the inclusion of libraries#include iostream .docx
 Start with the inclusion of libraries#include iostream .docx Start with the inclusion of libraries#include iostream .docx
Start with the inclusion of libraries#include iostream .docx
 
Travel management
Travel managementTravel management
Travel management
 
Hi,Please fidn the Answer.Sorting,h is Header .pdf
Hi,Please fidn the Answer.Sorting,h is Header .pdfHi,Please fidn the Answer.Sorting,h is Header .pdf
Hi,Please fidn the Answer.Sorting,h is Header .pdf
 
Form1.Cs
Form1.CsForm1.Cs
Form1.Cs
 
This what Im suppose to do and this is what I have so far.In thi.pdf
This what Im suppose to do and this is what I have so far.In thi.pdfThis what Im suppose to do and this is what I have so far.In thi.pdf
This what Im suppose to do and this is what I have so far.In thi.pdf
 
Microkernel Development
Microkernel DevelopmentMicrokernel Development
Microkernel Development
 
C++ TUTORIAL 1
C++ TUTORIAL 1C++ TUTORIAL 1
C++ TUTORIAL 1
 
Bangun datar dan bangun ruang
Bangun datar dan bangun ruangBangun datar dan bangun ruang
Bangun datar dan bangun ruang
 
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
 

More from arasanlethers

#include SDLSDL.hSDL_Surface Background = NULL; SDL_Surface.pdf
#include SDLSDL.hSDL_Surface Background = NULL; SDL_Surface.pdf#include SDLSDL.hSDL_Surface Background = NULL; SDL_Surface.pdf
#include SDLSDL.hSDL_Surface Background = NULL; SDL_Surface.pdfarasanlethers
 
C, D, and E are wrong and involve random constants. Thisnarrows it d.pdf
C, D, and E are wrong and involve random constants. Thisnarrows it d.pdfC, D, and E are wrong and involve random constants. Thisnarrows it d.pdf
C, D, and E are wrong and involve random constants. Thisnarrows it d.pdfarasanlethers
 
AnswerOogenesis is the process by which ovum mother cells or oogo.pdf
AnswerOogenesis is the process by which ovum mother cells or oogo.pdfAnswerOogenesis is the process by which ovum mother cells or oogo.pdf
AnswerOogenesis is the process by which ovum mother cells or oogo.pdfarasanlethers
 
AnswerB) S. typhimuium gains access to the host by crossing the.pdf
AnswerB) S. typhimuium gains access to the host by crossing the.pdfAnswerB) S. typhimuium gains access to the host by crossing the.pdf
AnswerB) S. typhimuium gains access to the host by crossing the.pdfarasanlethers
 
Answer question1,2,4,5Ion–dipole interactionsAffinity of oxygen .pdf
Answer question1,2,4,5Ion–dipole interactionsAffinity of oxygen .pdfAnswer question1,2,4,5Ion–dipole interactionsAffinity of oxygen .pdf
Answer question1,2,4,5Ion–dipole interactionsAffinity of oxygen .pdfarasanlethers
 
A Letter to myself!Hi to myself!Now that I am an Engineer with a.pdf
A Letter to myself!Hi to myself!Now that I am an Engineer with a.pdfA Letter to myself!Hi to myself!Now that I am an Engineer with a.pdf
A Letter to myself!Hi to myself!Now that I am an Engineer with a.pdfarasanlethers
 
Particulars Amount ($) Millons a) Purchase consideratio.pdf
     Particulars  Amount ($) Millons          a) Purchase consideratio.pdf     Particulars  Amount ($) Millons          a) Purchase consideratio.pdf
Particulars Amount ($) Millons a) Purchase consideratio.pdfarasanlethers
 
2 = 14.191,     df = 9,2df = 1.58 ,         P(2 14.191) = .pdf
2 = 14.191,     df = 9,2df = 1.58 ,         P(2  14.191) = .pdf2 = 14.191,     df = 9,2df = 1.58 ,         P(2  14.191) = .pdf
2 = 14.191,     df = 9,2df = 1.58 ,         P(2 14.191) = .pdfarasanlethers
 
while determining the pH the pH of the water is n.pdf
                     while determining the pH the pH of the water is n.pdf                     while determining the pH the pH of the water is n.pdf
while determining the pH the pH of the water is n.pdfarasanlethers
 
Quantum Numbers and Atomic Orbitals By solving t.pdf
                     Quantum Numbers and Atomic Orbitals  By solving t.pdf                     Quantum Numbers and Atomic Orbitals  By solving t.pdf
Quantum Numbers and Atomic Orbitals By solving t.pdfarasanlethers
 
They are molecules that are mirror images of each.pdf
                     They are molecules that are mirror images of each.pdf                     They are molecules that are mirror images of each.pdf
They are molecules that are mirror images of each.pdfarasanlethers
 
Well u put so many type of compounds here.Generally speakingi) t.pdf
Well u put so many type of compounds here.Generally speakingi) t.pdfWell u put so many type of compounds here.Generally speakingi) t.pdf
Well u put so many type of compounds here.Generally speakingi) t.pdfarasanlethers
 
Ventilation is the process of air going in and out of lungs. Increas.pdf
Ventilation is the process of air going in and out of lungs. Increas.pdfVentilation is the process of air going in and out of lungs. Increas.pdf
Ventilation is the process of air going in and out of lungs. Increas.pdfarasanlethers
 
A1) A living being or an individual is known as an organism and it i.pdf
A1) A living being or an individual is known as an organism and it i.pdfA1) A living being or an individual is known as an organism and it i.pdf
A1) A living being or an individual is known as an organism and it i.pdfarasanlethers
 
there are laws and regulations that would pertain to an online breac.pdf
there are laws and regulations that would pertain to an online breac.pdfthere are laws and regulations that would pertain to an online breac.pdf
there are laws and regulations that would pertain to an online breac.pdfarasanlethers
 
The false statement among the given list is “Territoriality means ho.pdf
The false statement among the given list is “Territoriality means ho.pdfThe false statement among the given list is “Territoriality means ho.pdf
The false statement among the given list is “Territoriality means ho.pdfarasanlethers
 
The current article is discussing about the role of SOX4 geneprotei.pdf
The current article is discussing about the role of SOX4 geneprotei.pdfThe current article is discussing about the role of SOX4 geneprotei.pdf
The current article is discussing about the role of SOX4 geneprotei.pdfarasanlethers
 
The major similarities between rocks and minerals are as follows1.pdf
The major similarities between rocks and minerals are as follows1.pdfThe major similarities between rocks and minerals are as follows1.pdf
The major similarities between rocks and minerals are as follows1.pdfarasanlethers
 
Pipelining understandingPipelining is running multiple stages of .pdf
Pipelining understandingPipelining is running multiple stages of .pdfPipelining understandingPipelining is running multiple stages of .pdf
Pipelining understandingPipelining is running multiple stages of .pdfarasanlethers
 
12). Choose the letter designation that represent homozygous recessi.pdf
12). Choose the letter designation that represent homozygous recessi.pdf12). Choose the letter designation that represent homozygous recessi.pdf
12). Choose the letter designation that represent homozygous recessi.pdfarasanlethers
 

More from arasanlethers (20)

#include SDLSDL.hSDL_Surface Background = NULL; SDL_Surface.pdf
#include SDLSDL.hSDL_Surface Background = NULL; SDL_Surface.pdf#include SDLSDL.hSDL_Surface Background = NULL; SDL_Surface.pdf
#include SDLSDL.hSDL_Surface Background = NULL; SDL_Surface.pdf
 
C, D, and E are wrong and involve random constants. Thisnarrows it d.pdf
C, D, and E are wrong and involve random constants. Thisnarrows it d.pdfC, D, and E are wrong and involve random constants. Thisnarrows it d.pdf
C, D, and E are wrong and involve random constants. Thisnarrows it d.pdf
 
AnswerOogenesis is the process by which ovum mother cells or oogo.pdf
AnswerOogenesis is the process by which ovum mother cells or oogo.pdfAnswerOogenesis is the process by which ovum mother cells or oogo.pdf
AnswerOogenesis is the process by which ovum mother cells or oogo.pdf
 
AnswerB) S. typhimuium gains access to the host by crossing the.pdf
AnswerB) S. typhimuium gains access to the host by crossing the.pdfAnswerB) S. typhimuium gains access to the host by crossing the.pdf
AnswerB) S. typhimuium gains access to the host by crossing the.pdf
 
Answer question1,2,4,5Ion–dipole interactionsAffinity of oxygen .pdf
Answer question1,2,4,5Ion–dipole interactionsAffinity of oxygen .pdfAnswer question1,2,4,5Ion–dipole interactionsAffinity of oxygen .pdf
Answer question1,2,4,5Ion–dipole interactionsAffinity of oxygen .pdf
 
A Letter to myself!Hi to myself!Now that I am an Engineer with a.pdf
A Letter to myself!Hi to myself!Now that I am an Engineer with a.pdfA Letter to myself!Hi to myself!Now that I am an Engineer with a.pdf
A Letter to myself!Hi to myself!Now that I am an Engineer with a.pdf
 
Particulars Amount ($) Millons a) Purchase consideratio.pdf
     Particulars  Amount ($) Millons          a) Purchase consideratio.pdf     Particulars  Amount ($) Millons          a) Purchase consideratio.pdf
Particulars Amount ($) Millons a) Purchase consideratio.pdf
 
2 = 14.191,     df = 9,2df = 1.58 ,         P(2 14.191) = .pdf
2 = 14.191,     df = 9,2df = 1.58 ,         P(2  14.191) = .pdf2 = 14.191,     df = 9,2df = 1.58 ,         P(2  14.191) = .pdf
2 = 14.191,     df = 9,2df = 1.58 ,         P(2 14.191) = .pdf
 
while determining the pH the pH of the water is n.pdf
                     while determining the pH the pH of the water is n.pdf                     while determining the pH the pH of the water is n.pdf
while determining the pH the pH of the water is n.pdf
 
Quantum Numbers and Atomic Orbitals By solving t.pdf
                     Quantum Numbers and Atomic Orbitals  By solving t.pdf                     Quantum Numbers and Atomic Orbitals  By solving t.pdf
Quantum Numbers and Atomic Orbitals By solving t.pdf
 
They are molecules that are mirror images of each.pdf
                     They are molecules that are mirror images of each.pdf                     They are molecules that are mirror images of each.pdf
They are molecules that are mirror images of each.pdf
 
Well u put so many type of compounds here.Generally speakingi) t.pdf
Well u put so many type of compounds here.Generally speakingi) t.pdfWell u put so many type of compounds here.Generally speakingi) t.pdf
Well u put so many type of compounds here.Generally speakingi) t.pdf
 
Ventilation is the process of air going in and out of lungs. Increas.pdf
Ventilation is the process of air going in and out of lungs. Increas.pdfVentilation is the process of air going in and out of lungs. Increas.pdf
Ventilation is the process of air going in and out of lungs. Increas.pdf
 
A1) A living being or an individual is known as an organism and it i.pdf
A1) A living being or an individual is known as an organism and it i.pdfA1) A living being or an individual is known as an organism and it i.pdf
A1) A living being or an individual is known as an organism and it i.pdf
 
there are laws and regulations that would pertain to an online breac.pdf
there are laws and regulations that would pertain to an online breac.pdfthere are laws and regulations that would pertain to an online breac.pdf
there are laws and regulations that would pertain to an online breac.pdf
 
The false statement among the given list is “Territoriality means ho.pdf
The false statement among the given list is “Territoriality means ho.pdfThe false statement among the given list is “Territoriality means ho.pdf
The false statement among the given list is “Territoriality means ho.pdf
 
The current article is discussing about the role of SOX4 geneprotei.pdf
The current article is discussing about the role of SOX4 geneprotei.pdfThe current article is discussing about the role of SOX4 geneprotei.pdf
The current article is discussing about the role of SOX4 geneprotei.pdf
 
The major similarities between rocks and minerals are as follows1.pdf
The major similarities between rocks and minerals are as follows1.pdfThe major similarities between rocks and minerals are as follows1.pdf
The major similarities between rocks and minerals are as follows1.pdf
 
Pipelining understandingPipelining is running multiple stages of .pdf
Pipelining understandingPipelining is running multiple stages of .pdfPipelining understandingPipelining is running multiple stages of .pdf
Pipelining understandingPipelining is running multiple stages of .pdf
 
12). Choose the letter designation that represent homozygous recessi.pdf
12). Choose the letter designation that represent homozygous recessi.pdf12). Choose the letter designation that represent homozygous recessi.pdf
12). Choose the letter designation that represent homozygous recessi.pdf
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfstareducators107
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactisticshameyhk98
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 

Recently uploaded (20)

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 

main.cpp #include iostream #include iomanip #include S.pdf

  • 1. main.cpp #include #include #include "SwimmingPool.h" using namespace std; void printMainMenu(); void printPoolVolume(); void printGetPoolDimensions(bool); void printHasDimensions(); void checkDimensions(); void printError(); void printPoolDimensions(); double editValue(double); void printGetFillRate(); void printGetDrainRate(); void printAddWater(); void printDrainRate(); void printFillRate(); char printWantwer(); SwimmingPool pool; int _response; int _numResponses; double _length; double _width; double _depth; //double _currentwerVolume; double _drainRate; double _fillRate; bool _end; char _newValue[5]; int main() { int fillTime;
  • 2. int drainTime; double drained; // Set output style and precision cout << fixed << showpoint << setprecision(2); // Main program loop // ends when _end==true while (!_end) { // Prints main option list printMainMenu(); // Switch based on response switch (_response) { // Sets pool dimensions case 1: if (pool.hasDimensions()) printHasDimensions(); else { printPoolDimensions(); printPoolVolume(); } break; // Prints pool dimensions case 2: printGetPoolDimensions(false); system("pause"); break; // Prints fill rate case 3: printGetFillRate(); break; // Prints drain rate case 4: printGetDrainRate(); break;
  • 3. // Determine water need to fill pool to capacity case 5: checkDimensions(); if (!pool.hasWater()) cout << " The pool is currently empty"; else { cout << " The pool currently has " << pool.getwerVolume() << " units" << endl; } cout << " Water needed: " << pool.getFillAmount(pool.getwerVolume()) << " units of water "; system("pause"); break; // Determine time required to fill pool at rate case 6: if (!pool.hasDimensions()) { cout << " Pool dimensions not yet entered. "; printGetPoolDimensions(false); } if (pool.getFillRate() <= 0) printGetFillRate(); cout << " Time to fill pool: " << pool.getFillTime() << endl << endl; system("pause"); break; // Determine time required to drain pool at rate case 7:
  • 4. checkDimensions(); if (_drainRate <= 0) printGetDrainRate(); if (!pool.hasWater()) { char response = printWantwer(); while (response != 'y' && response != 'n') { printError(); response = printWantwer(); } if (response == 'y') printAddWater(); else break;; } cout << " Time to drain pool: " << pool.getDrainTime() << endl << endl; system("pause"); break; case 8: checkDimensions(); if (pool.getFillRate() <= 0) printGetFillRate(); else printFillRate(); cout << " Enter fill time: "; cin >> fillTime; pool.setFillTime(fillTime); pool.setwerVolume(pool.getwerVolume() + pool.fill()); cout << endl
  • 5. << pool.fill() << " units of water were added to the pool " << " The pool now contains " << pool.getwerVolume() << " units of water "; system("pause"); break; case 9: checkDimensions(); if (pool.getDrainRate() <= 0) printGetDrainRate(); else printDrainRate(); cout << " Enter drain time: "; cin >> drainTime; pool.setDrainTime(drainTime); if (!pool.hasWater()) { char response = printWantwer(); while (response != 'y' && response != 'n') { printError(); response = printWantwer(); cout << " Response is " << response; } if (response == 'y') printAddWater(); else break; } drained = pool.drain(); cout << endl << " " << drained << " units of water were removed from the pool "
  • 6. << " The pool now contains " << pool.getwerVolume() << " units of water "; system("pause"); break; case 10: _end = true; break; default: printError(); break; } } return EXIT_SUCCESS; } void printMainMenu() { _numResponses = 6; cout << " Type the number cooresponding to the task you would like to complete: " << " 1) Set pool dimensions " << " 2) Print pool dimensions " << " 3) Set fill rate " << " 4) Set drain rate " << " Print fill and drain rates " << " Add water to pool " << " Remove water from pool " << " 5) Determine water needed to fill pool to capacity " << " Determine time required to: " << " 6) fill pool " << " 7) drain pool " << " For a specific amount of time: " << " 8) fill pool " << " 9) drain pool " << " 10) Exit Program " << " Choice: "; cin >> _response;
  • 7. } void printPoolVolume() { cout << " Pool volume is " << pool.getVolume() << endl << endl; } void printGetPoolDimensions(bool edit) { cout << " Enter pool dimensions:" << endl << " Length: "; if (edit) editValue(_length); cin >> _length; pool.setLength(_length); cout << " Width: "; if (edit) editValue(_width); cin >> _width; pool.setWidth(_width); cout << " Depth: "; if (edit) editValue(_depth); cin >> _depth; pool.setDepth(_depth); printPoolVolume(); } double editValue(double value) { cout << value; cin.seekg(0, cin.beg); cin.getline(_newValue, 5); return atof(_newValue); }
  • 8. void printHasDimensions() { _numResponses = 2; cout << " The pool already has dimensions" << endl << endl << "1) Create new dimensions" //<< endl //<< "2) Edit current dimensions" << endl << "2) Return to main menu" << endl << "Response: "; cin >> _response; switch (_response) { case 1: printGetPoolDimensions(false); break; //case 2: // // Print pool dimensions prompt with existing values // printGetPoolDimensions(true); // break; case 2: printMainMenu(); break; default: printError(); printHasDimensions(); break; } } // Function that prints an error when invalid option entered at menu void printError() { cout << "a" // make an error sound
  • 9. // print error << " You entered an invalid response, please try again" << endl << endl; } void printPoolDimensions() { cout << " Pool Dimensions " << " Length: " << _length << endl << " Width: " << _width << endl << " Depth: " << _depth << endl << endl; printPoolVolume(); } void checkDimensions() { if (!pool.hasDimensions()) { cout << " Pool dimensions not yet entered. "; printGetPoolDimensions(false); } } void printGetFillRate() { cout << " Enter the fill rate: "; cin >> _fillRate; pool.setFillRate(_fillRate); } void printGetDrainRate() {
  • 10. cout << " Enter the drain rate: "; cin >> _drainRate; pool.setDrainRate(_drainRate); } void printAddWater() { double currentwerVolume; cout << " How much water would you like to add? " << " Response: "; cin >> currentwerVolume; if (currentwerVolume > pool.getVolume()) { currentwerVolume = pool.getVolume(); cout << " You entered more than the pool could hold (" << pool.getVolume() << ") but I fixed that for you. "; } pool.setwerVolume(currentwerVolume); } void printDrainRate() { cout << " Drain rate is currently: " << pool.getDrainRate() << endl << endl; } void printFillRate() { cout << " Fill rate is currently: " << pool.getFillRate() << endl << endl; } char printWantwer() { char response;
  • 11. cout << " The pool has no water to drain! " << " Would you like to add water?" << endl << endl << " Response: "; cin >> response; return response; } SwimmingPool.h #pragma once class SwimmingPool { public: SwimmingPool(); SwimmingPool(double, double, double); SwimmingPool(double, double, double, double, double); void setLength(double); void setWidth(double); void setDepth(double); void setDrainRate(double); double getDrainRate(); void setFillRate(double); double getFillRate(); void setFillTime(int); void setDrainTime(int); void setwerVolume(double); double getVolume(); double getwerVolume(); double getFillAmount(double); int getDrainTime(); int getFillTime(); double drain(); double fill(); double fill(int); bool hasDimensions();
  • 12. bool hasWater(); private: double _length; double _width; double _depth; double _fillRate; double _drainRate; int _fillTime; int _drainTime; double _volume; double _waterVolume; }; SwimmingPool.cpp #include "SwimmingPool.h" using namespace std; // Default constructor SwimmingPool::SwimmingPool() { _length = 0; _width = 0; _depth = 0; } // Basic constructor defined with member initialization SwimmingPool::SwimmingPool (double l, double w, double d) :_length(l), _width(w), _depth(d) { // Assign to the instance variables the arguments passed to constructo _volume = _length * _width * _depth; } // Full Constructor SwimmingPool::SwimmingPool(double length, double width, double depth, double fillRate, double drainRate) { // Assign to the instance variables the arguments passed to constructor
  • 13. _length = length; _width = width; _depth = depth; _fillRate = fillRate; _drainRate = drainRate; _volume = getVolume(); // Get the volume } void SwimmingPool::setLength(double l) { _length = l; } void SwimmingPool::setWidth(double w) { _width = w; } void SwimmingPool::setDepth(double d) { _depth = d; } void SwimmingPool::setDrainRate(double r) { _drainRate = r; } double SwimmingPool::getDrainRate() { return _drainRate; } void SwimmingPool::setFillRate(double r) { _fillRate = r; } double SwimmingPool::getFillRate() { return _fillRate; }
  • 14. void SwimmingPool::setFillTime(int t) { _fillTime = t; } void SwimmingPool::setDrainTime(int t) { _drainTime = t; } // Member function to calculate volume double SwimmingPool::getVolume() { // No need to check values of instance variables // Return the volume return _length * _width * _depth; } void SwimmingPool::setwerVolume(double v) { _waterVolume = v; } double SwimmingPool::getwerVolume() { return _waterVolume; } // Returns amount of water needed to fill an empty or partially filled pool double SwimmingPool::getFillAmount(double currentwerVolume) { return getVolume() - currentwerVolume; } // Returns time needed to completely or partially drain the pool int SwimmingPool::getDrainTime() { return (int)(_waterVolume/_drainRate); } // Returns the time need to completely or partially drain the pool int SwimmingPool::getFillTime() {
  • 15. return (int)(getVolume()/_fillRate); } // Drain the pool for a specified time period // Returns adjusted water volume double SwimmingPool::drain() { double waterDrained = _drainRate * _drainTime; _waterVolume -= waterDrained; if (_waterVolume < 0) _waterVolume = 0; return waterDrained; } double SwimmingPool::fill() { _waterVolume += _fillRate * _fillTime; return _waterVolume; } // Fill the pool for a specified time period // Returns adjusted water volume double SwimmingPool::fill(int time) { return 0; } bool SwimmingPool::hasDimensions() { if (_length > 0 && _width > 0 && _depth > 0) return true; else return false; } bool SwimmingPool::hasWater() { if (_waterVolume > 0) return true; else
  • 16. return false; } Solution main.cpp #include #include #include "SwimmingPool.h" using namespace std; void printMainMenu(); void printPoolVolume(); void printGetPoolDimensions(bool); void printHasDimensions(); void checkDimensions(); void printError(); void printPoolDimensions(); double editValue(double); void printGetFillRate(); void printGetDrainRate(); void printAddWater(); void printDrainRate(); void printFillRate(); char printWantwer(); SwimmingPool pool; int _response; int _numResponses; double _length; double _width; double _depth; //double _currentwerVolume; double _drainRate; double _fillRate; bool _end; char _newValue[5];
  • 17. int main() { int fillTime; int drainTime; double drained; // Set output style and precision cout << fixed << showpoint << setprecision(2); // Main program loop // ends when _end==true while (!_end) { // Prints main option list printMainMenu(); // Switch based on response switch (_response) { // Sets pool dimensions case 1: if (pool.hasDimensions()) printHasDimensions(); else { printPoolDimensions(); printPoolVolume(); } break; // Prints pool dimensions case 2: printGetPoolDimensions(false); system("pause"); break; // Prints fill rate case 3: printGetFillRate(); break;
  • 18. // Prints drain rate case 4: printGetDrainRate(); break; // Determine water need to fill pool to capacity case 5: checkDimensions(); if (!pool.hasWater()) cout << " The pool is currently empty"; else { cout << " The pool currently has " << pool.getwerVolume() << " units" << endl; } cout << " Water needed: " << pool.getFillAmount(pool.getwerVolume()) << " units of water "; system("pause"); break; // Determine time required to fill pool at rate case 6: if (!pool.hasDimensions()) { cout << " Pool dimensions not yet entered. "; printGetPoolDimensions(false); } if (pool.getFillRate() <= 0) printGetFillRate(); cout << " Time to fill pool: " << pool.getFillTime() << endl << endl;
  • 19. system("pause"); break; // Determine time required to drain pool at rate case 7: checkDimensions(); if (_drainRate <= 0) printGetDrainRate(); if (!pool.hasWater()) { char response = printWantwer(); while (response != 'y' && response != 'n') { printError(); response = printWantwer(); } if (response == 'y') printAddWater(); else break;; } cout << " Time to drain pool: " << pool.getDrainTime() << endl << endl; system("pause"); break; case 8: checkDimensions(); if (pool.getFillRate() <= 0) printGetFillRate(); else printFillRate(); cout << " Enter fill time: ";
  • 20. cin >> fillTime; pool.setFillTime(fillTime); pool.setwerVolume(pool.getwerVolume() + pool.fill()); cout << endl << pool.fill() << " units of water were added to the pool " << " The pool now contains " << pool.getwerVolume() << " units of water "; system("pause"); break; case 9: checkDimensions(); if (pool.getDrainRate() <= 0) printGetDrainRate(); else printDrainRate(); cout << " Enter drain time: "; cin >> drainTime; pool.setDrainTime(drainTime); if (!pool.hasWater()) { char response = printWantwer(); while (response != 'y' && response != 'n') { printError(); response = printWantwer(); cout << " Response is " << response; } if (response == 'y') printAddWater(); else break; } drained = pool.drain();
  • 21. cout << endl << " " << drained << " units of water were removed from the pool " << " The pool now contains " << pool.getwerVolume() << " units of water "; system("pause"); break; case 10: _end = true; break; default: printError(); break; } } return EXIT_SUCCESS; } void printMainMenu() { _numResponses = 6; cout << " Type the number cooresponding to the task you would like to complete: " << " 1) Set pool dimensions " << " 2) Print pool dimensions " << " 3) Set fill rate " << " 4) Set drain rate " << " Print fill and drain rates " << " Add water to pool " << " Remove water from pool " << " 5) Determine water needed to fill pool to capacity " << " Determine time required to: " << " 6) fill pool " << " 7) drain pool " << " For a specific amount of time: " << " 8) fill pool "
  • 22. << " 9) drain pool " << " 10) Exit Program " << " Choice: "; cin >> _response; } void printPoolVolume() { cout << " Pool volume is " << pool.getVolume() << endl << endl; } void printGetPoolDimensions(bool edit) { cout << " Enter pool dimensions:" << endl << " Length: "; if (edit) editValue(_length); cin >> _length; pool.setLength(_length); cout << " Width: "; if (edit) editValue(_width); cin >> _width; pool.setWidth(_width); cout << " Depth: "; if (edit) editValue(_depth); cin >> _depth; pool.setDepth(_depth); printPoolVolume(); } double editValue(double value) { cout << value;
  • 23. cin.seekg(0, cin.beg); cin.getline(_newValue, 5); return atof(_newValue); } void printHasDimensions() { _numResponses = 2; cout << " The pool already has dimensions" << endl << endl << "1) Create new dimensions" //<< endl //<< "2) Edit current dimensions" << endl << "2) Return to main menu" << endl << "Response: "; cin >> _response; switch (_response) { case 1: printGetPoolDimensions(false); break; //case 2: // // Print pool dimensions prompt with existing values // printGetPoolDimensions(true); // break; case 2: printMainMenu(); break; default: printError(); printHasDimensions(); break; } }
  • 24. // Function that prints an error when invalid option entered at menu void printError() { cout << "a" // make an error sound // print error << " You entered an invalid response, please try again" << endl << endl; } void printPoolDimensions() { cout << " Pool Dimensions " << " Length: " << _length << endl << " Width: " << _width << endl << " Depth: " << _depth << endl << endl; printPoolVolume(); } void checkDimensions() { if (!pool.hasDimensions()) { cout << " Pool dimensions not yet entered. "; printGetPoolDimensions(false); } } void printGetFillRate() { cout << " Enter the fill rate: "; cin >> _fillRate;
  • 25. pool.setFillRate(_fillRate); } void printGetDrainRate() { cout << " Enter the drain rate: "; cin >> _drainRate; pool.setDrainRate(_drainRate); } void printAddWater() { double currentwerVolume; cout << " How much water would you like to add? " << " Response: "; cin >> currentwerVolume; if (currentwerVolume > pool.getVolume()) { currentwerVolume = pool.getVolume(); cout << " You entered more than the pool could hold (" << pool.getVolume() << ") but I fixed that for you. "; } pool.setwerVolume(currentwerVolume); } void printDrainRate() { cout << " Drain rate is currently: " << pool.getDrainRate() << endl << endl; } void printFillRate() { cout << " Fill rate is currently: " << pool.getFillRate() << endl << endl;
  • 26. } char printWantwer() { char response; cout << " The pool has no water to drain! " << " Would you like to add water?" << endl << endl << " Response: "; cin >> response; return response; } SwimmingPool.h #pragma once class SwimmingPool { public: SwimmingPool(); SwimmingPool(double, double, double); SwimmingPool(double, double, double, double, double); void setLength(double); void setWidth(double); void setDepth(double); void setDrainRate(double); double getDrainRate(); void setFillRate(double); double getFillRate(); void setFillTime(int); void setDrainTime(int); void setwerVolume(double); double getVolume(); double getwerVolume(); double getFillAmount(double); int getDrainTime(); int getFillTime();
  • 27. double drain(); double fill(); double fill(int); bool hasDimensions(); bool hasWater(); private: double _length; double _width; double _depth; double _fillRate; double _drainRate; int _fillTime; int _drainTime; double _volume; double _waterVolume; }; SwimmingPool.cpp #include "SwimmingPool.h" using namespace std; // Default constructor SwimmingPool::SwimmingPool() { _length = 0; _width = 0; _depth = 0; } // Basic constructor defined with member initialization SwimmingPool::SwimmingPool (double l, double w, double d) :_length(l), _width(w), _depth(d) { // Assign to the instance variables the arguments passed to constructo _volume = _length * _width * _depth; } // Full Constructor
  • 28. SwimmingPool::SwimmingPool(double length, double width, double depth, double fillRate, double drainRate) { // Assign to the instance variables the arguments passed to constructor _length = length; _width = width; _depth = depth; _fillRate = fillRate; _drainRate = drainRate; _volume = getVolume(); // Get the volume } void SwimmingPool::setLength(double l) { _length = l; } void SwimmingPool::setWidth(double w) { _width = w; } void SwimmingPool::setDepth(double d) { _depth = d; } void SwimmingPool::setDrainRate(double r) { _drainRate = r; } double SwimmingPool::getDrainRate() { return _drainRate; } void SwimmingPool::setFillRate(double r) { _fillRate = r; }
  • 29. double SwimmingPool::getFillRate() { return _fillRate; } void SwimmingPool::setFillTime(int t) { _fillTime = t; } void SwimmingPool::setDrainTime(int t) { _drainTime = t; } // Member function to calculate volume double SwimmingPool::getVolume() { // No need to check values of instance variables // Return the volume return _length * _width * _depth; } void SwimmingPool::setwerVolume(double v) { _waterVolume = v; } double SwimmingPool::getwerVolume() { return _waterVolume; } // Returns amount of water needed to fill an empty or partially filled pool double SwimmingPool::getFillAmount(double currentwerVolume) { return getVolume() - currentwerVolume; } // Returns time needed to completely or partially drain the pool int SwimmingPool::getDrainTime() { return (int)(_waterVolume/_drainRate);
  • 30. } // Returns the time need to completely or partially drain the pool int SwimmingPool::getFillTime() { return (int)(getVolume()/_fillRate); } // Drain the pool for a specified time period // Returns adjusted water volume double SwimmingPool::drain() { double waterDrained = _drainRate * _drainTime; _waterVolume -= waterDrained; if (_waterVolume < 0) _waterVolume = 0; return waterDrained; } double SwimmingPool::fill() { _waterVolume += _fillRate * _fillTime; return _waterVolume; } // Fill the pool for a specified time period // Returns adjusted water volume double SwimmingPool::fill(int time) { return 0; } bool SwimmingPool::hasDimensions() { if (_length > 0 && _width > 0 && _depth > 0) return true; else return false; } bool SwimmingPool::hasWater()
  • 31. { if (_waterVolume > 0) return true; else return false; }