Post Reply 
(41C) Biorhythm Calculator
11-05-2018, 07:38 PM
Post: #2
RE: (41C) Biorhythm Calculator
(11-05-2018 01:55 PM)Gamo Wrote:  This is my first attempt to program on HP 41C
I don't own a real one and used the GO41C for Android emulator.

Welcome to the '41. :-)
Let me add just a few remarks.

The 41 series can diplay labelled results. So you do not have to display "PHYSICAL" first and then have the user press [R/S] to show the (unlabelled) value afterwards. Try this:

"PHYS: "
ARCL X
PROMPT

This writes "PHYS: " into alpha and then the value in X is appended. So the complete line will display as "PHYS: 25,3" (for instance). I suggest you use FIX 1 or FIX 2 here.

You shouldn't name a label "INT" on the HP41. "INT" is a regular HP-41 command, so you will not be able to use it as long as a label with the same name exists. XEQ"INT" will always call the program and not allow using the INT function. (Well, there is a way, but...).

The program uses trig functions, so be sure to set DEG mode here. Or, even better, replace the 360 by the respective value for the currently set angle mode. For instance with "1 ATAN 8 x" or "–1 ACOS ST+X". This will return 360 in DEG mode, 2·pi in RAD and 200 in GRAD mode.

The program uses quite a lot of data registers – for values that are only recalled once afterwards. So that's not a good idea. Simply code the numbers directly where they are needed.

(11-05-2018 01:55 PM)Gamo Wrote:  This Biorhythm Calculator program was adapted from my previous post
that was program on HP-11C

As mentioned several times, adapting programs for other calculators often is not a good idea. This is especially true for the HP-41. There are so many useful features that were not available on other HPs of its time that I would strongly recommend getting familiar with these new features and write a completely new program from scratch.

Maybe you like to try a HP-41 program based on the following algorithm:

Code:
prompt for age in days
clear sum
call subroutine with x=23 and "PHYS: " in alpha
call subroutine with x=28 and "EMOT: " in alpha
call subroutine with x=33 and "INTL: " in alpha
calculate average = sum/3
display average

subroutine:
calculate 100*sin(age*360/x)
add this to sum
append value to alpha
show alpha
return

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(41C) Biorhythm Calculator - Gamo - 11-05-2018, 01:55 PM
RE: (41C) Biorhythm Calculator - Dieter - 11-05-2018 07:38 PM



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