How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Simit Your Own Question

Simit
Simit, Programming Tutor
Category: Programming
Satisfied Customers: 5743
Experience:  I have my Bachelor in Computer Engineering. I took many programming classes in college.
Type Your Programming Question Here...
Simit is online now
A new question is answered every 9 seconds

The sum of the lengths of any two sides of a triangle must

Resolved Question:

The sum of the lengths of any two sides of a triangle must be greater than the length of the third side. For example, the numbers 3, 4, and 5 can form a triangle because 3+4 > 5, 4+5 > 3, and 5+3 > 4. In contrast, the numbers 1, 2, and 5 cannot form a triangle because 1+2 < 5. Thus, if you are given any three integers, you can determine whether they could possibly form a triangle or not by applying this general principle
Submitted: 4 years ago.
Category: Programming
Expert:  Simit replied 4 years ago.
What language do you need this in?

Customer: replied 4 years ago.
Java
Expert:  Simit replied 4 years ago.
Here you go. Let me know if you need help with it:


import java.util.Scanner;


class Echo{
   public static void main (String [] args) throws java.io.IOException   {
          Scanner console = new Scanner(System.in);
          Integer s1;
          Integer s2;
          Integer s3;
          System.out.print("Enter the length of the first side of the triangle: ");
          s1 = Integer.parseInt(console.next());
          
          System.out.print("Enter the length of the second side of the triangle: ");
          s2 = Integer.parseInt(console.next());
          
          System.out.print("Enter the length of the third side of the triangle: ");
          s3 = Integer.parseInt(console.next());

          if (s1 + s2 <= s3){
               System.out.print("These 3 integers cannot form a triangle");
          }
          
          else if (s1 + s3 <= s2){
               System.out.print("These 3 integers cannot form a triangle");
          }
          
          else if (s2 + s3 <= s1){
               System.out.print("These 3 integers cannot form a triangle");
          }
          
          else
               System.out.print("These 3 integers would form a triangle");
       
    }
}
Simit, Programming Tutor
Category: Programming
Satisfied Customers: 5743
Experience: I have my Bachelor in Computer Engineering. I took many programming classes in college.
Simit and 7 other Programming Specialists are ready to help you
Customer: replied 4 years ago.

Programming Assignment 2 i for got the second part and yes i will pay more

The sum of the lengths of any two sides of a triangle must be greater than the length of the third side. For example, the numbers 3, 4, and 5 can form a triangle because 3+4 > 5, 4+5 > 3, and 5+3 > 4. In contrast, the numbers 1, 2, and 5 cannot form a triangle because 1+2 < 5. Thus, if you are given any three integers, you can determine whether they could possibly form a triangle or not by applying this general principle.

Write a JavaScript program that allows a user to input three integers using text boxes in a form. (Hint: You need to use the built-in parseInt function to convert the input strings to integers.) Test the three integers to determine if they can be formed into a triangle using the rule given above. Also test if the resulting triangle would be a right triangle using the Pythagorean theorem, namely that the square of the hypotenuse (the longest side) equals the sum of squares of the other two sides. Display an alert box to inform the user whether their integers can form a triangle or a right triangle (tell them which), or if the integers cannot form a triangle. Continue accepting sets of three integers and testing them until the user decides to quit.

Expert:  Simit replied 4 years ago.
So is this an html form?

Customer: replied 4 years ago.
JavaScript
Expert:  Simit replied 4 years ago.
So you need a web page that takes the 3 inputs, and javascript which does the calculation, right?

Customer: replied 4 years ago.
yes
Customer: replied 4 years ago.

The firt part of the progarm was good i just need it to out put a triangle whe the answer

is correct.

Expert:  Simit replied 4 years ago.
Here's the code for the javascript:

<html>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function solvept(form) {
a = parseInt(form.a.value);
b = parseInt(form.b.value);
c = parseInt(form.c.value);

if (a + b <= c){
     alert("These 3 integers cannot form a triangle");
}
          
else if (a + c <= b){
     alert("These 3 integers cannot form a triangle");
}
          
else if (b + c <= a){
     alert("These 3 integers cannot form a triangle");
}
          
else if ((a*a) + (b*b) - (c*c) == 0 || (a*a) + (c*c) - (b*b) == 0) || (b*b) + (c*c) - (a*a) == 0){
     alert("These 3 integers would form a right triangle");
}

else
     alert("These 3 integers would form a triangle, but not a right triangle");
}
// End -->
</script>

<body>

<form>
<center>

<input type=text name=a size=3><br>
<input type=text name=b size=3><br>
<input type=text name=c size=3><br>
<p>
<input type=button value="Solve" onClick="solvept(this.form)">
</form>
</body>
</html>
Simit, Programming Tutor
Category: Programming
Satisfied Customers: 5743
Experience: I have my Bachelor in Computer Engineering. I took many programming classes in college.
Simit and 7 other Programming Specialists are ready to help you
Expert:  Simit replied 4 years ago.
Also, what do you mean you need to output a triangle?
Is this in the first assignment?

Please provide some detail on what that should look like.

Customer: replied 4 years ago.

thank you thats it i have two more programs

here is one more

 

 

Programming Assignment 4

Create an html document that includes a JavaScript program that creates a new constructor function named Automobile in the document head. Include at least five properties in the object definition, such as make, model, color, engine, seats, and so forth. Then assign the values of your car to each of the Automobile properties. Print the properties to the screen. i will pay $20.00 for help on this one

Expert:  Simit replied 4 years ago.
I'm sorry. I just don't have much experience with javascript to do anything beyond something similar to the last one. I really don't know how to do this one.

Also, I'm not sure if you forgot, but you never paid for the first program, only the second.
Customer: replied 4 years ago.

yes i did pay for the first one Thanks

 

if you make one just like the last one thats fine html

Customer: replied 4 years ago.

I have 0 Balance in my account i will load it tommorrow

 

and pay you

 

 

But the program dose not output an answer

and you were right the program can be html but have some javascript in the program

saved as an . html

you dont have to sumit the program until i pay tomorrow

 

Write a JavaScript program that allows a user to input three integers using text boxes in a form. (Hint: You need to use the built-in parseInt function to convert the input strings to integers.) Test the three integers to determine if they can be formed into a triangle using the rule given above. Also test if the resulting triangle would be a right triangle using the Pythagorean theorem, namely that the square of the hypotenuse (the longest side) equals the sum of squares of the other two sides. Display an alert box to inform the user whether their integers can form a triangle or a right triangle (tell them which), or if the integers cannot form a triangle. Continue accepting sets of three integers and testing them until the user decides to quit.

 

 

Expert:  Simit replied 4 years ago.
Sorry about that. It looks like an extra ')' got in there somehow. Here's the revised code:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function solvepy(form) {
a = parseInt(form.a.value);
b = parseInt(form.b.value);
c = parseInt(form.c.value);

if (a + b <= c){
     alert("These 3 integers cannot form a triangle");
}
          
else if (a + c <= b){
     alert("These 3 integers cannot form a triangle");
}
          
else if (b + c <= a){
     alert("These 3 integers cannot form a triangle");
}
          
else if ((a*a) + (b*b) - (c*c) == 0 || (a*a) + (c*c) - (b*b) == 0 || (b*b) + (c*c) - (a*a) == 0){
     alert("These 3 integers would form a right triangle");
}

else
     alert("These 3 integers would form a triangle, but not a right triangle");
}
// End -->
</script>


<form>
<center>

<input type=text name=a size=3><br>
<input type=text name=b size=3><br>
<input type=text name=c size=3><br>
<p>
<input type=button value="Solve" onClick="solvepy(this.form)">
</form>
Simit, Programming Tutor
Category: Programming
Satisfied Customers: 5743
Experience: I have my Bachelor in Computer Engineering. I took many programming classes in college.
Simit and 7 other Programming Specialists are ready to help you
Customer: replied 4 years ago.

Thanks it work I will pay you tomorrow

 

Embarassed

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
< Last | Next >
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
 
 
 

Meet The Experts:

 
 
 
  • ATLPROG's Avatar

    ATLPROG

    Computer Software Engineer

    Satisfied Customers:

    7463
    MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
< Last | Next >
  • http://ww2.justanswer.com/uploads/SP/spatlanta2010/2011-6-23_12450_photo.64x64.gif ATLPROG's Avatar

    ATLPROG

    Computer Software Engineer

    Satisfied Customers:

    7463
    MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Computer Software Engineer

    Satisfied Customers:

    5603
    Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.
  • http://ww2.justanswer.com/uploads/unvadim/2010-11-15_210218_avatar.jpg unvadim's Avatar

    unvadim

    Computer Software Engineer

    Satisfied Customers:

    1158
    Good knowledge of OOP principles. 3+ years of programming experience with Java and C++. Sun Certified Java Programmer 5.0.
  • http://ww2.justanswer.com/uploads/lifesaver333/2010-10-17_191349_ls.jpeg lifesaver's Avatar

    lifesaver

    Computer Software Engineer

    Satisfied Customers:

    950
    Several years of intensive programming and application development experience in various platforms.
  • http://ww2.justanswer.com/uploads/EH/ehabtutor/2012-8-2_202016_1.64x64.jpg ehabtutor's Avatar

    ehabtutor

    Computer Software Engineer

    Satisfied Customers:

    864
    Bachelor of computer science, 5+ years experience in software development, software company owner
  • http://ww2.justanswer.com/uploads/RA/rajivsharma086/2012-6-6_17128_displaypic.64x64.jpg Raj's Avatar

    Raj

    Computer Engg.

    Satisfied Customers:

    860
    BE CS, 4+ Experience in Programming and Database (ERP)
  • http://ww2.justanswer.com/uploads/eljonis/2010-01-06_130406_eljon2.jpg Eljon's Avatar

    Eljon

    Consultant

    Satisfied Customers:

    590
    11 yrs of programming (PHP, WordPress, XSL, SQL, JavaScript)