Results 1 to 4 of 4
Thread: Java Question.
 06062011, 07:56 AM #1Member
 Join Date
 May 2011
 Posts
 29
 Rep Power
 0
Java Question.
Is it possible to have a java program open a picture on the web? If so does it require a lot of coding? This is my program and i would like to have whatever Triangle that is identified show a picture of the Triangle from the web. It isn't necessary but if it doesn't require to much coding I'm for it.
Java Code:import java.util.*; public class FinalProjectBeta{ public static void main(String[] args) {int a=1, b, c, p; Scanner in=new Scanner(System.in); while(a!=0) {System.out.println("Enter the length of side \"a\" of the triangle to begin:"); a=in.nextInt(); if(a==0) System.exit(0); System.out.println("Enter the length of side \"b\" of the triangle:"); b=in.nextInt(); System.out.println("Enter the length of side \"c\" of the triangle:"); c=in.nextInt(); getTriType(a,b,c); getAreaPerimeter(a,b,c); } } public static void getTriType(int a, int b, int c) {if(a==0b==0c==0a<0b<0c<0) {System.out.println("According to the given sides there was one or more invalid sides of a Triangle."); System.exit(0); } else if(a==b&&a==c&&b==c) {System.out.print("According to the given sides, since a,b and c are equal "); System.out.println("the triangle is an Equilateral Triangle."); } else if(a==ba==cb==ab==cc==ac==b) {System.out.print("According to the given sides, since two sides are equal "); System.out.println("the triangle is an Isosceles Triangle."); } else {System.out.print("According to the given sides, since a,b and c are not equal "); System.out.println("the triangle is a Scalene Triangle."); } } public static double getAreaPerimeter(int a, int b, int c) {double s = 0.5 * (a + b + c); double area = Math.sqrt(s*(sa)*(sb)*(sc)); double p = a+b+c; System.out.println("The Area is "+area+" and the Perimeter is "+p+"."); System.out.println(); return area; } }
 06062011, 08:00 AM #2
What I would do is download the images (providing it is not illegal) and package them up with your code in a jar file.
 06062011, 08:12 AM #3Member
 Join Date
 May 2011
 Posts
 29
 Rep Power
 0
 06062011, 08:15 AM #4
Similar Threads

Help with Java Question
By joe98 in forum New To JavaReplies: 3Last Post: 03292011, 10:09 AM 
sorry for this question  which is best ? .NET c# or java ?
By funkygarzon in forum Forum LobbyReplies: 33Last Post: 01212011, 04:07 PM 
Need help with java question
By ccie007 in forum New To JavaReplies: 23Last Post: 05182010, 06:32 PM 
Java question
By TGH in forum New To JavaReplies: 12Last Post: 11272009, 03:05 PM 
question about java rmi
By hakimade in forum Advanced JavaReplies: 1Last Post: 07012009, 07:15 AM
Bookmarks