Post Reply 
[VA] HP-71B Mini-challenge: Qualifying for a job II: Your best image
09-29-2022, 09:24 PM
Post: #1
[VA] HP-71B Mini-challenge: Qualifying for a job II: Your best image
  
Hi, all,

After passing with flying colors the first part of your job application evaluation (the infamous "DEF FN Hell" part,) now the Human Resources manager, Ms. Lovejoy, mercilessly inflicts a new programming task upon those applicants who survived, namely asking them to create a simple three-liner strictly according to the following specification:

The BASIC program (for a bare-bones HP-71B) must first (1) perform some initialization, ask for a real value x and force it to the range [1..100], then (2) it must display on a single line the values of
    x, sin(x), cos(x), tan(x) and ln(x)+exp(x)
in FIX format rounded to, respectively, 3, 1, 4, 1, 6 places to the right of the decimal point (*), and finally (3) display "OK" on a new line and end. As always, the shorter the better.
    (*) If the number of digits to be displayed exceeds 12 (the value is too big), or if a nonzero value rounded to N places past the decimal point would be displayed as zero (the value is too small), then the value should be displayed in SCI format, rounded to N places past the decimal point.
The first part is easy and she provides it for you:
    1 DESTROY ALL @ RADIANS @ INPUT X @ X=MAX(MIN(X,100),1)
The third part, also provided by Ms. Lovejoy, is even easier:
    3 DISP "OK"
So all you have to do is fill in the dots in the second part with your own code:
    2 DISP...
There shouldn't be any DISP-like (PRINT, etc.) statements in line 2 other than the initial 2 DISP..., either explicit or implicit, and you may not add or modify any other program lines.

Your finished program must produce the following five test sample runs (plus "OK"), roughly tabulated here as follows for clarity's sake (the values should be output exactly as shown, the spacing is just indicative):
    >RUN -> ?   SQR(5) [ENDLINE]  ->   2.236   0.8  -0.6173     -1.3            10.161188
    >RUN -> ?    PI/2  [ENDLINE]  ->   1.571   1.0  -5.1034E-12 -195948537906.   5.262060
    >RUN -> ?     13   [ENDLINE]  ->  13.000   0.4   0.9074      0.5        442415.956958
    >RUN -> ?     30   [ENDLINE]  ->  30.000  -1.0   0.1543     -6.4             1.068647E13
    >RUN -> ? 51*PI/2  [ENDLINE]  ->  80.111  -1.0  -3.9728E-11  25171429518.9   6.188666E34 
That's all. Give your all to try and cast the best image using your HP-71B programming abilities. As always, if I see interest I'll post my original solution in a few days.

Best of luck with your job application ! Smile
V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
[VA] HP-71B Mini-challenge: Qualifying for a job II: Your best image - Valentin Albillo - 09-29-2022 09:24 PM



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