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

No hay comentarios:

Publicar un comentario