# Need help with program with reaction.

4 replies to this topic

### #1 Roald

Roald

Newbie

• Members
• 4 posts

• Calculators:

Posted 19 January 2017 - 08:09 PM

Hi, Im new to this forum and new to these calculators.
I've started to use my Classpad II in advance of technical school start.

Im trying to make a program that will help me determine if a beam has the right capacity or not.
So far so good, the program do what I describe, but I would love to have it to tell me if suggested beam is good enough or not.
Here is my program (Im norwegian, so text is probably not translated perfectly):

Print AxB
Input C, "Beam length"
Print (AxB)xC/4
Input D, "Material strenght"
Input E, "Material factor"
Print D/E
Input F, " Material Cross Section"
Print "Dimensioning torque capacity"
Print (D/E)xF/1000000

I would very much like to have the program to react at the bottom line answer.
Is it possible to make the program to tell me with ex. red letters if Torque load (AxB)xC/4) is higher than Torque capacity (D/ExF/1000000)
It does not have to be in red letters if that's not possible.

Best regards
Roald Riska

### #2 frankmar98

frankmar98

Casio Freak

• Moderator
• 127 posts
• Gender:Male
• Location:Spain
• Interests:Science, programming

• Calculators:
CFX-9970G
Graph 90+E (fx-GC50)
fx-9860G SD
HP Prime
TI-84+ CE-T
x2 TI-83+
TI-81
fx-4800p, fx-3650PII
fx-991SPX, fx-991ES PLUS, fx-100W

Posted 19 January 2017 - 08:44 PM

Hello, Roald, and welcome to UCF!

You should introduce yourself in this topic:

http://community.cas...ge-7#entry60978

Your program is a good input -- calculations -- output program.

The next step in your programming learning process, is to learn conditionals (if -- then -- else  -- EndIf) and then loops. (useful to make the calculator make simple decisions)

I don't know the Classpad language exactly syntax. You should learn control flow statements with a basic programming book, and then translate it to the classpad syntax using the manual.

Good luck with programming!

• Roald likes this

### #3 pan.gejt

pan.gejt

Casio Freak

• Members
• 169 posts
• Gender:Male
• Location:CZ

• Calculators:
.

Posted 20 January 2017 - 09:35 AM

Maybe like this

ClrText
Input C,"beam length"
Input D,"material strength"
Input E,"material factor"
Input F,"material cross section"
Print A×B
A×B×C/4=>G
Print G
Print "D/E",ColorYellow
Print D/E
(D/E)×F/1000000=>H
Print "dimensioning torque capacity",ColorCyan
Print H
If G>H
Then
Print "torque load is higher than torque capacity",ColorRed
Else
Print "torque load is lower than torque capacity",ColorGreen
IfEnd

Notice: You can use 7 colors to specify the colors

ColorBlack

ColorBlue

ColorRed

ColorMagenta

ColorGreen

ColorCyan

ColorYellow

• Roald likes this

### #4 Roald

Roald

Newbie

• Members
• 4 posts

• Calculators:

Posted 23 January 2017 - 06:54 PM

Hi pan.gejt!

Thank you very much.

I will try this tonight

### #5 Roald

Roald

Newbie

• Members
• 4 posts

• Calculators:

Posted 24 January 2017 - 05:26 PM

Hi pan.gejt!

It worked perceft, thank you

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users