Post Reply 
[HP Prime]Program to count bits - word - binary [New app]
09-23-2022, 05:50 AM (This post was last modified: 09-23-2022 03:21 PM by DrEureka.)
Post: #1
[HP Prime]Program to count bits - word - binary [New app]
Hello I leave this program I hope you will use whoever wants to use it, I am new in the PPL programming, apologize if there are better ways to improve the code.
[Image: ingreso-programa.HaAfY]
https://tinypic.host/i/ingreso-programa.HaAfY
Code:

//DrEureka Wbinary Ver. 0.0.1


EXPORT WBINARIO()
BEGIN
LOCAL Wo;
LOCAL Ra;
LOCAL Rb;
PRINT();
INPUT({
{Wo,[0],{50,30,1}} 
},
"WORD BINARIO", 
{"CANTIDAD N°:"}, 
{"Ingresar simbolo y magnitud"});
//Input por orden!
//variable + tipo de ingreso 0 es real + ancho del input nombre y ancho del ingreso + posicion puede ser de 0 a 6 para la primera pantalla y sucesivo.
//titulo de la app
//etiqueta del input
//ayuda en el casillero del input
IF Wo==0 THEN
        MSGBOX("ERROR:error de sintaxis. El valor no puede ser 0");
        KILL;
    END;

Ra:=(2^(Wo-1))-1;
Rb:=(2^(Wo-1));
PRINT("****RESULTADO****");
PRINT("");
PRINT("Valor ingresado: "+Wo);
PRINT("Cuenta para max positivos: (2^("+Wo+"-1))-1");
PRINT("Cuenta para max negativos: (2^("+Wo+"-1))");
PRINT("");
PRINT("POSITIVO MAX=+"+Ra);
PRINT("NEGATIVO MAX=-"+Rb);
WAIT(-1);
MSGBOX("Programa finalizado");
END;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
[HP Prime]Program to count bits - word - binary [New app] - DrEureka - 09-23-2022 05:50 AM



User(s) browsing this thread: 1 Guest(s)