7/13/2016

DCT1093 OOP Contoh Quiz 1

Write an algorithm (pseudo code OR flowchart) and java program to input  the radius and length of a cylinder and computes its volume using the following formulas:

area = radius * radius * 3.14159
volume = area * length




Solution ( Java Program)

import java.util.Scanner;
public class lab1q1 {
   
    public static void main(String[] args) {
       
        // TODO, add your application code
         Scanner input = new Scanner(System.in);
        System.out.println("Please enter radius and length");
        double radius = input.nextDouble();
        double length = input.nextDouble();
        double area, volume;
        area = radius * radius * 3.14159;
        volume = area * length;
        System.out.println("Volume =");
        System.out.println(volume);
    }
}



No comments:

Cara download Installer windows 10 dalam format ISO

1. Jika anda bercadang untuk download windows 10 melalui website rasmi windows - pilihan untuk download dalam format ISO tidak di berikan.  ...