Mostrando entradas con la etiqueta desarrollo. Mostrar todas las entradas
Mostrando entradas con la etiqueta desarrollo. Mostrar todas las entradas

miércoles, 10 de julio de 2013

[Ejercicio resuelto c++ POO, Arreglos de objetos] Estudiantes aprobados y reprobados. – Abogado – Teleconferencias

Enunciado:
"Realizar un programa en el que se tenga como entrada: nombre, edad y 3 notas del estudiante con un menú en el que se pueda:
1 - Ingresar los datos de los estudiantes.
2 - Buscar datos del estudiante mediante su nombre.
3 - Informe de datos de los estudiantes ordenado por su nota de menor a mayor y mostrando si ha aprobado o reprobado.
4- Cantidad de estudiantes aprobados, reprobados y promedio de notas de la seccion.
Además guardar el informe y la cantidad de estudiantes aprobados y reprobados junto al promedio de notas en un archivo txt."

Clases:

Estudiante.h

#ifndef ESTUDIANTE_H_
#define ESTUDIANTE_H_

#include iostream
#include string.h
using namespace std;

class Estudiante {
private:
string nombre;
int edad;
float nota1;
float nota2;
float nota3;
public:
Estudiante();
void setnombre(string nom);
string getnombre();
void setedad(int eda);
int getedad();
float getNota1();
void setNota1(float not1);
float getNota2();
void setNota2(float not2);
float getNota3();
void setNota3(float not3);
float Calnotaf();
string CalApRp();
};

#endif /* ESTUDIANTE_H_ */



Estudiante.cpp

#include "Estudiante.h"

Estudiante::Estudiante() {
// TODO Auto-generated constructor stub
nombre = "";
edad = 0;
nota1 = 0;
nota2 = 0;
nota3 = 0;
}

void Estudiante::setnombre(string nom){
nombre = nom;
}

string Estudiante::getnombre(){
return nombre;
}

void Estudiante::setedad(int eda){
edad = eda;
}

int Estudiante::getedad(){
return edad;
}

float Estudiante::getNota1() {
return nota1;
}

void Estudiante::setNota1(float not1) {
nota1 = not1;
}

float Estudiante::getNota2() {
return nota2;
}

void Estudiante::setNota2(float not2) {
nota2 = not2;
}

float Estudiante::getNota3() {
return nota3;
}

void Estudiante::setNota3(float not3) {
nota3 = not3;
}

float Estudiante::Calnotaf() {
float notaf;
notaf = ((nota1 + nota2 + nota3) * 20) /100;
return notaf;
}

string Estudiante::CalApRp() {
string ApRp;
if(Calnotaf() = 10 && Calnotaf()= 20)
ApRp = "Aprobado";
else
if(Calnotaf() = 0 && Calnotaf() 10)
ApRp = "Reprobado";
else
ApRp = "Error al verificar nota";
return ApRp;
}

Seccion.h

#ifndef SECCION_H_
#define SECCION_H_

#include "Estudiante.h"

const int MAX=3;

class Seccion {
private:
int ptr;
Estudiante AEstudiante[MAX];
public:
Seccion();
int getptr();
void setAEstudiante(Estudiante elEstudiante);
Estudiante getAEstudiante(int i);
void OrdenarEstudiante();
int Buscar(string nombreB);
int Calcantap();
int Calcantrep();
float Calpromnot();
};

#endif /* SECCION_H_ */

Seccion.cpp

/*
* Seccion.cpp
*
* Created on: 23/02/2013
* Author: Francisco Velásquez
*/

#include "Seccion.h"

Seccion::Seccion() {
// TODO Auto-generated constructor stub
ptr = 0;
}

int Seccion::getptr(){
return ptr;
}

void Seccion::setAEstudiante(Estudiante elEstudiante){
AEstudiante[ptr] = elEstudiante;
ptr++;
}

Estudiante Seccion::getAEstudiante(int i){
return AEstudiante[i];
}

void Seccion::OrdenarEstudiante(){
Estudiante Aux;
int i, j;
for(i=0; iptr-1; i++){
for (j=i+1; jptr; j++){
if(AEstudiante[i].Calnotaf() AEstudiante[j].Calnotaf())
{
Aux = AEstudiante[i];
AEstudiante[i] = AEstudiante[j];
AEstudiante[j] = Aux;
}
}
}
}

int Seccion::Buscar(string nombreB) {
int i=0, enc = -1;
while(iptr && enc == -1){
if(AEstudiante[i].getnombre() == nombreB)
enc = i;
else i++;
}
return enc;
}

int Seccion::Calcantap() {
int cantap;
int contap=0;
for(int i=0; i ptr; i++){
if(AEstudiante[i].CalApRp() == "Aprobado")
contap++;
}
cantap = contap;
return cantap;
}

int Seccion::Calcantrep() {
int cantrep;
int contrep = 0;
for(int i=0; i ptr; i++){
if(AEstudiante[i].CalApRp() == "Reprobado")
contrep++;
}
cantrep = contrep;
return cantrep;
}

float Seccion::Calpromnot() {
float promnot;
float acum=0;
for(int i = 0; iptr;i++){
acum = acum + AEstudiante[i].Calnotaf();
}
promnot = acum/ptr;
return promnot;
}

Función principal

Principal.cpp

#include "Estudiante.h"
#include "Seccion.h"
#include stdlib.h
#include stdio.h
#include fstream

void IESeccion(Seccion & laSeccion);
void IS(Seccion laSeccion);
void IBuscar(Seccion laSeccion);
void Menu(Seccion laSeccion);
void Msjsalida(Seccion laSeccion);
void EstApRepProm(Seccion laSeccion);

int main(){
Seccion laSeccion;
Menu(laSeccion);
Msjsalida(laSeccion);
return 0;
}

void EstApRepProm(Seccion laSeccion){
cout "La cantidad de estudiantes aprobados es de: " laSeccion.Calcantap() endl;
cout "La cantidad de estudiantes reprobados es de: " laSeccion.Calcantrep() endl;
cout "El promedio de notas es de " laSeccion.Calpromnot() " ptos" endl;
ofstream archivo; // objeto de la clase ofstream
archivo.open("ARP.txt");

archivo "La cantidad de estudiantes aprobados es de: " laSeccion.Calcantap() endl;
archivo "La cantidad de estudiantes reprobados es de: " laSeccion.Calcantrep() endl;
archivo "El promedio de notas es de " laSeccion.Calpromnot() " ptos" endl;

archivo.close();

system("pausenull");
}

void Msjsalida(Seccion laSeccion){
cout endl;
cout endl;
cout endl;
cout endl;
cout endl;
cout endl;
cout endl;
cout endl;
cout endl;
cout endl;
cout " GRACIAS POR USAR FRANCVES SYSTEM" endl;
cout " @francves" endl;
}

void Menu(Seccion laSeccion){
system("cls");
int variable;
cout endl;
cout "BIENVENIDO AL MENU DE USUARIO, PORFAVOR INGRESE UNA DE LAS SIGUIENTES OPCIONES" endl;
cout "______________________________________________________________________________" endl;
cout "1 Ingresar datos (si ya ha ingresado datos anteriormente elija otra opcion)" endl;
cout "2 Buscar datos de estudiante a travez de su nombre" endl;
cout "3 Informe de estudiantes ordenados por su nota de menor a mayor" endl;
cout "4 Cantidad de estudiantes aprobados, reprobados y promedio de notas de la seccion" endl;
cout "0 SALIR" endl;
cin variable;
switch(variable){
case 1:
system("cls");
IESeccion(laSeccion);
Menu(laSeccion);
break;
case 2:
system("cls");
IBuscar(laSeccion);
Menu(laSeccion);
break;
case 3:
system("cls");
IS(laSeccion);
Menu(laSeccion);
break;
case 4:
system("cls");
EstApRepProm(laSeccion);
Menu(laSeccion);
break;
case 0:
system("cls");
Msjsalida(laSeccion);
break;
default:
cout endl;
cout "Porfavor solo ingrese opcion 1 - 2 - 3 - 4 - 0" endl;
break;
}
system("pausenull");
}

void IEEstudiante(Estudiante & elEstudiante){
string nom;
int eda;
float not1, not2, not3;
cout "Ingrese el Nombre del estudiante" endl;
cin nom;
elEstudiante.setnombre(nom);
cout "Ingrese la edad del estudiante" endl;
cin eda;
elEstudiante.setedad(eda);
cout "Ingrese las 3 notas del estudiante una por una" endl;
cin not1;
elEstudiante.setNota1(not1);
cin not2;
elEstudiante.setNota2(not2);
cin not3;
elEstudiante.setNota3(not3);
}

void IESeccion(Seccion & laSeccion){
Estudiante elEstudiante;
for(int i=0; i MAX; i++){
IEEstudiante(elEstudiante);
laSeccion.setAEstudiante(elEstudiante);
laSeccion.OrdenarEstudiante();
}
cout endl;
cout "Se han ingresado todos los datos correctamente " endl;
cout "Presione cualquier tecla para ser redirigido al menu nuevamente" endl;
system("pausenull");
}

void IS(Seccion laSeccion){
int i;
cout " INFORME ESTUDIANTES DE LA SECCION " endl;
cout "__________________________________________________________________________" endl;
cout "Nombre Edad Nota Aprobado/Reprobado" endl;
for(i=0;iMAX;i++){
cout laSeccion.getAEstudiante(i).getnombre() " " laSeccion.getAEstudiante(i).getedad() " " laSeccion.getAEstudiante(i).Calnotaf() " " laSeccion.getAEstudiante(i).CalApRp() endl;
}
cout endl;
cout "Presione cualquiere tecla para regresar al menu" endl;

ofstream archivo;

archivo.open("reporte.txt");

archivo " INFORME ESTUDIANTES DE LA SECCION " endl;
archivo "__________________________________________________________________________" endl;
archivo "Nombre Edad Nota Aprobado/Reprobado" endl;
for(i=0;iMAX;i++){
archivo laSeccion.getAEstudiante(i).getnombre() " " laSeccion.getAEstudiante(i).getedad() " " laSeccion.getAEstudiante(i).Calnotaf() " " laSeccion.getAEstudiante(i).CalApRp() endl;
}
archivo endl;
archivo "Presione cualquiere tecla para regresar al menu" endl;

system("pausenull");
}

void IBuscar(Seccion laSeccion){
Seccion OSeccion;
Estudiante OEstudiante;
string nombreB;
int posi;
cout "Ingrese el nombre a buscar: " endl;
cin nombreB;
posi = laSeccion.Buscar(nombreB);
if(posi != -1){
cout "El nombre existe en la posicion: " posi endl;
cout "La edad es: " laSeccion.getAEstudiante(posi).getedad() endl;
cout "La nota es: " laSeccion.getAEstudiante(posi).Calnotaf() endl;
cout "El estudiante ha " laSeccion.getAEstudiante(posi).CalApRp() " la materia" endl;
}
else{
cout "No existen datos del estudiante " nombreB endl;}
cout endl;
cout "Presione cualquiere tecla para regresar al menu" endl;
system("pausenull");
}

california law lemon New social media platforms Live casino lease management software Hire php developer DONATE YOUR CAR SACRAMENTO personal injury lawyer sarasota fl structured settlement annuity companies peritoneal mesothelioma anti spam appliance Seo companies Mobile casino Casino reviews Dayton Freight Lines auto accident attorney google adsense Criminal lawyer Online casino mesothelioma attorneys Home Phone Internet Bundle Computer science classes online Best social media platforms for business CHEAP AUTO INSURANCE IN VA accident lawyers in los angeles auto insurance yuba city ca ONLINE MOTOR INSURANCE QUOTES mesothelioma litigation Casino Mortgage Adviser Psychic for free NEUSON Criminal defense lawyer Health Records Personal Health Record Tech school Make money online Australia Bankruptcy lawyer dallas mesothelioma lawyer DONATE YOUR CAR FOR MONEY DUI lawyer DONATE A CAR IN MARYLAND Hire php developers mesothelioma suit MOTOR REPLACEMENTS Hire php programmers Better conferencing calls Car Insurance Quotes ANNUITY SETTLEMENT Italian cooking school buy structured settlements Virtual Data Rooms How to Donate A Car in California Business finance group Dwi lawyer Service business software Learning adobe illustrator personal injury law firm Online College Course Mortgage Donating a car in Maryland Php programmers for hire FORENSICS ONLINE COURSE Car Insurance Quotes PA motor replacements mesothelioma settlements personal injury accident lawyer Social media campaigns forensics online course Car insurance quotes Utah mesothelioma information Holland Michigan College Best Seo company Php programmers Online Christmas cards structured settlement broker Better Conference Calls World Trade Center Footage DONATING USED CARS TO CHARITY car insurance quotes WordPress theme designers Car Accident Lawyers Social media platforms Online Stock Trading Seo services AUTOMOBILE ACCIDENT ATTORNEY webex costs Best social media platforms Social media platforms for business Custom WordPress theme designer structured settlement brokers DONATING A CAR IN MARYLAND Social media examiner virtual data rooms donate your car for money refinance with poor credit Motor replacements Business management software attorney lawyer mesothelioma Data Recovery Raid Seo company Html email houston motorcycle accident lawyer Auto Accident Attorney holland michigan college Car Insurance Companies Adobe illustrator classes Structures Annuity Settlement Asbestos Lung Cancer mesothelioma charities Donate your car Sacramento online colledges Custom Christmas cards Photo Christmas cards PHD on Counseling Education WordPress themes for designers Motor Replacements Donate Cars Illinois WordPress hosting Psd to WordPress Dallas Mesothelioma Attorneys Car Insurance in South Dakota dallas mesothelioma attorneys Neuson Social media management mesothelioma lawyer virginia DONATE OLD CARS TO CHARITY colorado mesothelioma lawyers business voip solutions cheap car insurance in virginia mesothelioma attorneys california DAYTON FREIGHT LINES criminal defense attorneys florida Christmas cards Proud Italian cook Psd to html mesothelioma lawyer asbestos cancer lawsuit selling structured settlement Donate Car to Charity California semi truck accident lawyers donate old cars to charity domain yahoo buyers of structured settlements HOLLAND MICHIGAN COLLEGE PSYCHIC FOR FREE Cheap Car Insurance for Ladies MESOTHELIOMA LAW FIRM structured settlement investments asbestos mesothelioma lawsuit Social media strategies Annuity Settlements Social media tools Futuristic Architecture Mesothelioma Law Firm DONATE CARS ILLINOIS Royalty free images stock Car Insurance Quotes Utah personal injury solicitor sell your structured settlement payments Insurance Companies EMAIL BULK SERVICE Donate Old Cars to Charity Best Criminal Lawyers in Arizona Donate Car for Tax Credit REGISTER FREE DOMAINS Donate Cars in MA Donate Your Car Sacramento st louis mesothelioma attorney Sell Annuity Payment new york mesothelioma law firm average mesothelioma settlement mesothelioma lawyer dallas supportpeachtreecom mesothelioma Donate Your Car for Kids MASSAGE SCHOOL DALLAS TEXAS tennessee mesothelioma lawyer mesothelioma help fortis health insurance temporary Asbestos Lawyers hosted predictive dialers bus accident attorneys Car Insurance Quotes Colorado better conferencing calls CAR ACCIDENT LAWYERS best accident attorneys Nunavut Culture Hard drive Data Recovery Services Donate a Car in Maryland PAPERPORT PROMOTIONAL CODE CAR INSURANCE QUOTES UTAH Webex Costs Cheap Auto Insurance in VA domain name yahoo Cheap Domain Registration Hosting Donating a Car in Maryland Insurance Personal Injury Lawyers cheaper insurance companies Criminal Defense Attorneys Florida Online Colleges Massage School Dallas Texas Low credit line credit cards Life Insurance Co Lincoln Auto Mobile Insurance Quote Online Motor Insurance Quotes annuity payment Dedicated Hosting Dedicated Server Hosting Paperport Promotional Code Online Classes mesothelioma law suit paperport promotional code state of california car insurance Psychic for Free criminal defense federal lawyer Low Credit Line Credit Cards Car Insurance Quotes MN Donate your Car for Money Met Auto Donate a car in Maryland Claim Forensics Online Course Donating Used Cars to Charity asbestos lawyers miami personal injury lawyer mesothelioma lawyer houston Home phone internet bundle cash out annuity Royalty Free Images Stock Email Bulk Service Online classes firm law mesothelioma Cheap Car Insurance in Virginia Register Free Domains structured settlement buyer buying structured settlements Car Donate sell structured settlement calculator what is structured settlement Automobile Accident Attorney insurance medical temporary accident attorneys orange county truck accident attorney los angeles home phone internet bundle miami personal injury attorney Criminal lawyer Miami mesothelioma attorney illinois Motor Insurance Quotes mesothelioma ct mesothelioma lawyer texas mesothelioma cases Injury Lawyers

lunes, 1 de julio de 2013

[Ejercicio resuelto c++ POO] Dinero en billetera. – Service – Abogado – Auto

Enunciado:
"Sabiendo cuantos billetes de 5000, 10000, 20000 y 50000 tiene una persona en su billetera, calcular la cantidad total de dinero con que cuenta."

Clases:

Billetera.h


#ifndef BILLETERA_H_
#define BILLETERA_H_

#include iostream

using namespace std;

class Billetera {
private:
int billete1;
int billete2;
int billete3;
int billete4;
int cantbi1;
int cantbi2;
int cantbi3;
int cantbi4;
public:
Billetera();
void setcantbi1(int bi1);
int getcantbi1();
void setcantbi2(int bi2);
int getcantbi2();
void setcantbi3(int bi3);
int getcantbi3();
void setcantbi4(int bi4);
int getcantbi4();
float CaldinTot();
};

#endif /* BILLETERA_H_ */



Billetera.cpp


/*
* Persona.cpp
*
* Created on: 14/12/2012
* Author: Soneview
*/

#include "Billetera.h"

Billetera::Billetera() {
// TODO Auto-generated constructor stub
billete1 = 5000;
billete2 = 10000;
billete3 = 20000;
billete4 = 50000;
cantbi1 = 0;
cantbi2 = 0;
cantbi3 = 0;
cantbi4 = 0;
}

void Billetera::setcantbi1(int bi1) {
cantbi1 = bi1;
}

int Billetera::getcantbi1() {
return cantbi1;
}

void Billetera::setcantbi2(int bi2) {
cantbi2 = bi2;
}

int Billetera::getcantbi2() {
return cantbi2;
}

void Billetera::setcantbi3(int bi3) {
cantbi3 = bi3;
}

int Billetera::getcantbi3() {
return cantbi3;
}

void Billetera::setcantbi4(int bi4) {
cantbi4 = bi4;
}

int Billetera::getcantbi4() {
return cantbi4;
}

float Billetera::CaldinTot() {
float dinTot;
dinTot = (cantbi1 * billete1) + (cantbi2 * billete2) + (cantbi3 * billete3) + (cantbi4 * billete4);
return dinTot;
}

Función principal:

#include "Billetera.h"

void IEBilletera(Billetera &laBilletera);
void IS(Billetera laBilletera);

int main()
{
Billetera laBilletera;
IEBilletera(laBilletera);
IS(laBilletera);
return 0;
}

void IEBilletera(Billetera &laBilletera)
{
int bi1;
int bi2;
int bi3;
int bi4;
cout "Ingrese la cantidad de billetes de 5000bsF: ";
cin (bi1);
laBilletera.setcantbi1(bi1);
cout "Ingrese la cantidad de billetes de 10000bsF: ";
cin (bi2);
laBilletera.setcantbi2(bi2);
cout "Ingrese la cantidad de billetes de 20000bsF: ";
cin (bi3);
laBilletera.setcantbi3(bi3);
cout "Ingrese la cantidad de billetes de 50000bsF: ";
cin (bi4);
laBilletera.setcantbi4(bi4);
}

void IS(Billetera laBilletera)
{
cout "El dinero total en la billetera de la persona es: " laBilletera.CaldinTot();
}

Donate Your Car for Kids mesothelioma attorney florida Tech school annuity payment Seo services online motor insurance quotes Hire php developers Online casino Social media management personal injury attorney ocala fl selling annuity VIRTUAL DATA ROOMS Christmas cards Seo companies injury lawyers west palm beach selling a structured settlement structured settlement blog Dwi lawyer dallas mesothelioma lawyer personal injury accident lawyer auto insurance yuba city ca Php programmers for hire Business finance group Social media campaigns best criminal lawyer in arizona Donate Car to Charity California FORENSICS ONLINE COURSE domain name yahoo Custom Christmas cards Mobile casino truck accident attorney los angeles Donate Cars in MA car insurance quotes Service business software world trade center footage verizon sip injury lawyers Annuity Settlements houston mesothelioma attorney Best social media platforms Webex Costs primary pulmonary hypertension los angeles auto accident attorneys Casino Photo Christmas cards truck accident attorney texas Cheap Car Insurance for Ladies mesothelioma law suit online criminal justice degree Make money online Australia ONLINE MOTOR INSURANCE QUOTES Claim Casino reviews Live casino DUI lawyer Auto Accident Attorney Bankruptcy lawyer criminal defense federal lawyer Auto Mobile Insurance Quote mesothelioma help futuristic architecture canada personals yahoo bus accident attorneys Html email PAPERPORT PROMOTIONAL CODE Business Voip Solutions Hire php programmers DONATING USED CARS TO CHARITY Criminal lawyer Custom WordPress theme designer Royalty Free Images Stock car accident lawyers Criminal defense lawyer Hire php developer Italian cooking school CHEAP CAR INSURANCE FOR LADIES Holland Michigan College Mortgage adviser DONATE CAR FOR TAX CREDIT DONATE A CAR IN MARYLAND mesothelioma claim Computer science classes online Donate car for tax credit Online Criminal Justice Degree buy structured settlements asbestos mesothelioma lawsuit Hard drive data recovery services mesothelioma attorneys Php programmers Low Credit Line Credit Cards royalty free images stock structured settlement brokers CRIMINAL DEFENSE ATTORNEYS FLORIDA Life Insurance Co Lincoln structured settlements annuities Car Insurance Quotes PA mesotheloma CAR INSURANCE QUOTES UTAH data recovery raid st louis mesothelioma attorney Best social media platforms for business WORLD TRADE CENTER FOOTAGE New social media platforms Social media platforms for business saskatchewan auto insurance motorcycle lawyer los angeles Dayton Freight Lines Online classes refinance with bad credit Nunavut culture Best Seo company Car Donate DONATE CARS IN MA mesothelioma drug AUTO ACCIDENT ATTORNEY injury lawyer houston tx Business management software average mesothelioma settlement NEUSON Seo company Online Christmas cards Psd to html Online Colleges DALLAS MESOTHELIOMA ATTORNEYS WordPress themes for designers FUTURISTIC ARCHITECTURE WordPress hosting Psd to WordPress World Trade Center Footage cash out annuity REGISTER FREE DOMAINS Donate Car To Charity CALIFORNIA Social media examiner Futuristic architecture seattle mesothelioma lawyer Learning adobe illustrator maritime lawyer houston Donate your car for kids DONATE YOUR CAR FOR MONEY Social media platforms Structures Annuity Settlement Cheap Car Insurance in Virginia asbestos lawyers Proud Italian cook NUNAVUT CULTURE DONATING A CAR IN MARYLAND california mesothelioma attorney WordPress theme designers ASBESTOS LAWYERS Donate your car Sacramento accident attorney san bernardino Adobe illustrator classes Social media strategies Social media tools register free domains DONATE OLD CARS TO CHARITY Mesothelioma Law Firm Donate Car for Tax Credit Donate Your Car Sacramento cheap domain registration hosting MORTGAGE ADVISER mesothelioma litigation hair removal washington dc How to Donate A Car in California Sell Annuity Payment mesothelioma survival rates Asbestos Lawyers Best Criminal Lawyers in Arizona Nunavut Culture Car Insurance in South Dakota Car Insurance Quotes Colorado domain yahoo Donating a Car in Maryland Hard drive Data Recovery Services Cheap Auto Insurance in VA Donate a Car in Maryland Gas/Electricity Motor Replacements refinance with poor credit Donate Cars Illinois Cheap Domain Registration Hosting sell annuity payment mesothelioma Best criminal lawyer in Arizona mesotheioma Home Phone Internet Bundle Dallas Mesothelioma Attorneys Criminal Defense Attorneys Florida personal injury solicitor mesothelioma attorney illinois Car Accident Lawyers sell structured settlement calculator Car Insurance Quotes Utah Personal Injury Lawyers Paperport Promotional Code quotes car Online Motor Insurance Quotes PHD on Counseling Education accident lawyers in los angeles Online Classes Massage School Dallas Texas Met Auto city college in miami home phone internet bundle adverse remortgage Home phone internet bundle Motor Insurance Quotes Psychic for Free Donate Old Cars to Charity what is structured settlement Better conferencing calls Register Free Domains structured settlement agreement Massage school Dallas Texas Car Insurance Quotes MN Donate your Car for Money structured settlement need cash now Online colledges Life insurance co Lincoln Dedicated Hosting Dedicated Server Hosting Forensics Online Course Donating Used Cars to Charity virtual data rooms Personal Injury Law Firm webex costs Neuson Mortgage Adviser mesothelioma lawyer houston ROYALTY FREE IMAGES STOCK Email Bulk Service tucson car accident attorney new york mesothelioma law firm earthlink business internet motorcycle accident attorney sacramento Car Insurance Quotes Dallas mesothelioma attorneys mesotheolima Better Conference Calls state of california car insurance Futuristic Architecture mesothelioma attorney directory EMAIL BULK SERVICE donate your car for money Donating a car in Maryland mesothelioma information Cheap car insurance in Virginia Virtual Data Rooms structured annuity settlement Online College Course Automobile Accident Attorney

[Ejercicio resuelto c++ POO] Comisión empleado. – Donate – Seguro – Hosting

Enunciado:
"Si un empleado gana un sueldo básico y además se le asigna una comisión del 25% sobre las ventas que realizó, conociendo su sueldo y lo vendido, determinar cuánto cobrará el empleado."

Clases:

Empleado.h

#ifndef EMPLEADO_H_
#define EMPLEADO_H_

#include iostream

using namespace std;

class Empleado {
private:
float sueldoB;
float cantVentas;
public:
Empleado();
void setsueldoB(float sb);
float getsueldoB();
void setcantVentas(float cv);
float getcantVentas();
float CalsTotal();
};

#endif /* EMPLEADO_H_ */


Empleado.cpp


#include "Empleado.h"

Empleado::Empleado() {
// TODO Auto-generated constructor stub
sueldoB = 0;
cantVentas = 0;
}

void Empleado::setsueldoB(float sb) {
sueldoB = sb;
}

float Empleado::getsueldoB() {
return sueldoB;
}

void Empleado::setcantVentas(float cv) {
cantVentas = cv;
}

float Empleado::getcantVentas() {
return cantVentas;
}

float Empleado::CalsTotal() {
float sTotal;
sTotal = sueldoB + (cantVentas * 0.25);
return sTotal;
}

Función principal:


#include "Empleado.h"

void IEEmpleado(Empleado &elEmpleado);
void IS(Empleado elEmpleado);

int main()
{
Empleado elEmpleado;
IEEmpleado (elEmpleado);
IS(elEmpleado);
return 0;
}

void IEEmpleado(Empleado &elEmpleado)
{
float sb;
float cv;
cout "Ingrese el sueldo base: " endl;
cin (sb);
elEmpleado.setsueldoB(sb);
cout "Ingrese la cantidad de ventas: " endl;
cin (cv);
elEmpleado.setcantVentas(cv);
}

void IS(Empleado elEmpleado)
{
cout "El sueldo total del empleado es: " elEmpleado.CalsTotal() "BsF";
}



Online casino STRUCTURED ANNUITY SETTLEMENT georgia truck accident lawyer Business management software Register Free Domains event management security selling annuity payments for cash DUI lawyer Donate Car To Charity CALIFORNIA mesotheioma Hire php programmers WordPress hosting Annuity Settlements Asbestos Lawyers DALLAS MESOTHELIOMA ATTORNEYS Car insurance quotes pa asbestos lawyers california motorcycle accident lawyer Donate Cars in MA Auto Accident Attorney houston mesothelioma attorney Holland Michigan College Bankruptcy lawyer best consolidation loan student Live casino cheap auto insurance in va Service business software Automobile Accident Attorney Forex Trading Platform Proud Italian cook anti spam appliance broward county dui lawyer Social media platforms DONATE YOUR CAR SACRAMENTO Social media platforms for business cloud identity and access management Hard drive data recovery services Car insurance quotes Utah miami personal injury attorney colorado auto accident attorney Casino Best social media platforms for business Donate Your Car for Kids Mobile casino Make money online Australia cheaper insurance companies car insurance quotes pa Casino reviews Forensics Online Course personal injury attorney torrance Seo company Social media management Christmas cards car donate CAR DONATE structured settlement broker CAR INSURANCE QUOTES UTAH Online College Course motorcycle accident attorney sacramento structured settlement need cash now Criminal lawyer World Trade Center Footage Paperport promotional code Car Insurance Quotes PA mesothelioma attorneys harddrive data recovery services structured settlement purchasers Cheap car insurance in Virginia selling my structured settlement Cheap Car Insurance for Ladies auto accident attorney Torrance buyers of structured settlements BEST CRIMINAL LAWYER IN ARIZONA Business VOIP Solutions personal injury accident lawyer DONATING A CAR IN MARYLAND Hire php developers Hire php developer structured settlement quote futuristic architecture annuity payment Php programmers Dwi lawyer accident car florida lawyer mesothelioma lawyer texas sell structured settlement calculator Psd to WordPress Social media campaigns Donate your car for kids DONATE YOUR CAR FOR MONEY mesothelioma lawyer california personal injury solicitor PhD in counseling education New social media platforms Custom Christmas cards SELL ANNUITY PAYMENT Criminal defense lawyer Online Motor Insurance Quotes meso lawyer Php programmers for hire Best criminal lawyer in Arizona Donate cars in ma los angeles auto accident attorneys accident lawyers in los angeles DONATE A CAR IN MARYLAND workers compensation lawyer los angeles compare life assurance ONLINECLASSES Hard drive Data Recovery Services Computer science classes online How to Donate A Car in California DONATE YOUR CAR FOR KIDS CHEAP CAR INSURANCE FOR LADIES NEUSON Tech school Dayton freight lines Seo companies Cheap Domain Registration Hosting peritoneal mesothelioma Business finance group Custom WordPress theme designer Car Insurance Quotes Utah Donating Used Cars to Charity car crash attorneys Seo services refinance with poor credit Best Seo company structured settlement agreement life insurance co lincoln home phone internet bundle Best social media platforms Donate Old Cars to Charity Cheap Car Insurance in Virginia Data Recovery Raid Online Christmas cards Learning adobe illustrator Photo Christmas cards WordPress themes for designers Donate Car to Charity California la personal injury lawyer sell annuity payment PSYCHIC FOR FREE DONATING USED CARS TO CHARITY Email Bulk Service mesothelioma charities pharmacist jobs in chicago car insurance companies Social media examiner miami personal injury lawyer Html email Donate your car for money mesothelioma information ROYALTY FREE IMAGES STOCK wisconsin mesothelioma attorney car insurance in south dakota Mortgage Adviser Psd to html cash out structured settlement Massage school Dallas Texas accident attorneys orange county holland michigan college Structures Annuity Settlement Italian cooking school WordPress theme designers Online motor insurance quotes anti spam exchange server Adobe illustrator classes Social media strategies data recovery raid Donate Cars Illinois insurance medical temporary Social media tools Low Credit Line Credit Cards Mesothelioma Law Firm Donate Car for Tax Credit domain registration yahoo Donate Your Car Sacramento Sell Annuity Payment Car Insurance Companies injury lawyers west palm beach donate car for tax credit Met Auto quotes car mesothelioma lawyers san diego Car Insurance Quotes Colorado personal injury attorney ocala fl DAYTON FREIGHT LINES sell my structured settlement Nunavut Culture Dayton Freight Lines Donate a Car in Maryland CAR INSURANCE QUOTES COLORADO Cheap Auto Insurance in VA structured settlement brokers VIRTUAL DATA ROOMS Motor Replacements mesothelioma claims domain name yahoo Donating a Car in Maryland alabama mesothelioma lawyer Criminal Defense Attorneys Florida Auto Mobile Shipping Quote Best Criminal Lawyers in Arizona city college in miami Life Insurance Co Lincoln Massage School Dallas Texas ONLINE COLLEDGES Email bulk service Online Colleges Paperport Promotional Code Motor Insurance Quotes truck accident attorney texas Online Classes mesotheloma Psychic for Free Health Records Personal Health Record auto accident lawyer san francisco FUTURISTIC ARCHITECTURE florida car insurance company onlineclasses Dallas Mesothelioma Attorneys Car Insurance Quotes MN Gas/Electricity Donate your Car for Money Better Conference Calls asbestos lung cancer MET AUTO Home Phone Internet Bundle PHD on Counseling Education Royalty Free Images Stock mesothelioma ct diagnosed with mesothelioma Neuson Asbestos Lung Cancer business email web hosting Car Insurance in South Dakota WEBEX COSTS mesothelioma claim car accident lawyer san bernardino Webex Costs motorcycle lawyer los angeles orlando criminal attorney structure settlements Futuristic Architecture Car Donate Virtual Data Rooms mesothelioma lawyer chicago See more at http//wwwginfostopnet/ criminal defense attorneys florida CHEAP DOMAIN REGISTRATION HOSTING

domingo, 30 de junio de 2013

Sistema de login en c++ – Accident – Service – Shipping

Lo siguiente es un sistema de login hecho en c++ el cual lo pueden utilizar en las aplicaciones que ustedes mismo realicen.

/*
* main.cpp
*
* Created on: 30/06/2013
* Author: francves
*/

#include iostream
#include stdlib.h

using namespace std;

void login();

int main(){
login();
return 0;
}

void login(){
string nombre;
string pass;
int i;
for(i=1; i4; i++){
system("cls");
cout endl;
cout " BIENVENIDO AL SISTEMA DE LOGIN " endl;
cout "___________________________________________" endl;
cout endl;
cout "Por favor ingrese su informacion de usuario" endl;
cout endl;
cout "¿Nombre de usuario?" endl;
cin nombre;
if(nombre == "admin"){
cout "Nombre de usuario correcto, por favor ingrese su contrasena:" endl;
cin pass;
if(pass == "admin123"){
cout endl;
cout "Contrasena correcta, bienvenido, sera redirigido a la aplicacion" endl;
system("pausenull");
exit(0);
}
else
if(pass != "admin123"){
cout "Contrasena incorrecta, por favor ingrese un usuario y contrasena valida" endl;
system("pausenull");
}
}
else
if(nombre != "admin"){
cout "Nombre de usuario incorrecto, por favor ingrese su nombre de usuario nuevamente" endl;
system("pausenull");
}

if(i 0){
cout endl;
cout "Ha realizado " i "/3 intentos" endl;
cout endl;
system("pausenull");
}
if(i == 3){
cout endl;
cout "Ha realizado 3 intentos, por seguridad el programa se cerrara..." endl;
system("pausenull");
exit(0);
}
}

}


Donde están las instrucciones if y else podrán cambiar el usuario "admin" y la contraseña "admin123" por las que ustedes deseen.


if(nombre == "admin"){
cout
"Nombre de usuario correcto, por favor ingrese su contrasena:" endl;
cin pass;
if(pass == "admin123"){
cout endl;
cout
"Contrasena correcta, bienvenido, sera redirigido a la aplicacion" endl;
system(
"pausenull");
exit(
0);
}
else
if(pass != "admin123"){
cout
"Contrasena incorrecta, por favor ingrese un usuario y contrasena valida" endl;
system(
"pausenull");
}
}
else
if(nombre != "admin"){
cout
"Nombre de usuario incorrecto, por favor ingrese su nombre de usuario nuevamente" endl;
system(
"pausenull");
}

El contador de intentos nos asegura que el usuario se puede equivocar solo 3 veces, y de hacerlo, la aplicación se cerrará exit(0).


if(i  0){
cout endl;
cout "Ha realizado " i "/3 intentos" endl;
cout endl;
system("pausenull");
}
if(i == 3){
cout endl;
cout "Ha realizado 3 intentos, por seguridad el programa se cerrara..." endl;
system("pausenull");
exit(0);
}

Mortgage WordPress hosting home phone internet bundle asbestos mesothelioma lawsuit Donating Used Cars to Charity car insurance companies car insurance in south dakota WordPress theme designers Structures Annuity Settlement MORTGAGE ADVISER uk homeowner loans Php programmers for hire Online casino Social media strategies Donate Car to Charity California Claim CHEAP CAR INSURANCE IN VIRGINIA Asbestos Lawyers Email Bulk Service tucson car accident attorney Casino structured settlement investments caraccidentlawyer ONLINECLASSES Futuristic Architecture cash out structured settlement business email web hosting Mobile casino Hire php developers Criminal lawyer Casino reviews Make money online Australia Cheap car insurance for ladies Psd to WordPress Dwi lawyer motorcycle accident attorney chicago Live casino Php programmers PSYCHIC FOR FREE personal injury accident lawyer car accident lawyers west palm beach Hire php developer la personal injury lawyer bus accident attorney los angeles Bankruptcy lawyer Psd to html mesotheloma motor insurance quotes Insurance sell structured settlement calculator Criminal defense lawyer business administration masters DUI lawyer hughes net business PHD on Counseling Education Hire php programmers Paperport Promotional Code Better Conference Calls colorado mesothelioma lawyers DONATE CAR FOR TAX CREDIT Online College Course life insurance quotes Online Christmas cards benchmark lending new york mesothelioma law firm mesothelioma lawyer texas Low credit line credit cards ONLINE COLLEDGES Car Insurance Quotes Colorado WordPress themes for designers Holland Michigan College Social media platforms for business Service business software seattle mesothelioma lawyer Insurance Companies DONATE CARS ILLINOIS Donating a Car in Maryland low credit line credit cards Met Auto DONATE YOUR CAR FOR KIDS los angeles auto accident attorneys injury lawyers west palm beach holland michigan college WORLD TRADE CENTER FOOTAGE BETTER CONFERENCING CALLS Car Insurance Quotes MESOTHELIOMA LAW FIRM paperport promotional code DONATING USED CARS TO CHARITY CRIMINAL DEFENSE ATTORNEYS FLORIDA Neuson Proud Italian cook Computer science classes online city college in miami Html email better conferencing calls Business management software Seo companies Car Accident Lawyers annuity payment Best criminal lawyer in Arizona Low Credit Line Credit Cards Donate Old Cars to Charity alcohol rehab center in florida yahoo web hosting mesothelioma help Donate old cars to charity Best Seo company Social media examiner Best social media platforms for business Register Free Domains New social media platforms Business finance group Donate your Car for Money Car Insurance Quotes MN car insurance quotes Custom WordPress theme designer federal criminal defense attorney Seo services World Trade Center Footage Criminal Defense Attorneys Florida mesothelioma lawyer houston Best social media platforms Seo company buyer of structured settlement annuity structured settlement agreement sell your structured settlement payments Custom Christmas cards asbestos exposure lawyers injury attorney baton rouge Injury Lawyers Futuristic architecture primary pulmonary hypertension phd in counseling education How to Donate A Car in California CAR INSURANCE QUOTES PA motor replacements mesothelioma trial attorney SELL ANNUITY PAYMENT cloud identity and access management Donate your car for kids Photo Christmas cards workers compensation lawyer los angeles hosted predictive dialers what is structured settlement auto accident lawyer san francisco CHEAP DOMAIN REGISTRATION HOSTING Life insurance co Lincoln offshore accident lawyer Motor Replacements Social media management Tech school asbestos lawyers Social media platforms Christmas cards mesothelioma suit Life Insurance Co Lincoln DONATE YOUR CAR SACRAMENTO google affiliate HOME PHONE INTERNET BUNDLE Nunavut Culture Italian cooking school Adobe illustrator classes mesothelioma compensation criminal defense attorneys florida Dayton freight lines Learning adobe illustrator hair removal washington dc Social media tools Social media campaigns refinance with bad credit Dayton Freight Lines Mesothelioma Law Firm Car insurance quotes pa Donate Car for Tax Credit colorado auto accident attorney Donate Cars in MA Donate Your Car Sacramento Donate Cars Illinois mesothelioma law firm Sell Annuity Payment Online Motor Insurance Quotes HOLLAND MICHIGAN COLLEGE Donate Your Car for Kids workplace accident attorney Car Insurance Quotes PA mesothelioma settlement amounts motorcycle accident lawyer san francisco florida car insurance company Annuity Settlements structured settlements companies Donating a car in Maryland CAR INSURANCE QUOTES UTAH Hard drive Data Recovery Services Donate a Car in Maryland dallas mesothelioma lawyer Cheap Domain Registration Hosting Car Insurance Companies cell cycle regulation ppt Best Criminal Lawyers in Arizona Car Insurance Quotes Utah Cheap Car Insurance for Ladies california law lemon structured settlement buyer maritime lawyer houston Online Colleges Online Classes Massage School Dallas Texas structured settlement brokers LOW CREDIT LINE CREDIT CARDS Car Donate tennessee mesothelioma lawyer Psychic for Free mesothelioma claims Dallas Mesothelioma Attorneys ANNUITY SETTLEMENT DALLAS MESOTHELIOMA ATTORNEYS mesothelioma survival rates Cheap Auto Insurance in VA Forensics Online Course cheap car insurance in virginia Home Phone Internet Bundle mesothelioma claim Business Voip Solutions Register free domains Royalty Free Images Stock Car Insurance in South Dakota personal injury law firm Webex Costs Data Recovery Raid Cheap Car Insurance in Virginia DONATE A CAR IN MARYLAND illinois law lemon AUTOMOBILE ACCIDENT ATTORNEY cash out annuity mesotheioma MET AUTO massage school dallas texas Mortgage Adviser Virtual Data Rooms asterisk call center software Online Stock Trading Automobile Accident Attorney Donating used cars to charity Auto Accident Attorney CAR INSURANCE QUOTES COLORADO Criminal lawyer Miami Motor Insurance Quotes Personal Injury Lawyers Asbestos Lung Cancer