English 中文(简体)
TI83+ evaluate expression program
原标题:

I would like to build a program in a TI-83+ that will prompt for the variables x, y, and z, and then prompt for an expression on the terms x, y, and z. Is it possible to prompt for that expression and then evaluate it? If so, how?

问题回答

TI-Basic has an expr( command that lets you evaluate strings as expressions.

There is some information about the command here: http://tibasicdev.wikidot.com/expr

By using the expr( command along with the store command (the arrow key), your program should be fairly straight forward to write.

TI-Basic provides you with a set of variables referred to as Y-VARS. Any string can be stored to a Y-VARS variable, after witch, any time the variable is used it will be evaluated as an expression (as if you called expr on the original string). the Y-VARS menu is found by pressing VARS followed by the right arrow key.

One example of a Y-VARS variable is Y1, found under the FUNCTION sub-menu of the Y-VARS menu.

Your particular situation could be resolved using Y-VARS like this:

Prompt Y1,X,Y,Z
Disp Y1

A sample run of the program could look like this:

prgmTEST
Y1=?"Y(X+Z
X=?2
Y=?3
Z=?1
               9
            Done

In this case, the expresion "Y(X+Z" has been evaluated as 3(2+1 and the result was found to be 9.





相关问题
Minimalistic approach for a Snake-style game

I received my TI-82 STATS programmable calculator (which is in fact more of a TI-83) about two days ago - and wanted to program a Snake game with the builtin TI-BASIC language. Although I had to find ...

TI83+ evaluate expression program

I would like to build a program in a TI-83+ that will prompt for the variables x, y, and z, and then prompt for an expression on the terms x, y, and z. Is it possible to prompt for that expression and ...

How do I convert a floating point C code to fixed point?

I have a C code which uses doubles. I want to be able to run the code on a DSP (TMS320). But the DSP doesn t support doubles, only fixed-point numbers. What is the best way to convert the code into ...

TI MSP430 Interrupt source

I know that when working with the MSP430F2619 and TI s CCSv4, I can get more than one interrupt to use the same interrupt handler with code that looks something like this: #pragma vector=...

Code Composer 4 (Eclipse based)- makefiles

How do I prevent Code Composer 4 (which is based on Eclipse) from generating its own makefile and use the one I provide instead? Background: I am starting a FreeRTOS project on a MSP430F5436 using ...

Z80 (TI-83+) stops working on CALL

Every time I assemble an application for the TI-83+ calculator (Z80 processor), it stops running at CALL. Here is an example ("Hello") — it starts running just fine, but the calculator freezes at the ...

热门标签