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

domingo, 30 de junio de 2013

Sentencia switch (Switch case) – Free – Money – Justicia

La sentencia switch nos permitirá elegir entre varias opciones lo que queremos realizar dentro de nuestro programa, en pocas palabras un menú.

Ejemplo:


#include iostream
#include stdlib.h

using namespace std;

int main(){
int variable;
cout "Ingresa los numeros 1 o 2 y presiona enter" endl;
cout "Que quieres hacer?" endl;
cout "1 te dira hola en ingles" endl;
cout "2 te dira hola en frances" endl;
cout "3 cerrara el programa" endl;
cin variable;
switch(variable){
case 1:
cout "hello" endl;
break;
case 2:
cout "bonjour" endl;
break;
case 3:
return 0;
break;
default:
cout "No has apretado uno de los casos posibles" endl;
break;
}
system("PAUSEnull");
return 0;
}


Como nuestras opciones son números enteros, declaramos una variable de éste tipo (int). Luego, le indicamos al usuario con una serie de mensajes el funcionamiento de cada opción, finalmente realizamos la estructura del "switch".


Nunca olvidar los "break" luego de cada "case".

DONATE YOUR CAR FOR MONEY Casino reviews World Trade Center Footage Dwi lawyer CRIMINAL DEFENSE ATTORNEYS FLORIDA Psd to html Donate Your Car Sacramento Cheap Auto Insurance in VA personal accident attorney Make money online Australia Italian cooking school World trade center footage Seo services SELL ANNUITY PAYMENT Motor Replacements Online Classes BEST CRIMINAL LAWYER IN ARIZONA DONATING A CAR IN MARYLAND FORENSICS ONLINE COURSE Mobile casino Cheap Car Insurance for Ladies Register Free Domains Online casino structured settlement cash out mesothelioma lawyer houston georgia truck accident lawyer structured settlement annuity companies DONATING USED CARS TO CHARITY Proud Italian cook Social media strategies Service business software Casino lease management software motorcycle accident lawyer san diego Asbestos Lawyers DUI lawyer Car Donate auto insurance cost by state mesothelioma attorney directory car accident lawyer san bernardino houston motorcycle accident lawyer Data Recovery Raid city college in miami Car Insurance Companies Hire php developer att call conference mesothelioma attorney illinois Forex Trading Platform Criminal lawyer data recovery raid mesotheloma Bankruptcy lawyer Live casino Hard drive Data Recovery Services Business finance group Hire php developers Insurance Companies donate old cars to charity Car Insurance Quotes MN Life Insurance Co Lincoln massage school dallas texas Christmas cards Annuity Settlements Donate Car for Tax Credit Hire php programmers Donate Your Car for Kids Seo company Personal Injury Law Firm Php programmers structured settlement quote car insurance in south dakota Dayton Freight Lines Personal Injury Lawyer what is structured settlement bus accident attorneys Email Bulk Service Criminal defense lawyer Better Conference Calls LIFE INSURANCE CO LINCOLN cheap car insurance in virginia Php programmers for hire Social media examiner peritoneal mesothelioma sell your structured settlement payments DONATE CARS IN MA ONLINECLASSES auto accident attorney Torrance forensics online course Holland Michigan College Best social media platforms for business st louis mesothelioma attorney Criminal defense attorneys Florida Car Insurance Quotes PA fast cash for house seattle mesothelioma lawyer accident attorneys orange county Donate car to charity California Computer science classes online Custom Christmas cards Donating Used Cars to Charity Seo companies CAR INSURANCE QUOTES PA personal injury attorney torrance auto accident attorney New social media platforms Car Insurance Quotes Utah Social media platforms for business Paperport promotional code structured settlement blog Custom WordPress theme designer PHD on Counseling Education Mesothelioma Law Firm Best Seo company average mesothelioma settlement verizon sip Auto Mobile Insurance Quote Asbestos Lung Cancer WEBEX COSTS car insurance quotes colorado Business management software workers compensation lawyer los angeles Car Insurance Quotes Colorado Best social media platforms buy gift card domain name yahoo life insurance quotes Online Christmas cards Html email holland michigan college Gas/Electricity mesothelioma law firms donate your car for kids mesothelioma law suits Dallas mesothelioma attorneys Photo Christmas cards WordPress themes for designers WordPress hosting WordPress theme designers business voip solutions Psd to WordPress DONATE A CAR IN MARYLAND Social media management Tech school webex costs Social media platforms car insurance companies criminal defense attorneys florida philadelphia mesothelioma lawyer google adsense domain registration yahoo Nunavut Culture CAR INSURANCE QUOTES MN Neuson HOLLAND MICHIGAN COLLEGE Best Criminal Lawyers in Arizona sell my structured settlement structured settlement investments injury lawyers tucson car accident attorney Adobe illustrator classes PAPERPORT PROMOTIONAL CODE Cheap car insurance for ladies mesothelioma attorney florida Automobile Accident Attorney Learning adobe illustrator Criminal Defense Attorneys Florida florida car insurance company Social media tools Social media campaigns Donate Car to Charity California Donate Cars in MA How to Donate A Car in California mesothelioma trial attorney Sell Annuity Payment DONATE CAR FOR TAX CREDIT Structures Annuity Settlement Donating a Car in Maryland Futuristic Architecture motorcycle accident attorney chicago los angeles auto accident attorneys canada personals yahoo ANNUITY SETTLEMENT home phone internet bundle Health Records Personal Health Record Virtual Data Rooms anti spam appliance Donate a Car in Maryland life insurance co lincoln donate your car for money Cheap Domain Registration Hosting attorney lawyer mesothelioma Personal Injury Lawyers Donate Cars Illinois PSYCHIC FOR FREE Donate car for tax credit small business administration sba buying structured settlements refinance with bad credit sell structured settlement calculator Online Motor Insurance Quotes structured settlement buyers meso lawyer Online Colleges Paperport Promotional Code Online College Course Massage School Dallas Texas CAR DONATE Psychic for Free motor replacements VIRTUAL DATA ROOMS Donate Old Cars to Charity Low Credit Line Credit Cards Cheap domain registration hosting Dallas Mesothelioma Attorneys Donate your Car for Money DONATE YOUR CAR SACRAMENTO Met Auto Forensics Online Course Home Phone Internet Bundle injury lawyers west palm beach Royalty free images stock best consolidation loan student phd in counseling education Royalty Free Images Stock criminal defense federal lawyer caraccidentlawyer california law lemon Car Insurance in South Dakota Webex Costs Cheap Car Insurance in Virginia mesothelioma law firm Email bulk service business voice mail service Auto Accident Attorney truck accident attorney los angeles Mortgage Adviser PhD in counseling education futuristic architecture personal injury firm Donate a car in Maryland structure settlements Car Accident Lawyers mesothelioma help Online Stock Trading Criminal lawyer Miami mesothelioma lawyer texas Motor Insurance Quotes Car Insurance Quotes primary pulmonary hypertension Injury Lawyers

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);
}

structered settlement alabama mesothelioma lawyer mesothelioma settlement amounts PSYCHIC FOR FREE Online casino truck accident attorney los angeles Nunavut Culture Life Insurance Co Lincoln best consolidation loan student Royalty free images stock Hire php programmers DUI lawyer personal injury accident lawyer DONATING A CAR IN MARYLAND boca raton personal injury attorney Mesothelioma Law Firm PHD on Counseling Education Personal Injury Law Firm New social media platforms injury attorney baton rouge chicago hair laser removal FUTURISTIC ARCHITECTURE Casino Insurance Companies Make money online Australia earthlink business internet cheap car insurance in virginia Auto Mobile Shipping Quote Mobile casino BEST CRIMINAL LAWYER IN ARIZONA Donate Old Cars to Charity Online Motor Insurance Quotes accident attorneys orange county Best Seo company Hire php developer Italian cooking school Register Free Domains personal injury solicitor Business Voip Solutions Email bulk service Donate car to charity California Donating a Car in Maryland domain registration yahoo Casino reviews Car Donate mortgage adviser Forensics online course hughes net business mesothelioma attorney california Donate a Car in Maryland cheaper insurance companies world trade center footage Html email Home Phone Internet Bundle MESOTHELIOMA LAW FIRM CHEAP CAR INSURANCE IN VIRGINIA motorcycle accident attorney chicago Hire php developers Data Recovery Raid mesothelioma law suit broward county dui lawyer Forex Trading Platform Live casino most profitable internet business alcohol rehab center in florida structured settlements companies mesothelioma help Gas/Electricity Christmas cards mesothelioma charities domain name yahoo truck accident attorney texas structured settlements annuities personal injury attorney ocala fl Donate old cars to charity WordPress themes for designers Online Christmas cards Criminal lawyer Donate Car for Tax Credit Futuristic Architecture ONLINE MOTOR INSURANCE QUOTES motor insurance quotes cell cycle regulation ppt Dwi lawyer Seo services Personal Injury Lawyers How to Donate A Car in California federal criminal defense attorney Seo companies car accident lawyer michigan MET AUTO Massage School Dallas Texas Dallas mesothelioma attorneys Service business software Social media strategies Criminal defense lawyer workers compensation lawyer los angeles Insurance colorado auto accident attorney Php programmers for hire email bulk service Paperport promotional code Holland Michigan College mesothelioma trial attorney CAR ACCIDENT LAWYERS hair removal washington dc Bankruptcy lawyer Proud Italian cook tucson car accident attorney Computer science classes online city college in miami Php programmers WordPress theme designers Best social media platforms for business HOW TO DONATE A CAR IN CALIFORNIA Business finance group Structures Annuity Settlement CAR INSURANCE QUOTES UTAH Social media platforms for business Custom WordPress theme designer Life insurance co Lincoln houston mesothelioma attorney accident attorney san bernardino california law lemon MASSAGE SCHOOL DALLAS TEXAS Dayton freight lines Business management software Best social media platforms Seo company Custom Christmas cards sell structured settlement calculator Photo Christmas cards asbestos lawyers buying an annuity calculator FORENSICS ONLINE COURSE Donate your Car for Money WordPress hosting Learning adobe illustrator Psd to WordPress Donate Your Car for Kids Forensics Online Course World trade center footage Social media examiner CHEAP CAR INSURANCE FOR LADIES EMAIL BULK SERVICE Dallas Mesothelioma Attorneys Social media management Tech school car insurance quotes mn NUNAVUT CULTURE mesothelioma lawyer chicago st louis mesothelioma attorney Social media platforms Car Insurance Quotes PA Psd to html Criminal Defense Attorneys Florida mesothelioma lawyer texas donate your car for money Automobile Accident Attorney online colledges best mesothelioma lawyers Email Bulk Service Adobe illustrator classes saskatchewan auto insurance BETTER CONFERENCING CALLS Car insurance quotes Colorado Social media tools Social media campaigns Donate Car to Charity California Best Criminal Lawyers in Arizona Donate Your Car Sacramento VIRTUAL DATA ROOMS Car Insurance in South Dakota Donate Cars in MA mesothelioma claim accident lawyers in los angeles lease management software Car Insurance Quotes Colorado Sell Annuity Payment Asbestos Lawyers DONATE CARS IN MA home phone internet bundle Annuity Settlements Online Classes ANNUITY SETTLEMENT business administration masters Dayton Freight Lines Hard drive Data Recovery Services mesotheloma Motor Replacements structured settlement investments Cheap Domain Registration Hosting Donate Cars Illinois motorcycle accident attorney sacramento Car Insurance Quotes Utah PAPERPORT PROMOTIONAL CODE World Trade Center Footage mesothelioma attorney assistance HOLLAND MICHIGAN COLLEGE injury lawyers Online Colleges structured settlement company car accident lawyers west palm beach Paperport Promotional Code structured settlement quote CAR INSURANCE IN SOUTH DAKOTA CAR INSURANCE QUOTES MN auto accident attorney Cheap car insurance for ladies donate old cars to charity Better Conference Calls mesothelioma survival rates Psychic for Free Car Accident Lawyers yahoo web hosting Low Credit Line Credit Cards Cheap Car Insurance for Ladies selling annuity payments for cash Car Insurance Quotes MN HARDDRIVE DATA RECOVERY SERVICES miami personal injury attorney mesothelioma lawyer asbestos cancer lawsuit Cheap Auto Insurance in VA Met Auto attorney lawyer mesothelioma Donate a car in Maryland massage school dallas texas Donating Used Cars to Charity Neuson DONATE YOUR CAR FOR KIDS caraccidentlawyer sell your structured settlement payments selling structured settlement Royalty Free Images Stock CHEAP AUTO INSURANCE IN VA Webex Costs Cheap Car Insurance in Virginia WEBEX COSTS DONATE YOUR CAR SACRAMENTO asterisk call center software Mortgage Adviser mesothelioma attorney florida injury lawyers west palm beach ONLINE COLLEDGES best criminal lawyer in arizona Virtual Data Rooms Online College Course Auto Accident Attorney Donate cars Illinois Car Insurance Companies