วันอาทิตย์ที่ 6 กันยายน พ.ศ. 2558

WEEK2
PROJECT 3-2
Write a program that takes the radius of a sphere (a double) as input and outputs the sphere’s diameter, circumference, surface area, and volume.
ANS.
/*
   COMPLETE SCHOOL NAME: BURAPHA UNIVERSITY
           COURSE TITLE: JAVA PROGRAMMING
            COURSE CODE: 958307
*/
package radius;

/**
*  STUDENT NAME: SUKANDA INSUK
* STUDENT NICKNAME: PIM
* STUDENT NUMBER: 56110029
* COURSE: BIS
* SUBJECT: JAVA PROGRAMMING
* INSTRUCTOR: JOSE SUZUKI SANTOS
* DATE CREATED: 1/9/2015
*/

import java.util.Scanner;

public class Radius {

   /**
    * LESSON NAME: Radius
    */
   public static void main(String[] args) {
   Scanner reader = new Scanner(System.in);
   double radius;
   double diameter;
   double circumference;
   double surfacearea;
   
   //Request the inputs
   System.out.print("Enter the radius of a sphere : ");
   radius = reader.nextDouble();
   
   //Computer
   diameter = 2 * radius;
   circumference = 2 * (3.14 * radius);
   surfacearea = 3.14 * (radius * radius);
   

   //Display
   System.out.println("The sphere’s diameter " + diameter);
   System.out.println("The sphere’s circumference " + circumference);
   System.out.println("The sphere’s surface area " + surfacearea);
                       
   }
   
}

= When you input number the radius of a sphereas, it will calculator outputs the sphere’s diameter, circumference and surface area.
+++++++++++++++++++++++++++++++++++++++++++
PROJECT 3-4
An employee’s total weekly pay equals the hourly wage multiplied by the total number of regular hours plus any overtime pay. Overtime pay equals the total overtime hours multiplied by 1.5 times the hourly wage. Write a program that takes as inputs the hourly wage, total regular hours, and total overtime hours and displays an employee’s total weekly pay.
ANS
/*
   COMPLETE SCHOOL NAME: BURAPHA UNIVERSITY
           COURSE TITLE: JAVA PROGRAMMING
            COURSE CODE: 958307
*/
package hourlywage;

/**
*  STUDENT NAME: SUKANDA INSUK
* STUDENT NICKNAME: PIM
* STUDENT NUMBER: 56110029
* COURSE: BIS
* SUBJECT: JAVA PROGRAMMING
* INSTRUCTOR: JOSE SUZUKI SANTOS
* DATE CREATED: 1/9/2015
*/

import java.util.Scanner;

public class Hourlywage {

   /**
    * LESSON NAME: Hourly wage
    */
   public static void main(String[] args) {
   Scanner reader = new Scanner(System.in);
   double hourlywage;
   double trh;
   double toh;
   double totalweeklypay;
   
   //Request the inputs
   System.out.print("Enter the hourly wage : ");
   hourlywage = reader.nextDouble();
   
   System.out.print("Enter the total regular hours : ");
   trh = reader.nextDouble();
   
   System.out.print("Enter the total overtime hours : ");
   toh = reader.nextDouble();
   
   //Computer
   totalweeklypay = (hourlywage * trh) + (toh * 1.5);

   //Display
   System.out.println("An employee’s total weekly pay  " + totalweeklypay);
   
   }
   
}

= When you input number hourly wage, total regular hours, and  total overtime hours, it will calculator outputs the employee’s total weekly pay.

วันเสาร์ที่ 29 สิงหาคม พ.ศ. 2558

Project2-1, 2-4 and 2-5


Sukanda Insuk (56110029) PIM
PROJECTS
PROJECT 2-1
Write a program that displays your name, address, and telephone number.
/* * Project: 2-1 * Course Code: 958307 * Subject: JAVA Pragramming */ package project2.pkg1.pim56110029; /** * Name: Sukanda Insuk * Nickname: Pim * Instructor: Jose Suzuki Santos */ public class Project21Pim56110029 { public static void main(String[] args) { System.out.println(" NAME: Sukanda Insuk"); System.out.println(" ADDRESS: Chonburi, Thailand"); System.out.println("TELEPHONE NUMBER: 098-8788888"); } }
PROJECT 2-4
Write a program that calculates and prints the number of minutes in a year.
/* * Project: 2-1 * Course Code: 958307 * Subject: JAVA Pragramming */ package project2.pkg4.pim56110029; /** * Name: Sukanda Insuk * Nickname: Pim * Instructor: Jose Suzuki Santos */ import java.util.Scanner; public class Project24PIM56110029 { public static void main(String[] args) { Scanner reader = new Scanner(System.in); double minutes; double year; System.out.print("Enter number of minutes: "); minutes = reader.nextDouble(); year = (minutes*24)*365; System.out.print("Minutes in a year: "); System.out.println(year); } }



PROJECT 2-5
An object’s momentum is its mass multiplied by its velocity. Write a program that expects an object’s mass (in kilograms) and velocity (in meters per second) as inputs and prints its momentum.
/* * Project: 2-1 * Course Code: 958307 * Subject: JAVA Pragramming */ package project2.pkg5.pim56110029; /** * Name: Sukanda Insuk * Nickname: Pim * Instructor: Jose Suzuki Santos */ import java.util.Scanner; public class Project25PIM56110029 { public static void main(String[] args) { Scanner reader = new Scanner(System.in); double mass; double velocity; double momentum; System.out.print("Enter number of mass: "); mass = reader.nextDouble(); System.out.print("Enter number of velocity: "); velocity = reader.nextDouble(); momentum = mass*velocity; System.out.print("Momentum is: "); System.out.println(momentum); } }

วันจันทร์ที่ 17 สิงหาคม พ.ศ. 2558

      Hello!!! My name is Sukanda Insuk but you can call me Pim. I'm study at Burapha University International College. My major is Business Information System(BIS). My ID is 56110029. I study major BIS because I want to learned about program computer. I like mountain because it feel good for look on the mountain.