Find Jobs
Hire Freelancers

Mars Mips Assembly program

$10-30 USD

Terminado
Publicado hace más de 10 años

$10-30 USD

Pagado a la entrega
Ask the user to input a string of expression in RPN form (+ - * / ), use a stack to evaluate the result and display the result (in decimal) on screen. The numbers and operations in the RPN expression are assumed to be separated by (one or more) spaces. Assuming no negative numbers in the input (but intermediate results might be negative). Calculate single-digit RPN in valid forms. For example: 3 4 – 2 7 + * 4 / = -2 is a valid RPN Allowing multi-digit numbers, and detecting illegal RPN expressions. For example: 3 100 105 - + 433 * = -866 is a valid RPN 3 100 105 - + * 433 is invalid 3 abc 105 - + 433 * is invalid Extra Goal a) (20 pts): achieving the above levels for both RPN and PN. For example: 3 100 105 - + 433 * = -866 is a valid RPN - 120 / * 3 12 - 42 36 = 114 is a valid PN - 120 3 100 105 - + 433 * is invalid b) (20 pts): support of real numbers: 0.3 1.02 1.05 - + 3 * = -0.99 is a valid RPN : First, you need to prepare a stack structure that supports push / pop, etc. a) From left to right, go through every character of the expression, do the following: i. if the character is a digit (0 – 9): convert the ASCII to integer and push that number onto stack ii. if the character is an operation (+ - * / ) 1. pop from the stack a number -> A 2. pop from the stack a number -> B 3. calculate B op A ( for /, use quotient as result and ignore remainder). 4. push the result number back onto stack b) Pop out from stack -> final result
ID del proyecto: 5191080

Información sobre el proyecto

1 propuesta
Proyecto remoto
Activo hace 10 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
Thanks for considering me again. Just let me know in how many days you want this to be done?? Looking forward to your reply...
$30 USD en 4 días
5,0 (12 comentarios)
3,3
3,3

Sobre este cliente

Bandera de UNITED STATES
Chicago, United States
5,0
16
Forma de pago verificada
Miembro desde sept 29, 2013

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.