# Part 4 — A complete beginner’s guide to Computer Programming with Clojure: Maths. Photo by Jeswin Thomas on Unsplash

# Polish notation

`(+ 5 5) ;; addition, 5 + 5.=> 10(- 20 10) ;; subtraction, 20 -10.=> 10(* 5 2) ;; multiplication, 5 x 2.=> 10(/ 50 5) ;; division, 50 divided by 5.=> 10(mod 24 14) ;; modulo, 24 mod 14.=> 10(inc 9) ;; increment, 9 + 1.=> 10(dec 11) ;; decrement, 11 -1.=> 10(Math/pow 2 4) ;; 2 to the power of 4, 2 x 2 x 2 x 2.=> 16.0(Math/sqrt 100) ;; Square root of 100.=> 10(Math/cbrt 1000) ;; Cube root of 1000.=> 10(Math/hypot 6 8) ;; Hypotenuse for a right angled triangle=> 10`

# Listing 1.

`(import ‘(javax.swing JFrame JLabel JTextField JButton)‘(java.awt.event ActionListener)‘(java.awt GridLayout))((let [frame (JFrame. “Square Root Calculator”)input-text (JTextField.)inputNo-label (JLabel. “Input Number”)square-button (JButton. “Find Sqr Root”)result-label (JLabel. “result”)](. square-button(addActionListener(proxy [ActionListener] [ ](actionPerformed [evt](let [i (Double/parseDouble (. input-text (getText)))](. result-label(setText (str (Math/sqrt i) “ is the square root”))))))))(doto frame(.setLayout (new GridLayout 2 2 3 3))(.add input-text)(.add inputNo-label)(.add square-button)(.add result-label)(.setSize 400 100)(.setVisible true))))`