Post: Java helper
03-30-2011, 02:47 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); I have this lab assignment that i totally don't understand for my java class. If someone is willing to help me understand it ill pay them for there services.

lab
Originally posted by another user
Lab10a: Write program Lab10a.java which prints the following four triangle patterns with four different user defined methods. Test your program by calling each of these four methods from the main method. Use different parameter values to test your methods. Assume the parameter of each method is an integer >= 5 and <= 25.
NOTE: Each of your methods is required to use two nested while loops to print its triangle pattern. Write your user defined methods in the same class as your main method and before your main method.
firstPattern(5);
*
**
***
****
*****
secondPattern(5);
*****
****
***
**
*
thirdPattern(5);
*
**
***
****
*****
fourthPattern(5);
*****
****
***
**
*
call to secondPattern with parameter 5 produces this right triangle with height 5 and base 5
call to thirdPattern with parameter 5 produces this right triangle
with height 5 and base 5
call to fourthPattern with parameter 5 produces this right triangle
with height 5 and base 5
call to firstPattern with parameter 5 produces this right triangle
with height 5 and base 5
firstPattern(8 );
*
**
***
****
*****
******
*******
********
secondPattern(8 );
********
*******
******
*****
****
***
**
*
thirdPattern(8 );
*
**
***
****
*****
******
*******
********
fourthPattern(8 );
********
*******
******
*****
****
***
**
*
Lab10b: Write program Lab10b.java which computes the following characteristics of a right triangle with five different user defined methods:
● area(int side1, int side2); // side1 and side2 form a 90 degree angle
● hypothenuse(int side1, int side2); // side opposite to the 90 degree angle
● perimeter(int side 1, int side 2);
● angle1(int side1, int side2); // angle adjacent to side1
● angle2(int side1, int side2); // angle adjacent to side2
call to firstPattern with parameter 8 produces this right triangle
with height 8 and base 8
call to secondPattern with parameter 8 produces this right triangle
with height 8 and base 8
call to thirdPattern with parameter 8 produces this right triangle
with height 8 and base 8
call to fourthPattern with parameter 8 produces this right triangle
with height 8 and base 8
Test your program by calling each of these five methods from the main method. Use different parameter values to test your methods. For example:
// The following are the characteristics of a right triangle
// with side1=3 and side2=4
System.out.println(“The area of a right triangle with sides 3 and 4 is ” + area(3,4));
The area of a right triangle with sides 3 and 4 is 6
System.out.println(“The hypothenuse of a right triangle with sides 3 and 4 is ” + hypothenuse(3,4));
The hypothenuse of a right triangle with sides 3 and 4 is 5
System.out.println(“The perimeter of a right triangle with sides 3 and 4 is ” + perimeter(3,4));
The perimeter of a right triangle with sides 3 and 4 is 12
System.out.println(“The angles of a right triangle with sides 3 and 4 are: ” + angle1(3,4) + “ ” + angle2(3,4) + 90);
The angles of a right triangle with sides 3 and 4 are: 36.87 53.13 90
// The following are the characteristics of a right triangle
// with side1=5 and side2=5
System.out.println(“The area of a right triangle with sides 5 and 5 is ” + area(5,5));
The area of a right triangle with sides 5 and 5 is 12.5
System.out.println(“The hypothenuse of a right triangle with sides 5 and 5 is ” + hypothenuse(5,5));
The hypothenuse of a right triangle with sides 5 and 5 is 7.07
System.out.println(“The perimeter of a right triangle with sides 5 and 5 is ” + perimeter(5,5));
The perimeter of a right triangle with sides 5 and 5 is 17.07
System.out.println(“The angles of a right triangle with sides 5 and 5 are: ” + angle1(5,5) + “ ” + angle2(5,5) + 90);
The angles of a right triangle with sides 5 and 5 are: 45 45 90


this will be closed next Tuesday
also it has to be nested while loops only, not any other loops

edit
$10 bucks if i can get help by the end of the day Thursday and $5 after
$15 if some1 does it and explains it by Tuesday.
I get paid Thursday around 1pm mt time and can get the money in your paypal as soon as i get home.
(adsbygoogle = window.adsbygoogle || []).push({});
03-30-2011, 08:35 PM #2
BUMP
does anyone get it

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo