{"id":162,"date":"2023-04-21T14:12:33","date_gmt":"2023-04-21T13:12:33","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/insidem11\/?page_id=162"},"modified":"2023-05-11T15:16:12","modified_gmt":"2023-05-11T14:16:12","slug":"program-3-pocket-money-calculator","status":"publish","type":"page","link":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/insidem11\/program-3-pocket-money-calculator\/","title":{"rendered":"Program 3: Pocket Money Calculator"},"content":{"rendered":"\n<p>This program calculates a teenager&#8217;s pocket money on a monthly and yearly basis. It also calculates how much pocket money they will earn before they are 18. <\/p>\n\n\n\n<p>You can see the code and output below, or you can access it on repl.it by&nbsp;<a href=\"https:\/\/replit.com\/@MrWilsonDFSA\/Pocket-Money-Calculator\" target=\"_blank\" rel=\"noreferrer noopener\">clicking here.<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Code<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/insidem11\/uploads\/sites\/10357\/2023\/04\/21140217\/image-7-1024x567.png\" alt=\"\" class=\"wp-image-163\" width=\"773\" height=\"428\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/insidem11\/uploads\/sites\/10357\/2023\/04\/21140217\/image-7-1024x567.png 1024w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/insidem11\/uploads\/sites\/10357\/2023\/04\/21140217\/image-7-300x166.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/insidem11\/uploads\/sites\/10357\/2023\/04\/21140217\/image-7-768x425.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/insidem11\/uploads\/sites\/10357\/2023\/04\/21140217\/image-7-800x443.png 800w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/insidem11\/uploads\/sites\/10357\/2023\/04\/21140217\/image-7.png 1037w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"314\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/insidem11\/uploads\/sites\/10357\/2023\/04\/21140253\/image-8-1024x314.png\" alt=\"\" class=\"wp-image-164\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/insidem11\/uploads\/sites\/10357\/2023\/04\/21140253\/image-8-1024x314.png 1024w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/insidem11\/uploads\/sites\/10357\/2023\/04\/21140253\/image-8-300x92.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/insidem11\/uploads\/sites\/10357\/2023\/04\/21140253\/image-8-768x235.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/insidem11\/uploads\/sites\/10357\/2023\/04\/21140253\/image-8-800x245.png 800w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/insidem11\/uploads\/sites\/10357\/2023\/04\/21140253\/image-8.png 1038w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Output<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"717\" height=\"293\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/insidem11\/uploads\/sites\/10357\/2023\/04\/21140342\/image-9.png\" alt=\"\" class=\"wp-image-165\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/insidem11\/uploads\/sites\/10357\/2023\/04\/21140342\/image-9.png 717w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/insidem11\/uploads\/sites\/10357\/2023\/04\/21140342\/image-9-300x123.png 300w\" sizes=\"auto, (max-width: 717px) 100vw, 717px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">New Constructs\/Concepts<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Calculations<\/h4>\n\n\n\n<p>This program shows how we can use mathematical symbols to perform calculations within our program. This is often combined with variable assignment in order to set a variable to the result of a calculation (which could involve the use of other variables).<\/p>\n\n\n\n<p>The following mathematical symbols can be used.<\/p>\n\n\n\n<figure class=\"wp-block-table table-larger\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-center\" data-align=\"center\">Symbol<\/th><th class=\"has-text-align-center\" data-align=\"center\">Mathematical Symbol<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>+<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\">Plus<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>&#8211;<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\">Minus<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>\/<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\">Divide<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>*<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\">Multiply<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>^<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\">Exponent (to the power of)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Construct<\/th><th>Line(s)<\/th><th>Python Syntax<\/th><th>Purpose<\/th><\/tr><\/thead><tbody><tr><td>Calculations<\/td><td>11, 14, 17<\/td><td>+, -, \/, *, ^<\/td><td>To perform an addition, minus, division, multiplication, exponent<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Parson&#8217;s Problem<\/h2>\n\n\n\n<p>This program is designed to get the temperature in degrees celsius, then convert it to fahrenheit and display both temperatures.<\/p>\n\n\n\n<div class=\"h5p-content\" data-content-id=\"5\"><\/div>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-100\"><a class=\"wp-block-button__link\" href=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/insidem11\/program-2-introduce-yourself\/\">Previous: Program 2<\/a><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-100\"><a class=\"wp-block-button__link\" href=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/insidem11\/program-4-driving-age-checker\/\">Next: Program 4<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This program calculates a teenager&#8217;s pocket money on a monthly and yearly basis. It also calculates how much pocket money they will earn before they are 18. You can see the code and output below, or you can access it on repl.it by&nbsp;clicking here. Code Output New Constructs\/Concepts Calculations This program shows how we can&hellip; <a class=\"more-link\" href=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/insidem11\/program-3-pocket-money-calculator\/\">Continue reading <span class=\"screen-reader-text\">Program 3: Pocket Money Calculator<\/span><\/a><\/p>\n","protected":false},"author":73977,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-162","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/insidem11\/wp-json\/wp\/v2\/pages\/162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/insidem11\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/insidem11\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/insidem11\/wp-json\/wp\/v2\/users\/73977"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/insidem11\/wp-json\/wp\/v2\/comments?post=162"}],"version-history":[{"count":5,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/insidem11\/wp-json\/wp\/v2\/pages\/162\/revisions"}],"predecessor-version":[{"id":197,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/insidem11\/wp-json\/wp\/v2\/pages\/162\/revisions\/197"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/insidem11\/wp-json\/wp\/v2\/media?parent=162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}