How to execute a simple php script in WP (I don’t think wp_enque_script applies here)

The short answer is to add it to whatever page template you would like. The view.php file sounds like the wrong place, but if you want it there, just add that code to whatever section of the page you want.

If you want to go a better route, I’d turn that bad boy into a shortcode. Shortcodes have a bit of a learning curve, but are extremely useful. The benefit to this being that instead of having to copy/paste the code into a new area each time – you can just call [calculator] or whatever you eventually name the shortcode. If you want to execute the shortcode in a template file simply put something like this: <?php echo do_shortcode('[calculator]'); ?>