We're on Discord! Please join our server now if you don't want to miss anything! (More info) | Join the UCC4 contest! (More info)

* WalrusIRC & Discord main room

If you have a forum account, have more than 4 posts and are not part of a restricted usergroup, then you can chat in our main Discord server room directly from here and continue using the forums at the same time. Or you can join our server directly and access many more discussion rooms!

Author Topic: Potential Energy Calculation  (Read 838 times)

0 Members and 1 Guest are viewing this topic.

Offline Timmiez

  • New User
  • Join Date: Jun 2018
  • Location:
  • Posts: 1
  • Post Rating Ratio: +0/-0
Potential Energy Calculation
« on: June 04, 2018, 02:56:58 am »
Program originally written on TI-83 Plus:

Apparently I found out I'm quite lazy when it comes to solving equations in my science classroom, so I kinda decided to make a program that solves the answer based on the input. Though being simple for a program I made with simple knowledge.

Code: [Select]
ClrHome
Disp "INPUT TYPE:","","VARS: (P,M,H)"
Prompt  0
 
If 0=P:Then
ClrHome
Disp "POTE CALC","","INPUT: (J)"
Prompt M,H
M(9.8)H→A
Disp A
Else
End

If 0=M:Then
ClrHome
Disp "POTE MASS CALC:","","INPUT: (KG)"
Prompt P,H
P/(9.8*H)→B
Disp B
Else
End

If 0=H:Then
ClrHome
Disp "POTE HEIG CALC:","","INPUT: (M)"
Prompt P,M
P/(9.8*M)→C
Disp C
Else
End

A lot of editing of the code has had made it functional as you see it know, if you were to own a graphing calculator yourself, don't hesitate to try it out yourself, you may appreciate it.

Although to a separate topic, for those know don't know me, I'm a Freshman at my local high school and planning in enrolling in graphic design and web development. I have a great passion for programming and would love to learn any language I could grasp and soon learn. But with little information shared 'bout myself, I may post here and talk on the Discord a little more often when I come around to it. Gotz to get used to the crowd n' all.
« Last Edit: June 04, 2018, 03:03:11 am by Timmiez »


  • Calculators owned: TI-83 Plus

Offline _iPhoenix_

  • Custom title
  • Super User
  • Join Date: Mar 2017
  • Location: Location
  • Posts: 669
  • Post Rating Ratio: +16/-1
  • ███████ ▼ ♪ Best music ♫
    • @dj_iPhoenix
    • @UCytgMNPxAMDsxjimvxHf01w
    • Legend-of-iPhoenix
    • @the-legend-of-iphoenix
    • My website.
  • Gender: Male
Re: Potential Energy Calculation
« Reply #1 on: June 04, 2018, 05:55:24 am »
Welcome to CodeWalrus!


With If-Then-Else-End conditionals, you can skip the Else if you don't need it. It'll be faster and smaller!


Additionally, you don't need quotes, parentheses, braces, or brackets at the end of a line or immediately before a store arrow. This is a weird quirk if TI-BASIC, but it saves quite a few bytes in the long run :)

  • Calculators owned: Two TI-84+ CE's
Please spam here: https://legend-of-iphoenix.github.io/spam/

"walruses are better than tuxedo chickens, all hail the great :walrii:" ~ me
Evolution of my avatar:

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games