{"id":834,"date":"2013-07-23T12:37:40","date_gmt":"2013-07-23T05:37:40","guid":{"rendered":"http:\/\/blog.kusumoto.co\/?p=834"},"modified":"2013-07-23T12:37:40","modified_gmt":"2013-07-23T05:37:40","slug":"lab-java-23072556","status":"publish","type":"post","link":"https:\/\/oldblog.kusumotolab.com\/?p=834","title":{"rendered":"Lab Java 23\/07\/2556"},"content":{"rendered":"<h1>Array lab1<\/h1>\n<pre lang=\"java\">\r\npublic class LabArray_1 {\r\n\r\n    public static void main(String[] args) {\r\n        int[] number = {10,20,30,40,50};\r\n        double sum=0;\r\n            for (int i=0;i<=4;i++) {\r\n                System.out.println(\"Score No:\"+(i+1)+\" >>>>\"+number[i]);\r\n                sum = sum+number[i];\r\n            }\r\n            System.out.println(\"Sum is \"+sum);\r\n    }\r\n}\r\n<\/pre>\n<p><\/br><\/p>\n<h1>Array lab2<\/h1>\n<pre lang=\"java\">\r\nimport java.util.Scanner;\r\n\r\npublic class Lab2 {\r\n\r\n    public static void main(String[] args) {\r\n   \r\n        int a,c=0;\r\n        Scanner a1 = new Scanner (System.in);\r\n        Scanner b1 = new Scanner (System.in);\r\n        System.out.print(\"Enter Number : \");\r\n        a = a1.nextInt();\r\n        int[] b = new int [a];\r\n        for (int i=1;i<=a;i++) {\r\n            System.out.print(\"Score No:\"+i+\">>>>> \");\r\n            b[i-1] = b1.nextInt();\r\n            c = c+b[i-1];\r\n        }\r\n        System.out.println(\"Sum is : \"+c);\r\n     }\r\n  }\r\n<\/pre>\n<h1>Array lab3<\/h1>\n<pre lang=\"java\">\r\npackage lab3;\r\nimport java.util.Scanner;\r\n\r\n\/**\r\n *\r\n * @author kusumoto\r\n *\/\r\npublic class Lab3 {\r\n\r\n    \/**\r\n     * @param args the command line arguments\r\n     *\/\r\n    public static void main(String[] args) {\r\n        int a,odd=0,even=0;\r\n        Scanner a1 = new Scanner (System.in);\r\n        Scanner b1 = new Scanner (System.in);\r\n        System.out.print(\"Enter Line : \");\r\n        a = a1.nextInt();\r\n        int []c = new int [a];\r\n        for (int i=1;i<=a;i++) {\r\n            System.out.print(\"Enter Number [\"+i+\"] :\");\r\n            c[i-1] = b1.nextInt();\r\n            if (c[i-1]%2==0) {\r\n                odd=odd+c[i-1];\r\n            } else {\r\n                even=even+c[i-1];\r\n            }\r\n        }\r\n        System.out.println(\"odd = \"+odd+\"     event = \"+even);\r\n    }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Array lab1 public class LabArray_1 { public static void main(String[] args) { int[] number = {10,20,30,40,50}; double sum=0; for (int i=0;i<\/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":[54,59,9],"tags":[],"class_list":["post-834","post","type-post","status-publish","format-standard","hentry","category-homework","category-java","category-private"],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3OMEb-ds","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/posts\/834","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=834"}],"version-history":[{"count":2,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/posts\/834\/revisions"}],"predecessor-version":[{"id":836,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/posts\/834\/revisions\/836"}],"wp:attachment":[{"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}