deng_cen 19 Newbie Poster

hi:
you can do that like that is
package com.structure;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class TestArray {
static List<String> list = new ArrayList<String>();
// static Object[] state;
public static void main(String agrs[]) {
Scanner scan = new Scanner(System.in);
System.out.println("Please input number:");
int num = scan.nextInt();
System.out.println("Please input your String:");
for (int i = 0; i < num; i++) {
list.add((String) scan.next());
}
for (Object str : exchangeArray(list)) {
System.out.println(str);
}
}
public static Object[] exchangeArray(List list) {
return list.toArray();
}
}

deng_cen 19 Newbie Poster

hi:
you are attendion to that there is only one if in the quiz function.so the * is seven.

deng_cen 19 Newbie Poster

hi:
you can analyse this coding program
package com.applet;
public class Triangle {
/**
* @param a
* the length of a for the triangle
* @param b
* the length of b for the triangle
* @param c
* the length of c for the triangle
*/
private double a, b, c;
private double angleA, angleB, angleC, area, perimeter;
public Triangle(double a, double b, double c) {
this.a = a;
this.b = b;
this.c = c;
angleA = 0;
angleB = 0;
angleC = 0;
area = 0;
perimeter = 0;
}
public void calculateAngles() {
final double RADIANS_TO_DEGREES = 180 / Math.PI;
angleC = Math.acos((2 * c - 2 * b - 2 * a) / (-2 * a * b))
* RADIANS_TO_DEGREES;
angleB = Math.acos((2 * b - 2 * a - 2 * c) / (-2 * a * b))
* RADIANS_TO_DEGREES;
angleA = Math.acos((2 * a - 2 * c - 2 * b) / (-2 * a * b))
* RADIANS_TO_DEGREES;
}
public double calculateArea() {
double halfperimeter = calculatePerimeter() / 2;
return area = Math.sqrt(halfperimeter * (halfperimeter - a)
* (halfperimeter - b) * (halfperimeter - c));
}
public double calculatePerimeter() {
return perimeter = (a + b + c);
}
public …

iamthwee commented: ur fucking retarded -2
deng_cen 19 Newbie Poster

hi:
your writing which method of arccoseA maybe is wrong!

deng_cen 19 Newbie Poster

try this function:
package com.Thread;
public class DigProd {
public static void main(String args[]) {
long a = 123456789;
long ai = DigProdIterative(a);
System.out.println("Digital Product of a: " + ai);
long ar = Recursive(a);
System.out.println("Digital Product of a: " + ar);
}

public static long doNumRecursive(long a){
long first,y=1;
String str = String.valueOf(a);
if(str.length()==1){
return a;
}
for (int i = 0; i < str.length(); i++) {
int b = str.charAt(i);
b = b - 48; // for ascii code
if (b == 0) {
continue;
} else {
first = str.charAt(i);
first = first - 48;
y = y * first;
}
}
return y;
}

public static long Recursive(long result){
String str = String.valueOf(result);
if(str.length()==1){
System.out.print(result + "\n");
return result;
}else{
System.out.print(result + " --> ");
result=doNumRecursive(result);
str = String.valueOf(result);
if(str.length()==1){
System.out.print(result + "\n");
return result;
}else{
result = Recursive(result);
return result;
}
}
}

public static long DigProdIterative(long a) {
String str = String.valueOf(a);
int first = 1;
long y = a;
while (str.length() != 1) {
str = String.valueOf(y);
if (str.length() == 1) {
System.out.print(y + "\n");
} else {
System.out.print(y + " --> ");
}
y = …