The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Challenge: bi-directional terminal view. (I/O)
07-12-2020, 02:51 PM (This post was last modified: 04-28-2021 05:25 AM by compsystems.)
Post: #1
Challenge: bi-directional terminal view. (I/O)
Sorry, for very bad google translation

Hello, the vast majority of graphics terminals are (I / O). You can simulate this feature by replicating keyboard input by printing the value on the output.

print( ">"+radius );
print( ">" + base );

for the student to switch to a language like c ++, see a functional similarity between hp-prime and c ++ code

Examples

Therefore, hp-prime team requires a command to read the data from the terminal view, the challenge is to make the terminal view bi-directional input and output of data.


PHP Code:
export Area_of_Circle()
begin
  local radius
area;
  print();
  print( 
"please enter the radius of a circle" );   wait;
  
inputradius ); print( ">"+radius );
  
area := 3.14 radius 2
  print( 
"the area is :" area );
  return 
"done";
end

PHP Code:
export areabaseheightanswer;
//export area, base:=3, height:=4, answer;
const const1:= '1/2';
export Area_of_Triangle()
begin
    
// local area, base, height, answer;
    
print();
    
area := const1*'(base * height)';
    
print2d'area'=area ); // FIRMWARE )2021
    
print( "Please enter the base of the triangle " );   wait;
    
inputbase ); print( ">" base ); 
    print( 
"Please enter the height of the triangle " );   wait;
    
inputheight ); print( ">" height ); 
    
answer := eval(area); 
    print( 
"The area of the triangle is: " answer );
    return { 
'base'=base'height'=heightarea=answer };
end
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Challenge: bi-directional terminal view. (I/O) - compsystems - 07-12-2020 02:51 PM



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