Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
PROGRAMAO II
Apresentao da Classe iPad
Aluno: Edson Alessandro F. Costa
Atributos
bool isTurnedOn;
float storageCapacity; // Measured in GB
void getInformation();
void turnOff();
bool closeAllApps();
bool uninstallAllApps();
bool unlockScreen();
bool lockScreen();
void turnWiFiOnOff();
void showAppsInstalled();
void turnMobileDataOnOff();
void showActiveApps();
Funes Auxiliares
Construtores
bool isOn();
IPad();
IPad(int storage);
bool isIPadEmpty();
void setSpecsToDefault();
void installDefaultApps();
bool validateValue(float, float, float, const string &);
bool setLockScreenPassword();
bool isScreenUnlocked();
CONSTRUTORES
IPad::IPad()
{
installDefaultApps();
setLockScreenPassword();
}
IPad::IPad(int storage)
{
cout << ".:. iPad Creation .:.\n";
setSpecsToDefault();
storageCapacity = validateValue(storage, 16, 128, "storage capacity");
installDefaultApps();
setLockScreenPassword();
}
CONSTRUTOR VAZIO
IPad::IPad()
{
installDefaultApps();
setLockScreenPassword();
void IPad::setSpecsToDefault()
{
isTurnedOn = true;
storageCapacity = 32;
freeMemory = storageCapacity;
screenLocked = false;
wiFiOn = true;
mobileDataOn = false;
}
CONSTRUTOR VAZIO
IPad::IPad()
{
installDefaultApps();
setLockScreenPassword();
IPad::void installDefaultApps()
{
appsInstalled["Google"] = 200;
freeMemory -= 200/1000.0;
appsInstalled["Safari"] = 100;
freeMemory -= 100/1000.0;
appsInstalled["YouTube"] = 50;
freeMemory -= 50/1000.0;
}
CONSTRUTOR VAZIO
IPad::IPad()
setLockScreenPassword();
void IPad::setLockScreenPassword()
{
string password;
while (true)
{
cout << "\n>> Set initial password to lock screen (4-32 chars): ";
getline(cin, password);
if ((password.length() >= 4) && (password.length() <= 32))
{
lockScreenPassword = password;
cout << "\n|| Lock screen password set successfully ||\n";
break;
}
cout << "\n# Password must be 4 to 32 chars. Try again. #\n";
}
}
cout << "\n|| The app " << name << " was successfully uninstalled. ||\n";
return true;
} else {
cout << "\n# The app " << name << " isn't installed. #\n";
return false;
}
}
return true;
} else
{
cout << "\n\n|| There are no apps in the iPad. ||\n\n";
return false;
}
}
MAIN
Funcionamento do Programa Principal
.: iPad Control Center :.
1 => Show Open Apps
16 => Turn On
18 => Quit
MAIN
Funcionamento do Programa Principal
MAIN
Funcionamento do Programa Principal
MAIN
Funcionamento do Programa Principal
MAIN
Funcionamento do Programa Principal
MAIN
Funcionamento do Programa Principal
MAIN
Funcionamento do Programa Principal
MAIN
Funcionamento do Programa Principal
MAIN
Funcionamento do Programa Principal