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++


BETTER CONFERENCING CALLS Donate Cars in MA personal injury attorney ocala fl Motor Replacements Futuristic Architecture Casino reviews PHD IN COUNSELING EDUCATION Injury Lawyers DONATING A CAR IN MARYLAND asterisk call center software MORTGAGE ADVISER meso lawyer ONLINE COLLEDGES Better Conference Calls Hire php developers CHEAP AUTO INSURANCE IN VA How to Donate A Car in California webex costs ASBESTOS LAWYERS Online Classes Computer science classes online Casino Mobile casino CAR INSURANCE QUOTES UTAH Seo company california mesothelioma attorney LOW CREDIT LINE CREDIT CARDS ashely madis business voip solutions structured settlement sell Donate Car to Charity California Online casino HOLLAND MICHIGAN COLLEGE Car Insurance Quotes Utah WORLD TRADE CENTER FOOTAGE PSYCHIC FOR FREE Online Christmas cards structured settlement investments car accident lawyers DONATE CAR FOR TAX CREDIT Online Stock Trading insurance medical temporary Motor replacements Service business software Donate your car for money maritime lawyer houston Criminal defense lawyer Proud Italian cook donate your car for money Criminal lawyer Bankruptcy lawyer Donate Cars Illinois forensics online course car insurance quotes colorado Car insurance in South Dakota Forensics online course supportpeachtreecom Massage school Dallas Texas Donating a Car in Maryland VIRTUAL DATA ROOMS DUI lawyer Make money online Australia motor insurance quotes sell structured settlement calculator DONATE YOUR CAR SACRAMENTO Live casino Annuity Settlements Cheap Car Insurance in Virginia CAR INSURANCE QUOTES PA Christmas cards online colledges Best Criminal Lawyers in Arizona Hire php programmers Dwi lawyer mesothelioma ct selling my structured settlement Psd to WordPress Dedicated Hosting Dedicated Server Hosting Php programmers for hire WordPress hosting Hire php developer offshore accident lawyer Cheap Auto Insurance in VA Criminal Defense Attorneys Florida motorcycle lawyer los angeles low credit line credit cards personal injury accident lawyer auto accident attorney Torrance Social media management Structures Annuity Settlement Html email HOME PHONE INTERNET BUNDLE mesothelioma claim WordPress theme designers mesothelioma information Seo companies Nunavut Culture buy gift card mesothelioma lawyer california Custom Christmas cards Donating used cars to charity Business management software Photo Christmas cards Business Voip Solutions Php programmers virtual data rooms Best social media platforms MESOTHELIOMA LAW FIRM Best social media platforms for business event management security motor replacements New social media platforms WEBEX COSTS Business finance group CAR INSURANCE QUOTES MN philadelphia mesothelioma lawyer Learning adobe illustrator Royalty Free Images Stock Social media platforms for business Life Insurance Co Lincoln fortis health insurance temporary Custom WordPress theme designer personal injury law firm Donating Used Cars to Charity peritoneal mesothelioma Seo services injury lawyer houston tx Paperport promotional code Low Credit Line Credit Cards Best Seo company Better conferencing calls Business VOIP Solutions orlando criminal attorney Online motor insurance quotes mesothelioma drug phd in counseling education alabama mesothelioma lawyer auto insurance cost by state WordPress themes for designers Webex Costs automobile accident attorney Social media examiner Online classes life insurance co lincoln DAYTON FREIGHT LINES Online colledges Gas/Electricity accident lawyers in los angeles Tech school Social media platforms structered settlement business email web hosting los angeles auto accident attorneys motorcycle accident lawyer san francisco Psd to html Register free domains CRIMINAL DEFENSE ATTORNEYS FLORIDA Paperport Promotional Code florida car insurance company Italian cooking school Neuson ANNUITY SETTLEMENT DONATE YOUR CAR FOR KIDS Adobe illustrator classes mesothelioma claims domain yahoo Social media strategies mesothelioma lawyer virginia Social media tools Social media campaigns Mesothelioma Law Firm Donate Car for Tax Credit cash out structured settlement Donate Your Car Sacramento Sell Annuity Payment Donate Your Car for Kids Health Records Personal Health Record miami personal injury attorney Asbestos Lawyers Car Insurance Quotes Colorado mesothelioma annuity payment Donating a car in Maryland Motor Insurance Quotes Dayton Freight Lines Hard drive data recovery services Car Insurance Quotes MN Hard drive Data Recovery Services CHEAP CAR INSURANCE FOR LADIES auto accident lawyer san francisco selling annuity ONLINECLASSES Donate a Car in Maryland Cheap Domain Registration Hosting Online Motor Insurance Quotes Donate cars in ma car insurance quotes mn structured settlement agreement Car Insurance Quotes Dallas Mesothelioma Attorneys utah mesothelioma lawyer adverse remortgage Holland Michigan College mesotheliama Online Colleges domain registration yahoo donate old cars to charity student loan consolidation program World Trade Center Footage Massage School Dallas Texas mesothelioma attorneys Psychic for Free Donate Old Cars to Charity truck accident attorney los angeles Home Phone Internet Bundle Cheap car insurance for ladies Cheap auto insurance in VA Donate your Car for Money donating used cars to charity Car Donate wisconsin mesothelioma attorney Met Auto asbestos lawyers Online Criminal Justice Degree Forensics Online Course Asbestos Lung Cancer onlineclasses Criminal defense attorneys Florida california motorcycle accident lawyer PHD on Counseling Education Auto Mobile Shipping Quote mesothelioma litigation Car Insurance Quotes PA Car Insurance in South Dakota Email Bulk Service Cheap Car Insurance for Ladies buying structured settlements Register Free Domains Car insurance quotes Utah REGISTER FREE DOMAINS Mortgage Adviser how to donate a car in california Virtual Data Rooms Online College Course Automobile Accident Attorney Mortgage adviser personal injury solicitor Auto Accident Attorney Car Accident Lawyers Data Recovery Raid

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

Asbestos Lawyers sell structured settlement calculator mesothelioma suit Business Voip Solutions Service business software MESOTHELIOMA LAW FIRM Donate Old Cars to Charity Online casino Best Seo company Nunavut Culture Dallas Mesothelioma Attorneys Live casino DUI lawyer Hire php programmers world trade center footage Social media management Psychic for Free Better Conference Calls Social media tools webex costs NUNAVUT CULTURE hughes net business Auto Mobile Shipping Quote Car Accident Lawyers Casino Donate Your Car for Kids philadelphia mesothelioma lawyer Criminal lawyer Email Bulk Service New social media platforms Christmas cards Html email auto insurance yuba city ca los angeles motorcycle accident lawyer car accident lawyers los angeles Casino reviews Best social media platforms Php programmers for hire Donate Car for Tax Credit Mobile casino Mortgage Adviser Computer science classes online Injury Lawyers Car Insurance Quotes Utah Motor Insurance Quotes mesothelioma Donate your car Sacramento DONATE YOUR CAR SACRAMENTO Cheap Car Insurance in Virginia Make money online Australia Cheap auto insurance in VA Criminal Defense Attorneys Florida accident attorney san bernardino Insurance MOTOR REPLACEMENTS alcohol rehab center in florida Hire php developers Massage school Dallas Texas domain yahoo Dwi lawyer yahoo web hosting AUTO ACCIDENT ATTORNEY dallas mesothelioma lawyer workers compensation lawyer los angeles purchase structured settlements WebEx costs how to donate a car in california Donate your car for kids refinance with poor credit Criminal defense lawyer Best criminal lawyer in Arizona register free domains workplace accident attorney onlineclasses HOW TO DONATE A CAR IN CALIFORNIA Photo Christmas cards MET AUTO Seo services WordPress themes for designers CRIMINAL DEFENSE ATTORNEYS FLORIDA Automobile Accident Attorney Hire php developer DONATE YOUR CAR FOR KIDS Donate Cars Illinois student loan consolidation program Bankruptcy lawyer PHD on Counseling Education refinance with bad credit Custom WordPress theme designer Personal Injury Law Firm Criminal lawyer Miami Cheap Car Insurance for Ladies Php programmers Seo companies DONATING USED CARS TO CHARITY World trade center footage Virtual Data Rooms Life insurance co Lincoln Best social media platforms for business Business finance group HARDDRIVE DATA RECOVERY SERVICES NEUSON Social media examiner EMAIL BULK SERVICE Dayton Freight Lines online criminal justice degree ASBESTOS LAWYERS CAR DONATE buyers of structured settlements Social media platforms for business personal injury attorney springfield mo illinois law lemon Car Insurance Quotes PA Cheap car insurance in Virginia LIFE INSURANCE CO LINCOLN Futuristic Architecture Car insurance quotes MN personal accident attorney DONATE CARS IN MA mesothelioma settlements STRUCTURED ANNUITY SETTLEMENT Business management software Adobe illustrator classes mesothelioma attorney directory Seo company Custom Christmas cards Online Christmas cards earthlink business internet Cheap Domain Registration Hosting california mesothelioma attorney AUTOMOBILE ACCIDENT ATTORNEY donate your car for kids meso lawyer Paperport Promotional Code WordPress hosting car insurance in south dakota Psd to WordPress Proud Italian cook Forensics Online Course Tech school World Trade Center Footage harddrive data recovery services Social media platforms phd in counseling education mesothelioma attorney california personal injury attorney torrance Psd to html Italian cooking school WordPress theme designers Social media strategies Donate old cars to charity Learning adobe illustrator Car Insurance Quotes Colorado SELL ANNUITY PAYMENT structured annuity settlement Car Insurance Quotes MN Mesothelioma Law Firm donate your car for money anti spam exchange server Social media campaigns MASSAGE SCHOOL DALLAS TEXAS business voice mail service Online Stock Trading Donate Car to Charity California PAPERPORT PROMOTIONAL CODE primary pulmonary hypertension motorcycle accident attorney chicago Donate Cars in MA mesothelioma help Donate Your Car Sacramento How to Donate A Car in California Car Insurance Quotes Sell Annuity Payment mesothelioma symptoms Structures Annuity Settlement WORLD TRADE CENTER FOOTAGE event management security Paperport promotional code Annuity Settlements att call conference Motor Replacements mesothelioma law firm cheap domain registration hosting personal injury firm Online colledges Forensics online course Donate a Car in Maryland federal criminal defense attorney Hard drive Data Recovery Services domains yahoo best structured settlement companies DONATING A CAR IN MARYLAND Donating a Car in Maryland structured settlement purchasers Cheap Auto Insurance in VA ONLINE COLLEDGES compare life assurance CAR INSURANCE QUOTES MN selling a structured settlement donate old cars to charity Best Criminal Lawyers in Arizona Donate car to charity California Life Insurance Co Lincoln Holland Michigan College Online Motor Insurance Quotes selling my structured settlement CAR INSURANCE QUOTES UTAH Mortgage Online Colleges mortgage adviser structured settlements annuities auto insurance cost by state Car insurance quotes Colorado cell cycle regulation ppt Online Classes asbestos mesothelioma lawsuit Car Insurance Companies Massage School Dallas Texas ROYALTY FREE IMAGES STOCK DONATE CAR FOR TAX CREDIT DONATE YOUR CAR FOR MONEY Low Credit Line Credit Cards structured settlement company Donate your Car for Money Met Auto Home Phone Internet Bundle Donating Used Cars to Charity georgia truck accident lawyer Neuson Royalty Free Images Stock Car Insurance in South Dakota Webex Costs holland michigan college Register Free Domains lawyers accidents Claim Car Donate google adsense personal injury solicitor LOW CREDIT LINE CREDIT CARDS Online College Course Auto Accident Attorney Data Recovery Raid Business VOIP Solutions auto accident attorney hair removal washington dc Personal Injury Lawyers Asbestos Lung Cancer CHEAP CAR INSURANCE FOR LADIES Online Criminal Justice Degree

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


Car Insurance Quotes Utah Business management software adverse remortgage Life insurance co Lincoln DUI lawyer Online casino Casino reviews New social media platforms Online College Course tucson car accident attorney asbestos lawyers donate your car for money car crash attorneys Casino cheap car insurance in virginia donate old cars to charity Paperport promotional code asbestos mesothelioma lawsuit Car Insurance Quotes Colorado mesotheolima california motorcycle accident lawyer Paperport Promotional Code Motor Replacements domain registration yahoo mesothelioma Hire php developers Motor replacements Mobile casino FUTURISTIC ARCHITECTURE Make money online Australia workers compensation lawyer los angeles Virtual Data Rooms Car Donate structured settlements annuities PHD on Counseling Education Best Seo company DONATE YOUR CAR FOR KIDS massage school dallas texas accident car florida lawyer Donate Car to Charity California Online Classes Donate your car for money motorcycle accident lawyer san francisco google affiliate la personal injury lawyer Best social media platforms criminal defense attorneys florida Criminal defense lawyer domain name yahoo Photo Christmas cards structured settlement annuity companies mesothelioma lawsuits Mesothelioma Law Firm Structures Annuity Settlement Online Criminal Justice Degree canada personals yahoo Sell Annuity Payment How to donate a car in California donating used cars to charity Live casino Home Phone Internet Bundle Cheap Car Insurance for Ladies Hire php programmers motorcycle accident attorney chicago Register Free Domains personal injury law firm selling annuity dallas mesothelioma attorneys MESOTHELIOMA LAW FIRM Service business software Criminal defense attorneys Florida Dwi lawyer Hard drive Data Recovery Services Criminal lawyer Social media platforms cheaper insurance companies mesothelioma ct Christmas cards Personal Injury Lawyer Hire php developer mesothelioma lawyer houston Php programmers for hire MORTGAGE ADVISER insurance medical temporary offshore accident lawyer ONLINECLASSES Motor Insurance Quotes Bankruptcy lawyer Computer science classes online Webex Costs Auto Mobile Insurance Quote Futuristic architecture Php programmers annuity payment Seo companies Best social media platforms for business Attorney harddrive data recovery services best mesothelioma lawyers data recovery raid Business finance group Better Conference Calls Online Motor Insurance Quotes Social media platforms for business Custom WordPress theme designer Nunavut Culture MOTOR REPLACEMENTS Social media examiner Royalty Free Images Stock Seo services criminal defense federal lawyer WordPress hosting Tech school World Trade Center Footage structured settlement cash out REGISTER FREE DOMAINS mesothelioma attorney florida buyer of structured settlement annuity Seo company Online Christmas cards Custom Christmas cards Forensics Online Course car insurance quotes Donate Cars in MA DALLAS MESOTHELIOMA ATTORNEYS philadelphia mesothelioma lawyer Futuristic Architecture WordPress themes for designers mesothelioma claims Met Auto Email Bulk Service Cheap Auto Insurance in VA CAR ACCIDENT LAWYERS Psd to WordPress CAR INSURANCE QUOTES COLORADO mesothelioma charities selling my structured settlement event management security Social media management MASSAGE SCHOOL DALLAS TEXAS Adobe illustrator classes michigan motorcycle accident lawyer Holland Michigan College business voice mail service injury lawyers mesothelioma settlement amounts mesothelioma symptoms holland michigan college earthlink business internet Html email domain yahoo Learning adobe illustrator DONATE OLD CARS TO CHARITY WEBEX COSTS NEUSON Proud Italian cook Psd to html DONATE CAR FOR TAX CREDIT Italian cooking school new mexico mesothelioma lawyer Donating a car in Maryland Psychic for Free Business VOIP Solutions fortis health insurance temporary WordPress theme designers Car Accident Lawyers DONATING USED CARS TO CHARITY Social media strategies Social media tools most profitable internet business Cheap car insurance in Virginia injury attorney baton rouge mesothelioma suit structured settlement company motorcycle accident lawyer california forensics online course Social media campaigns Best Criminal Lawyers in Arizona new york mesothelioma law firm Donate Car for Tax Credit wisconsin mesothelioma attorney Asbestos Lawyers sell structured settlement calculator mesothelioma attorney Donate Your Car Sacramento How to Donate A Car in California HOLLAND MICHIGAN COLLEGE Donate Your Car for Kids bus accident attorney los angeles mesothelioma claim Injury Lawyers Annuity Settlements personal injury lawyer sarasota fl Dayton Freight Lines Donate a Car in Maryland Cheap Domain Registration Hosting Donating a Car in Maryland Donate Cars Illinois fast cash for house Criminal Defense Attorneys Florida truck accident attorney texas Car Insurance Quotes Life Insurance Co Lincoln Better conferencing calls Donate car to charity California best criminal lawyer in arizona CAR INSURANCE QUOTES UTAH Online Colleges workplace accident attorney mesothelioma lawsuit Massage School Dallas Texas purchase structured settlements online motor insurance quotes city college in miami Donate Old Cars to Charity Low Credit Line Credit Cards Dallas Mesothelioma Attorneys mesothelioma compensation Car Insurance Quotes MN Donate your Car for Money Criminal lawyer Miami Gas/Electricity structured settlement agreement buying an annuity calculator cloud identity and access management Donating Used Cars to Charity car accident lawyer san bernardino Car insurance quotes pa Neuson Car Insurance Quotes PA DONATE YOUR CAR FOR MONEY Car Insurance in South Dakota Car insurance in South Dakota Auto Accident Attorney caraccidentlawyer mesothelioma lawyer virginia Cheap Car Insurance in Virginia cheap domain registration hosting structured settlement quote CRIMINAL DEFENSE ATTORNEYS FLORIDA ONLINE COLLEDGES CAR INSURANCE IN SOUTH DAKOTA yahoo web hosting DONATE CARS IN MA Mortgage Adviser student loan consolidation program HARDDRIVE DATA RECOVERY SERVICES Dedicated Hosting Dedicated Server Hosting Automobile Accident Attorney HOME PHONE INTERNET BUNDLE

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

donate car for tax credit mesothelioma attorneys california Online casino Dwi lawyer personal injury lawyer sarasota fl personal injury law firm best criminal lawyer in arizona Online Motor Insurance Quotes Html email Service business software Register free domains LIFE INSURANCE CO LINCOLN CAR DONATE Casino Custom Christmas cards Seo services structured settlement buyer Psd to html Low Credit Line Credit Cards mesothelioma charities Massage School Dallas Texas Injury Lawyers seattle mesothelioma lawyer Hire php programmers sell structured settlement calculator lease management software structured settlement cash out Donate Car To Charity CALIFORNIA Php programmers for hire peritoneal mesothelioma Criminal lawyer Miami car accident lawyers PHD on Counseling Education Massage school Dallas Texas Best social media platforms webex costs REGISTER FREE DOMAINS Online Criminal Justice Degree Mobile casino CAR INSURANCE QUOTES MN Hard drive Data Recovery Services Best social media platforms for business Photo Christmas cards california mesothelioma attorney Futuristic Architecture firm law mesothelioma mesothelioma lawyer houston Life Insurance Co Lincoln Gas/Electricity Make money online Australia car insurance companies benchmark lending Php programmers NUNAVUT CULTURE mesothelioma settlement amounts maritime lawyer houston Motor Replacements personal injury attorney torrance Criminal defense attorneys Florida Psd to WordPress Live casino Cheap Car Insurance for Ladies Register Free Domains Donate Old Cars to Charity Casino reviews WEBEX COSTS Best Criminal Lawyers in Arizona Donate your car for money mesothelioma attorney illinois CAR ACCIDENT LAWYERS Car Insurance Quotes MN car insurance quotes colorado lawsuit mesothelioma DUI lawyer Donate your car Sacramento Hire php developers BEST CRIMINAL LAWYER IN ARIZONA structured settlement quote ONLINE MOTOR INSURANCE QUOTES Business finance group structure settlements Automobile Accident Attorney WordPress theme designers massage school dallas texas cheaper insurance companies workers compensation lawyer los angeles Criminal lawyer asterisk call center software caraccidentlawyer CAR INSURANCE QUOTES COLORADO Donate car for tax credit alcohol rehab center in florida WebEx costs Italian cooking school Neuson Car Insurance Quotes Colorado Criminal defense lawyer selling annuity payments for cash Royalty Free Images Stock Donate Your Car for Kids Social media tools Hire php developer Bankruptcy lawyer PHD IN COUNSELING EDUCATION Learning adobe illustrator Computer science classes online Seo companies fast cash for house Virtual Data Rooms cash out annuity Social media platforms Asbestos Lawyers New social media platforms Social media platforms for business mesothelioma litigation Car Accident Lawyers Custom WordPress theme designer federal criminal defense attorney CHEAP AUTO INSURANCE IN VA Donating a car in Maryland Best Seo company Business management software MOTOR REPLACEMENTS Dallas mesothelioma attorneys NEUSON Seo company Donate your Car for Money Online Christmas cards mesothelioma law suits WordPress themes for designers WordPress hosting SELL ANNUITY PAYMENT Sell Annuity Payment life insurance co lincoln Social media examiner CHEAP CAR INSURANCE FOR LADIES Social media management canada personals yahoo Tech school mesothelioma attorney assistance asbestos exposure lawyers car insurance in south dakota Christmas cards DONATING USED CARS TO CHARITY diagnosed with mesothelioma low credit line credit cards Proud Italian cook Online motor insurance quotes Car Insurance Quotes car donate earthlink business internet Donate your car for kids Nunavut culture PAPERPORT PROMOTIONAL CODE Donate Car to Charity California Adobe illustrator classes Social media strategies car accident lawyer san bernardino DONATING A CAR IN MARYLAND data recovery raid Structures Annuity Settlement Social media campaigns Mesothelioma Law Firm what is structured settlement Donate Car for Tax Credit Donate Cars in MA mesothelioma compensation Donate Your Car Sacramento Annuity Settlements How to Donate A Car in California life insurance quotes Car insurance quotes Utah Personal Injury Lawyer Online Colleges structured settlement blog small business administration sba AUTOMOBILE ACCIDENT ATTORNEY emergency response plan ppt Nunavut Culture illinois law lemon Dayton Freight Lines car crash attorneys structured settlement brokers semi truck accident lawyers Forex Trading Platform Donate a Car in Maryland Forensics Online Course Car Donate Cheap Domain Registration Hosting mesothelioma information california law lemon Paperport Promotional Code wisconsin mesothelioma attorney truck accident attorney texas Donating a Car in Maryland Donate Cars Illinois attorney lawyer mesothelioma Criminal Defense Attorneys Florida Car Insurance Quotes Utah injury lawyers west palm beach domain name yahoo mesothelioma lawyer texas Holland Michigan College Auto Mobile Shipping Quote selling a structured settlement Webex Costs Online Classes World Trade Center Footage Psychic for Free Cheap car insurance in Virginia sell annuity payment Dallas Mesothelioma Attorneys car insurance quotes google adsense online colledges LOW CREDIT LINE CREDIT CARDS Cheap Auto Insurance in VA car insurance quotes pa Met Auto Business VOIP Solutions Home Phone Internet Bundle Donating Used Cars to Charity DONATE A CAR IN MARYLAND Online classes Car Insurance Quotes PA DONATE CARS ILLINOIS WORLD TRADE CENTER FOOTAGE Car Insurance in South Dakota Email Bulk Service DONATE YOUR CAR SACRAMENTO dui lawyer scottsdale dallas mesothelioma lawyer illinois mesothelioma lawyer personal injury accident lawyer Cheap Car Insurance in Virginia bus accident attorneys Better Conference Calls CAR INSURANCE QUOTES PA better conferencing calls personal injury attorney ocala fl Mortgage Adviser los angeles auto accident attorneys Better conferencing calls MESOTHELIOMA LAW FIRM mesothelioma lawyer dallas mesothelioma lawsuits Online College Course Donating used cars to charity california motorcycle accident lawyer google affiliate