Advertisement
Dakufuren

Untitled

Sep 17th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.13 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6.  
  7. package task3;
  8.  
  9.  
  10. /**
  11.  *
  12.  * @author AlbinSkola
  13.  */
  14. public class Task3 {
  15.  
  16.    
  17.     public static void main(String[] args) {
  18.         Task3 c = new Task3();
  19.         int Volym;
  20.         int length = 10;
  21.         int width = 5;
  22.         int height = 10;
  23.        
  24.         int a = 100;
  25.         System.out.println("\nVolymen är :" + c.v(length, width, height) * c.VolumeGet(a) + "cm3");  
  26.  
  27.     }
  28.    
  29.     int v (int length, int width, int height) {
  30.  
  31.        
  32.         System.out.println("Längden är: " + length);
  33.        
  34.         System.out.println("Bredden är: " + width);
  35.        
  36.         System.out.println("Höjden är: " + height);
  37.        
  38.         int v = length * width * height;
  39.        
  40.         System.out.println("Volymen av en stack är: " + v + "cm3");
  41.        
  42.         return v;
  43.    
  44.     }
  45.    
  46.     int VolumeGet (int a) {
  47.        
  48.         System.out.print("Antalet är: " + a);
  49.  
  50.         return a;
  51.    
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement