{"id":56,"date":"2003-10-31T12:00:00","date_gmt":"2003-10-31T12:00:00","guid":{"rendered":"https:\/\/eric.tedjamulia.com\/blog\/java-arithmetic-practice\/"},"modified":"2003-10-31T12:00:00","modified_gmt":"2003-10-31T12:00:00","slug":"java-arithmetic-practice","status":"publish","type":"post","link":"https:\/\/eric.tedjamulia.com\/blog\/java-arithmetic-practice\/","title":{"rendered":"My arithmetic practice applet"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I made a little Java project for practicing arithmetic. The computer asks the question, checks the answer, and keeps track of the score. It is a lot more interesting to program the practice than to do a whole page of it myself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The calculation class keeps the two numbers, the computer&#8217;s answer, the user&#8217;s answer, and the score together. There are methods for addition, subtraction, and multiplication, with Swing dialog boxes supplying the interaction. It is a small exercise in getting input out of a string and comparing it to the result the program calculated.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I am still getting used to splitting a program into classes instead of putting every step in one long method. This is a nice size for that: the arithmetic is simple enough that I can spend more time thinking about where the state and methods should go.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/etedj.com\/projects\/java\/Applets\/CAI\/\">CAI files<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I made a little Java project for practicing arithmetic. The computer asks the question, checks the answer, and keeps track of the score. It is a lot more interesting to program the practice than to do a whole page of it myself. The calculation class keeps the two numbers, the computer&#8217;s answer, the user&#8217;s answer, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42],"tags":[45,43,44],"class_list":["post-56","post","type-post","status-publish","format-standard","hentry","category-java-applets","tag-high-school","tag-java","tag-swing"],"_links":{"self":[{"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/posts\/56","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/comments?post=56"}],"version-history":[{"count":0,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/posts\/56\/revisions"}],"wp:attachment":[{"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/media?parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/categories?post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/tags?post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}