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

martes, 10 de marzo de 2015

Utopian Tree HackerRank - Solución c++ – Lawyers – Auto – Forex – Dominios – Registros – Car

HackerRanks Challenges


Acá la solución implementada en C++del desafío "Utopian Tree" deHackerRank.

Conoce que son los desafíos de HackerRanks

Mira nuestro primer desafío en HackerRank

#include iostream
using namespace std;

int height(int n) {
int tamaño = 1;
if(n == 0)
return 1;
for(int i = 1; i = n; i++){
if(i%2 == 0)
tamaño++;
else
tamaño = tamaño * 2;
}
return tamaño;
}
int main() {
int T;
cin T;
while (T--) {
int n;
cin n;
cout height(n) endl;
}
}


Enlace del desafío:
https://www.hackerrank.com/challenges/utopian-tree

Sí desean proponer otras soluciones no duden en colocarlas en los comentarios.


También te podría interesar:

  1. 22 guías y libros gratis para aprender a programar en c++
  2. Code Pad la red social para programadores
  3. Operaciones básicas para vectores de objetos en c++ (Acceso, Inserción, Tamaño y eliminación)
  4. Algoritmo - Factorial de un número en C++


Mesothelioma Law Firm Online Stock Trading Online casino buy gift card Donate old cars to charity Donate Cars Illinois new york mesothelioma law firm Criminal defense lawyer MESOTHELIOMA LAW FIRM structured settlement quote Auto Mobile Insurance Quote Donate your Car for Money VIRTUAL DATA ROOMS structured settlement buyers illinois law lemon AUTOMOBILE ACCIDENT ATTORNEY Low Credit Line Credit Cards Automobile Accident Attorney Html email Mobile casino Donate Cars in MA Asbestos Lung Cancer DAYTON FREIGHT LINES structured settlement company Best social media platforms Custom Christmas cards mesothelioma law suit Hire php developers Best Criminal Lawyers in Arizona Paperport promotional code Criminal lawyer Business finance group NUNAVUT CULTURE mesothelioma law suits mesothelioma attorney florida Casino google adsense online colledges mesothelioma information DUI lawyer life insurance quotes Make money online Australia state of california car insurance mesothelioma lawyer dallas mesothelioma charities Hire php programmers Dwi lawyer Better Conference Calls Casino reviews Online Christmas cards Forex Trading Platform Live casino Sell Annuity Payment Donating used cars to charity how to donate a car in california Computer science classes online Photo Christmas cards Donate cars in ma car accident lawyers los angeles california law lemon colorado auto accident attorney Best social media platforms for business Online Criminal Justice Degree Custom WordPress theme designer life insurance co lincoln REGISTER FREE DOMAINS hair removal washington dc Service business software Seo company Social media campaigns donate your car for kids Motor Replacements Donate Old Cars to Charity Php programmers for hire Car insurance quotes Colorado mesothelioma attorney directory WordPress hosting Hire php developer Bankruptcy lawyer ashely madis Cheap Car Insurance in Virginia structured settlement purchasers Life insurance co Lincoln car insurance quotes mn Psd to html donate old cars to charity Car insurance quotes pa Hard drive Data Recovery Services Php programmers Seo companies Social media tools Criminal Defense Attorneys Florida Dedicated Hosting Dedicated Server Hosting Donate a Car in Maryland Social media examiner Motor replacements Donate Car for Tax Credit baltimore mesothelioma attorneys accident attorney orange county Online Motor Insurance Quotes New social media platforms Criminal defense attorneys Florida car accident lawyer michigan mesothelioma attorney california mesothelioma trial attorney Seo services michigan motorcycle accident lawyer How to donate a car in California Social media platforms for business HARDDRIVE DATA RECOVERY SERVICES mesotheliama california motorcycle accident lawyer compare life assurance auto accident attorney Torrance Best Seo company car accident lawyer san bernardino Health Records Personal Health Record Business management software primary pulmonary hypertension sell structured settlement calculator houston tx auto insurance Nunavut Culture Online Colleges georgia truck accident lawyer mesothelioma law firm injury lawyers WordPress themes for designers Psd to WordPress car donate business voip solutions CAR INSURANCE QUOTES MN Neuson Car Insurance Quotes Utah Social media management Tech school Social media platforms Christmas cards Proud Italian cook Email Bulk Service World Trade Center Footage Italian cooking school WordPress theme designers Adobe illustrator classes Social media strategies LOW CREDIT LINE CREDIT CARDS CAR INSURANCE QUOTES PA MASSAGE SCHOOL DALLAS TEXAS Learning adobe illustrator CAR ACCIDENT LAWYERS Futuristic Architecture mesothelioma claim Dayton freight lines Car Accident Lawyers Donate Car to Charity California personal injury law firm domains yahoo low credit line credit cards Donate Your Car Sacramento How to Donate A Car in California Donate Your Car for Kids mesothelioma ct Asbestos Lawyers mesothelioma attorney domain yahoo Structures Annuity Settlement Car Insurance Quotes Colorado Annuity Settlements AUTO ACCIDENT ATTORNEY offshore accident lawyer accident attorney in los angeles NEUSON Personal Injury Lawyers student loan consolidation program Dayton Freight Lines Forensics online course Cheap Domain Registration Hosting mesothelioma drug Met Auto att call conference DONATING A CAR IN MARYLAND Donating a Car in Maryland CAR INSURANCE QUOTES UTAH Cheap Car Insurance for Ladies structured settlement blog workers compensation lawyer los angeles CAR DONATE structered settlement CAR INSURANCE IN SOUTH DAKOTA business email web hosting Life Insurance Co Lincoln Holland Michigan College PHD on Counseling Education SELL ANNUITY PAYMENT Paperport Promotional Code Online Classes PHD IN COUNSELING EDUCATION Personal Injury Law Firm Massage School Dallas Texas Psychic for Free best mesothelioma lawyers buying structured settlements PSYCHIC FOR FREE Car Insurance Quotes PA Dallas Mesothelioma Attorneys Car Insurance Quotes MN Cheap Auto Insurance in VA MOTOR REPLACEMENTS tennessee mesothelioma lawyer donating used cars to charity Forensics Online Course Home Phone Internet Bundle la personal injury lawyer accident car florida lawyer criminal defense attorneys florida Donating Used Cars to Charity Criminal lawyer Miami anti spam exchange server workplace accident attorney Royalty Free Images Stock Car Insurance in South Dakota Webex Costs World trade center footage structured settlement cash out washington mesothelioma attorney DONATE CARS IN MA Register Free Domains HOME PHONE INTERNET BUNDLE Mortgage Adviser Car Donate Virtual Data Rooms Online College Course Auto Accident Attorney Data Recovery Raid orlando criminal attorney ONLINE COLLEDGES Motor Insurance Quotes Car Insurance Quotes caraccidentlawyer boca raton personal injury attorney Injury Lawyers buyers of structured settlements CAR INSURANCE QUOTES COLORADO car insurance quotes pa Car Insurance Companies Insurance Companies Business VOIP Solutions Auto Mobile Shipping Quote city college in miami mesothelioma settlements amounts car insurance quotes

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

martes, 2 de julio de 2013

Aplicacion para evaluar funciones polinomicas con exponentes enteros hecha en c++. – Record – Promotional Code – Lincoln

La siguiente aplicación nos ayudará a evaluar funcionespolinómicas con exponentes enteros, ejemplo si tenemos f(x)= x^2 - x y la queremos evaluar en x = 2, ésto sería f(2) = (2)^2 - 2 = 4 - 2 = 2

main.cpp

/*
* main.cpp
*
* Created on: 02/07/2013
* Author: francves
*/

#include iostream
#include math.h
#include stdlib.h

using namespace std;

int main(){
int j;
int i;
float evaluacion;
char signo;
float resultado = 0;
cout "Ingrese la cantidad de terminos de la funcion" endl;
cin j;
cout "Ingrese el valor a evaluar la funcion" endl;
cin evaluacion;
for(i= 0; i j; i++){
cout "ingrese el exponente del termino numero " i+1 endl;
float termino[i];
cin termino[i];
cout "Ingrese el coeficiente del termino ejemplo: 2X (coeficiente = 2)" endl;
float coeficiente;
cin coeficiente;
cout "El termino numero " i+1 " es positivo o negativo (p/n)?" endl;
cin signo;
if(signo == 'p'){
resultado = (1*coeficiente*pow(evaluacion, termino[i]))+resultado;
}
else
if(signo == 'n'){
resultado = (-1*coeficiente*pow(evaluacion, termino[i]))+resultado;
}
else{
cout "Debe ingresar (p) para positivos o (n) para negativos, el programa se cerrara, inicielo nuevamente." endl;
system("pausenull");
exit(0);}
}
cout "el resultado es: " resultado endl;
system("pausenull");
}

Funcionamiento:


Les dejaré la carpeta del proyecto ya compilado para que lo puedan ejecutar en sus propias computadoras.

(Para descargar clic en la imagen de abajo)


nota: descomprimir el archivo .rar y entrar en la ruta "evaluar funcion\debug" y ejecuten el .exe


Online casino Psd to html selling a structured settlement mesothelioma symptoms Tech school home phone internet bundle Personal Injury Lawyers Car Accident Lawyers Online Stock Trading Live casino Seo company Hire php developers houston tx auto insurance Cheap car insurance for ladies CAR INSURANCE QUOTES UTAH personal injury law firm structured settlement quote WordPress hosting How to donate a car in California Mobile casino DONATE YOUR CAR FOR KIDS Social media platforms for business Royalty Free Images Stock accident attorney orange county best criminal lawyer in arizona structered settlement google affiliate buying an annuity calculator best consolidation loan student structured settlement company Casino Nunavut Culture motor insurance quotes BETTER CONFERENCING CALLS Php programmers Donate Cars in MA new mexico mesothelioma lawyer mesothelioma law firm Make money online Australia Casino reviews mesothelioma charities saskatchewan auto insurance Best criminal lawyer in Arizona Webex Costs PHD on Counseling Education Christmas cards Massage School Dallas Texas massage school dallas texas benchmark lending Italian cooking school selling my structured settlement Criminal lawyer cheaper insurance companies email bulk service DUI lawyer Seo companies Online colledges Criminal Defense Attorneys Florida Business finance group Hire php programmers Dayton freight lines car crash attorneys Social media strategies Cheap auto insurance in VA CAR ACCIDENT LAWYERS Business Voip Solutions Html email Low Credit Line Credit Cards Dwi lawyer illinois law lemon Donate Old Cars to Charity Hard drive Data Recovery Services mesothelioma lawyer virginia Php programmers for hire Service business software asbestos exposure lawyers Seo services DONATE CARS IN MA primary pulmonary hypertension Criminal defense lawyer Hire php developer Asbestos Lawyers car donate what is structured settlement Custom WordPress theme designer Email bulk service Bankruptcy lawyer Best Seo company Nunavut culture mesothelioma compensation cheap car insurance in virginia Injury Lawyers Computer science classes online business administration masters structured settlement agreement Online Criminal Justice Degree Motor Replacements holland michigan college Forex Trading Platform futuristic architecture Attorney Email Bulk Service Automobile Accident Attorney structured settlements companies buyer of structured settlement annuity Best social media platforms for business cloud identity and access management mesothelioma attorney assistance New social media platforms mesothelioma lawyer houston Best Criminal Lawyers in Arizona World Trade Center Footage quotes car HARDDRIVE DATA RECOVERY SERVICES Criminal lawyer Miami Donate Car for Tax Credit mesothelioma lawyer texas Business management software asbestos lung cancer mesothelioma attorneys Donate Car To Charity CALIFORNIA Cheap Auto Insurance in VA structured settlement buyer ROYALTY FREE IMAGES STOCK buy gift card illinois mesothelioma lawyer mesothelioma lawyer chicago Best social media platforms donate your car for kids REGISTER FREE DOMAINS Online Christmas cards FUTURISTIC ARCHITECTURE Mesothelioma Law Firm HOLLAND MICHIGAN COLLEGE HOW TO DONATE A CAR IN CALIFORNIA hosted predictive dialers Custom Christmas cards alcohol rehab center in florida Photo Christmas cards google adsense Register Free Domains world trade center footage selling annuity payments for cash WordPress themes for designers NEUSON Psd to WordPress Social media examiner Donate a Car in Maryland criminal defense federal lawyer auto accident attorney Torrance Social media management injury lawyers west palm beach Asbestos Lung Cancer Car Insurance Quotes Utah CAR INSURANCE QUOTES PA Social media platforms WORLD TRADE CENTER FOOTAGE Proud Italian cook ONLINECLASSES mesothelioma settlement amounts WordPress theme designers Adobe illustrator classes ONLINE COLLEDGES caraccidentlawyer earthlink business internet Learning adobe illustrator Social media tools Social media campaigns DONATE CARS ILLINOIS Donate Car to Charity California chicago hair laser removal PSYCHIC FOR FREE CAR INSURANCE QUOTES COLORADO Donate Your Car Sacramento truck accident attorney los angeles Forensics online course domain yahoo How to Donate A Car in California mesothelioma attorneys california Futuristic architecture Sell Annuity Payment Donate Your Car for Kids Donate car to charity California Structures Annuity Settlement Car Insurance Quotes Colorado Annuity Settlements DONATING USED CARS TO CHARITY motorcycle accident attorney chicago Dayton Freight Lines best mesothelioma lawyers fast cash for house Home Phone Internet Bundle LOW CREDIT LINE CREDIT CARDS dallas mesothelioma attorneys Royalty free images stock Cheap Domain Registration Hosting Donating a Car in Maryland Donate Cars Illinois Dedicated Hosting Dedicated Server Hosting Auto Mobile Shipping Quote MET AUTO pharmacist jobs in chicago FORENSICS ONLINE COURSE Life Insurance Co Lincoln Holland Michigan College Online Classes Online Motor Insurance Quotes broward county dui lawyer selling structured settlement Online Colleges Paperport Promotional Code data recovery raid life insurance quotes Psychic for free mesothelioma lawsuit Psychic for Free houston mesothelioma attorney Dallas Mesothelioma Attorneys donating used cars to charity Car Insurance Quotes MN new york mesothelioma law firm Donate your Car for Money Met Auto Forensics Online Course low credit line credit cards Donating Used Cars to Charity Dallas mesothelioma attorneys Neuson los angeles auto accident attorneys Car Insurance Quotes PA att call conference event management security Car Insurance in South Dakota truck accident attorney texas car insurance companies Cheap Car Insurance for Ladies Cheap Car Insurance in Virginia cheap domain registration hosting Better Conference Calls DONATE YOUR CAR FOR MONEY EMAIL BULK SERVICE harddrive data recovery services Futuristic Architecture Register free domains Mortgage Adviser Car Donate Virtual Data Rooms Online College Course Auto Accident Attorney Data Recovery Raid

lunes, 1 de julio de 2013

Aplicacion para resolver ecuación de segundo grado hecha en c++. – Registros – PHD – Seguro


En algunas ocasiones que estamos estudiando matemáticas nos topamos con que debemos resolver una ecuación de segundo grado, ¿pero que sucede si queremos optimizar nuestro tiempo de estudio y resolver más rápidamente nuestros ejercicios? les planteo una aplicación escrita en c++ la cual nos resolverá nuestra ecuación de segundo grado en solo segundos.

Ecuacion.cpp

#include iostream
#include math.h
#include stdlib.h

using namespace std;

int main()
{
float a = 0;
float b = 0;
float c = 0;
int n = 2;
float k1 = 0;
float k2 = 0;
cout "Te ayudare a resolver tu ecuación de segundo grado: " endl;
cout "ingrese el valor de a " endl;
cin (a);
cout "ingrese el valor de b " endl;
cin (b);
cout "ingrese el valor de c " endl;
cin (c);
k1 = (-b + (sqrt(pow(b, n) - (4 * a * c)))) / (2 * a);
k2 = (-b - (sqrt(pow(b, n) - (4 * a * c)))) / (2 * a);
cout "x1 es igual a: " k1 endl;
cout "x2 es igual a: " k2 endl;
cout "FUCK YEAH!!" endl;
system("pausenull");
return 0;
}


Explicación:

Declaramos tres variables (a, b , c) las cuales son nuestros coeficientes y el termino independiente en el polinomio de segundo grado. Además, una variable "n" que será igual a 2 para darle el valor al cuadrado a "b" dentro de la raíz, y las variables "k1" y "k2" las cuales serán nuestros resultados de la ecuación de segundo grado.

"sqrt" es la función matemática para lasraícescuadradas en c++.

"pow" la función para exponentes de un numero.pow (x, y) , donde "x" es la base e "y" el exponente, ejemplo: pow (4, 2) sería igual a 16.

Les dejaré la carpeta del proyecto ya compilado para que lo puedan ejecutar en sus propias computadoras.

(Para descargar clic en la imagen de abajo)


nota: descomprimir el archivo.rary entrar en la ruta"ecuacion segundo grado\debug"y ejecuten el.exe

earthlink business internet Seo company Annuity Settlements Hire php developers mesothelioma lawyer houston asbestos lung cancer Donate Old Cars to Charity Car insurance quotes Colorado WordPress hosting PSYCHIC FOR FREE structured settlements annuities Psychic for Free phd in counseling education Mobile casino Online casino Service business software Custom Christmas cards Donate Your Car Sacramento AUTO ACCIDENT ATTORNEY Better Conference Calls Adobe illustrator classes structured settlement brokers MASSAGE SCHOOL DALLAS TEXAS Hard drive Data Recovery Services car insurance companies Casino saskatchewan auto insurance Royalty free images stock AUTOMOBILE ACCIDENT ATTORNEY Italian cooking school buying an annuity calculator WEBEX COSTS Donating a Car in Maryland LIFE INSURANCE CO LINCOLN Hard drive data recovery services mesothelioma care Make money online Australia mesothelioma settlements Live casino boca raton personal injury attorney Casino reviews Bankruptcy lawyer paperport promotional code PHD IN COUNSELING EDUCATION Mortgage CAR DONATE Paperport promotional code low credit line credit cards Dwi lawyer Social media management Car Insurance Quotes Best Criminal Lawyers in Arizona st louis mesothelioma attorney DUI lawyer email bulk service anti spam appliance Business Voip Solutions broward county dui lawyer Social media platforms for business Mesothelioma Law Firm Donate Cars in MA Massage school Dallas Texas Php programmers Hire php programmers Best social media platforms sell structured settlement calculator mesothelioma claims Criminal lawyer structured settlement annuity companies DAYTON FREIGHT LINES WordPress themes for designers DONATE CAR FOR TAX CREDIT Criminal defense lawyer Donate your car for money structured settlemen World Trade Center Footage Php programmers for hire Hire php developer mesothelioma attorney california buyer of structured settlement annuity Computer science classes online adverse remortgage structured settlement purchasers Best Seo company personal injury law firm Best social media platforms for business structured settlement company Seo companies personal injury solicitor Online Motor Insurance Quotes CAR INSURANCE IN SOUTH DAKOTA Car Insurance in South Dakota peritoneal mesothelioma los angeles auto accident attorneys personal injury attorney springfield mo Webex Costs New social media platforms Business finance group la personal injury lawyer michigan motorcycle accident lawyer Social media campaigns mesothelioma law suits student loan consolidation program Custom WordPress theme designer city college in miami Seo services Donate old cars to charity DONATE YOUR CAR FOR KIDS virtual data rooms structered settlement Auto Mobile Shipping Quote personal injury lawyer sarasota fl Donate car for tax credit Business management software world trade center footage Psd to WordPress Online Christmas cards Html email motor insurance quotes futuristic architecture PHD on Counseling Education BETTER CONFERENCING CALLS benchmark lending WordPress theme designers car insurance quotes Car Accident Lawyers Photo Christmas cards DONATE CARS IN MA Donating a car in Maryland royalty free images stock accident attorney san bernardino Donating Used Cars to Charity seattle mesothelioma lawyer Social media examiner Donate Your Car for Kids DONATE YOUR CAR FOR MONEY Life insurance co Lincoln Tech school Data Recovery Raid Donate Car for Tax Credit Cheap car insurance in Virginia utah mesothelioma lawyer selling structured settlement refinance with bad credit Social media platforms Christmas cards mesothelioma attorney assistance Proud Italian cook cheap auto insurance in va SELL ANNUITY PAYMENT cheaper insurance companies Learning adobe illustrator Psd to html alabama mesothelioma lawyer car insurance quotes mn Insurance Companies Social media strategies Social media tools refinance with poor credit Motor Replacements Donate Car to Charity California asbestos mesothelioma lawsuit wisconsin mesothelioma attorney semi truck accident lawyers yahoo web hosting google adsense How to Donate A Car in California Sell Annuity Payment Asbestos Lawyers Structures Annuity Settlement Car Insurance Quotes Colorado Paperport Promotional Code business voip solutions Dedicated Hosting Dedicated Server Hosting MESOTHELIOMA LAW FIRM Dallas Mesothelioma Attorneys HOW TO DONATE A CAR IN CALIFORNIA ONLINECLASSES Nunavut Culture cheap car insurance in virginia Dayton Freight Lines Donate a Car in Maryland mesothelioma claim Cheap Domain Registration Hosting Donate Cars Illinois mesothelioma suit mesothelioma lawyer asbestos cancer lawsuit cheap domain registration hosting Criminal Defense Attorneys Florida integrated ehr Car Insurance Quotes Utah Life Insurance Co Lincoln Holland Michigan College primary pulmonary hypertension Home phone internet bundle Online Colleges uk homeowner loans Online Classes NEUSON Massage School Dallas Texas mesothelioma lawsuits Futuristic architecture auto accident attorney Torrance Motor replacements Low Credit Line Credit Cards mesothelioma help buy gift card hughes net business Car Insurance Quotes MN Car Insurance Quotes PA MET AUTO car accident lawyer san bernardino Donate your Car for Money DONATE OLD CARS TO CHARITY Cheap Auto Insurance in VA Met Auto personal injury firm Cheap Car Insurance in Virginia Forensics Online Course motorcycle accident attorney sacramento Home Phone Internet Bundle Online Stock Trading orlando criminal attorney Virtual Data Rooms lawsuit mesothelioma Neuson structured settlement investments BEST CRIMINAL LAWYER IN ARIZONA Car insurance quotes Utah mortgage adviser mesothelioma lawyer california DONATE CARS ILLINOIS Royalty Free Images Stock Email Bulk Service Cheap Car Insurance for Ladies Register Free Domains Futuristic Architecture MOTOR REPLACEMENTS Mortgage Adviser Car Donate life insurance quotes Online College Course truck accident attorney texas Automobile Accident Attorney Auto Accident Attorney Donate your car Sacramento car accident lawyers west palm beach injury lawyer houston tx ONLINE COLLEDGES Criminal lawyer Miami