{"id":738,"date":"2013-06-13T12:18:49","date_gmt":"2013-06-13T05:18:49","guid":{"rendered":"http:\/\/blog.kusumoto.co\/?p=738"},"modified":"2013-06-13T12:18:49","modified_gmt":"2013-06-13T05:18:49","slug":"lab-java-day-2","status":"publish","type":"post","link":"https:\/\/oldblog.kusumotolab.com\/?p=738","title":{"rendered":"Lab Java day 2"},"content":{"rendered":"<pre lang=\"java\">\r\nimport java.util.Scanner;\r\npublic class Test1 {\r\n\tpublic static void main(String[] args) {\r\n\t\t\/\/announce variable\r\n\t\tString name;\r\n\t\tint date;\r\n\t\tString month;\r\n\t\tint year;\r\n\t\t\/\/input data\r\n\t\tSystem.out.print(\"Enter name : \");\r\n\t\tScanner name1 = new Scanner (System.in);\r\n\t\tname = name1.nextLine();\r\n\t\tSystem.out.print(\"Enter Birthday Date : \");\r\n\t\tScanner date1 = new Scanner (System.in);\r\n\t\tdate = date1.nextInt();\r\n\t\tSystem.out.print(\"Enter Birthdat Month : \");\r\n\t\tScanner month1 = new Scanner (System.in);\r\n\t\tmonth = month1.nextLine();\r\n\t\tSystem.out.print(\"Enter Birhday Year : \");\r\n\t\tScanner year1 = new Scanner (System.in);\r\n\t\tyear = year1.nextInt();\r\n\t\t\/\/show data\r\n\t\tSystem.out.println(\"My Name is \"+name);\r\n\t\tSystem.out.println(\"My Birthday is \"+date+\" \"+month+\" \"+year);\r\n\t\t \r\n\r\n\t}\r\n}\r\n<\/pre>\n<pre lang=\"java\">\r\nimport java.util.Scanner;\r\n\/\/Prepare Java by Kusumoto\r\npublic class Test2 {\r\n\tpublic static void main(String[] args) {\r\n\t\t\/\/announce variable\r\n\t\tint id;\r\n\t\tString name;\r\n\t\tint term1,term2,term3,term4;\r\n\t\tdouble score2,score3;\r\n\t\tfloat score4;\r\n\t\t\/\/setup input data\r\n\t\tScanner id1 = new Scanner (System.in);\r\n\t\tScanner name1 = new Scanner (System.in);\r\n\t\tScanner term1_1 = new Scanner (System.in);\r\n\t\tScanner term2_1 = new Scanner (System.in);\r\n\t\tScanner term3_1 = new Scanner (System.in);\r\n\t\t\/\/input data\r\n\t\tSystem.out.print(\"Enter ID : \");\r\n\t\tid = id1.nextInt();\r\n\t\tSystem.out.print(\"Enter Name : \");\r\n\t\tname = name1.nextLine();\r\n\t\tSystem.out.print(\"Enter Score (term1) : \");\r\n\t\tterm1 = term1_1.nextInt();\r\n\t\tSystem.out.print(\"Enter Score (term2) : \");\r\n\t\tterm2 = term2_1.nextInt();\r\n\t\tSystem.out.print(\"Enter Score (term3) : \");\r\n\t\tterm3 = term3_1.nextInt();\r\n\t\tSystem.out.println(\"-------------------------------------\");\r\n\t\t\/\/process data\r\n\t\tterm4 = (term1+term2+term3)\/3;\r\n\t\tscore2 = term4;\r\n\t\tscore3 = (term1+term2+term3)\/(double)3;\r\n\t\tscore4 = (term1+term2+term3)\/(float)3;\r\n\t\tSystem.out.println(\"My ID is \"+id);\r\n\t\tSystem.out.println(\"My name is \"+name);\r\n\t\tSystem.out.println(\"My Total Score is \"+(term1+term2+term3)+\" point\");\r\n\t\tSystem.out.println(\"My Average Score(int) is \"+term4+\" point\");\r\n\t\tSystem.out.println(\"My Average Score(int)to(double) is \"+score2+\" point\");\r\n\t\tSystem.out.println(\"My Average Score(double) is \"+score3+\" point\");\r\n\t\tSystem.out.println(\"My Average Score(float) is \"+score4+\" point\");\r\n\t\t\/\/end\r\n\t\t\r\n\t}\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>import java.util.Scanner; public class Test1 { public static void main(String[] args) { \/\/announce variable String name; int date; String month; int year; \/\/input data System.out.print(&#8220;Enter name : &#8220;); Scanner name1 = new Scanner (System.in); name = name1.nextLine(); System.out.print(&#8220;Enter Birthday Date : &#8220;); Scanner date1 = new Scanner (System.in); date = date1.nextInt(); System.out.print(&#8220;Enter Birthdat Month : [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":[]},"categories":[59,9],"tags":[],"class_list":["post-738","post","type-post","status-publish","format-standard","hentry","category-java","category-private"],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3OMEb-bU","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/posts\/738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=738"}],"version-history":[{"count":2,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/posts\/738\/revisions"}],"predecessor-version":[{"id":740,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/posts\/738\/revisions\/740"}],"wp:attachment":[{"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}