Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 This isnt really help, just funny ;)
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
copthesaint




PostPosted: Tue Dec 15, 2009 2:17 pm   Post subject: This isnt really help, just funny ;)

This is a very simple class, but the results from typing 11, 22 , 44, or 111 for example are quite amuseing :p.
Running it a couple of time you will soon ask you self, Wtf? :p, I know why it does do it, I just find it amusing lol.
damm precision crap!

Java:
import java.util.Scanner;
    public class Ch04Ex02 {
       public static void main (String [] args) {
         Scanner input = new Scanner (System.in);
         double cost = 0.75 + 1.00;
         System.out.println ("Enter the diameter of the pizza in inches: ");
         double diameter = input.nextDouble();
         cost = cost + (0.05* (diameter * diameter));
         System.out.println ("The cost of making the pizza is: $"+ cost);
         input.close();     
      }
   }
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: