[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Guys i need help, im trying to do a lybrari whit this program,
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /wsr/ - Worksafe Requests

Thread replies: 12
Thread images: 3
File: imfucked.jpg (289 KB, 750x1125) Image search: [Google]
imfucked.jpg
289 KB, 750x1125
Guys i need help, im trying to do a lybrari whit this program, but i dont know how to do it, can you help me whit that. //yeah the code is in spanish and that program is a pice of shit but i need help whit that
>>
i forgot to post the program lmao

#include <iostream>
#include <stdio.h>
#include <conio.h>

using namespace std;
int main ()
{
float naranjas, r;//variables de bloque
int litros;
cout<<"En un puesto de jugos se obtiene 1 litro de jugo por cada 5 naranjas"<<endl;
cout<<"Cuantas naranjas quieres usar para hacer tu jugo? "<<endl;
naranjas=0.2;
cin>>litros;
r=naranjas*litros;
if (r<=0){
cout<<"Ingresa un numero valido ";
}
else{

cout<< "Tu vaso tiene "<<r<< " litros de jugo!!";
}
}
>>
explícate bien
>>
Nesesito comvertir el programa a una libreria pero no se como hacerlo, ya vi metodos pero me da error de la forma en que yo lo hago.
>>
No jodas escribes igual de culero en español e inglés.
qué error te da?
>>
File: Sin título.png (15 KB, 1186x390) Image search: [Google]
Sin título.png
15 KB, 1186x390
No soy bueno escribiendo de noche xd
No se como hacerlo bien lo tengo asi:
>>
solo le pediste al usuario que ingrese las naranjas pero en ningun momento lo puede hacer. a las naranjas ya les diste un valor de 0.2 naranjas en el código, siempre te va a dar lo mismo.
>>
y no se si sea tu primer programa, pero no tiene el
cin.get();
cin.get();
al final
>>
ES por que ese no es el codigo original asi lo deje para hacerlo una libreria, el codigo original es este:

#include <iostream>
#include <stdio.h>
#include <conio.h>

using namespace std;
int main ()
{
float naranjas, r;//variables de bloque
int litros;
cout<<"En un puesto de jugos se obtiene 1 litro de jugo por cada 5 naranjas"<<endl;
cout<<"Cuantas naranjas quieres usar para hacer tu jugo? "<<endl;
naranjas=0.2;
cin>>litros;
r=naranjas*litros;
if (r<=0){
cout<<"Ingresa un numero valido ";
}

else{

cout<< "Tu vaso tiene "<<r<< " litros de jugo!!";
}
}
>>
no necesitas el int litros
quita las lineas 14 y 15
en su lugar pon:
cin>>naranjas
r=(naranjas/5)
y ya.
>>
(14 y 15 de la imagen)
>>
>>114103
gracias anon
Thread replies: 12
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.