Discussion:
need hlp
(too old to reply)
1***@sicsr.ac.in
2015-03-09 12:22:46 UTC
Permalink
class total
{
int a;
int b;
int c;
int d;
int e;
}
public class demo{
public static void main (Sring args[])
{
int sum;
}
total b1 = new total();
b1.a = S[0];
b1.b = S[1];
b1.c = S[2];
b1.d = S[3];
b1.e = S[4];
x = a+b+c+d+e;
b1.a = integer parseInt (a);
b2.b = integer parseInt (b);
b3.c = integer parseInt (c);
b4.d = integer parseInt (d);
b5.e = integer parseInt (e);
System.out.println(x);
}
--
*This email is governed by the Disclaimer Terms of SIU which may be viewed
at* http://www.siu.edu.in/downloads/email-disclaimer.php
Eric Sosman
2015-03-09 13:44:14 UTC
Permalink
Post by 1***@sicsr.ac.in
class total
{
int a;
int b;
int c;
int d;
int e;
}
public class demo{
public static void main (Sring args[])
{
int sum;
}
total b1 = new total();
b1.a = S[0];
b1.b = S[1];
b1.c = S[2];
b1.d = S[3];
b1.e = S[4];
x = a+b+c+d+e;
b1.a = integer parseInt (a);
b2.b = integer parseInt (b);
b3.c = integer parseInt (c);
b4.d = integer parseInt (d);
b5.e = integer parseInt (e);
System.out.println(x);
}
What is your question? What "hlp" do you need? All I
see here is a bunch of Java-like-but-not-Java garble, with
no description of what you want it to do. I'm a programmer,
not a mind reader.
--
***@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM
Jeff Higgins
2015-03-09 15:12:01 UTC
Permalink
Post by 1***@sicsr.ac.in
class total
{
int a;
int b;
int c;
int d;
int e;
}
public class demo{
public static void main (Sring args[])
{
int sum;
}
total b1 = new total();
b1.a = S[0];
b1.b = S[1];
b1.c = S[2];
b1.d = S[3];
b1.e = S[4];
x = a+b+c+d+e;
b1.a = integer parseInt (a);
b2.b = integer parseInt (b);
b3.c = integer parseInt (c);
b4.d = integer parseInt (d);
b5.e = integer parseInt (e);
System.out.println(x);
}
package scratch;

import java.util.Random;

public class Total {

private int a, b, c, d, e;
private static Random rnd = new Random();

/**
* Constructs a Total instance with random instance variables.
*/
public Total() {

}

/**
* Parses a String array to initialize the Total instance variables.
*
* @param S
* an array of Strings representing five integers.
*/
public Total(String[] S) {

}

/**
* Sums this Total instance variables.
*
* @return the sum of this Total's instance variables.
*/
public int sum() {
int x = a + b + c + d + e;
return x;
}
}

******************************************************

package scratch;

public class TotalDemo {

public static void main(String[] args) {
System.out.println(new Total(args).sum());
}

}
Lew
2015-03-14 05:41:21 UTC
Permalink
Read the Java Tutorials for the basic rules of the language. Statements belong inside methods, and a standalone declaration inside 'main()' doesn't help anything. Try a simpler example until you get used to it.
Loading...