File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes What am I doing Wrong? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What am I doing Wrong?" Watch "What am I doing Wrong?" New topic
Author

What am I doing Wrong?

Pam Perkins
Greenhorn

Joined: Aug 08, 2003
Posts: 1
Could someone please tell what I am doing wrong with this code that is driving me so crazy?
Thanks,
Pam Perkins
public class Student
{
private String Name;
private String techID;
privateint []hw = new int[5];
privateint []lab = new int[10];
privateint [] test= new int[2];
privateint finalProject =0;
//remember to set the arrays and get the arrays
}
//----------------------------------
// Constructors
//----------------------------------
/**
* Default constructor
*/
// public Student()
// {
// }
/**
* Constructs a new Student with passed name,
* age,and gender.
*
* @param name name of the new Student
* @param age age of the new Student
* @param gender gender of the new Student
*/
public Student(String Name_, String techID_) {

Name = Name_;
techID = techID_;
}
public void setName(String Name_)
}
Name = Name_;
}
public String getName( )
{
return Name;
}
public void setTechID(String techID_)
{
techID = techID_;
}
public String getTechID( )
{
return techID;
}

public int calcHomework() {
//int totalHW = 0;
if(hw.legth > 0) {
int bestOffour = hw[0];
for(int i = 1; i < hw.length; i++) {
if (hw[i] < bestOffour)
bestOffour = hw[i];
}
return bestOffour;
}
else
return 0;
}
private int calLab() {
// find the smallest ofleast two of the the ten lab
if(laB.length > 0) {
int twoLowestLab = laB[0]; // remember the the first score
// Remember any smaller scores.
for(int i = 1; i < laB.length; i++) {
if (laB[i] < twoLowestLab)
twolowestLab = laB[i];
}
return laB;
}
else
return 0;// the array is empty
}
private int calTest() {

int sum = 0;
for (int i = 0; i <.test.length; i++)
sum += test[i];
if(test.length > 0)
return (int) test + (int) test.length;
else
return 0;
}
}
private int calGrandTotal () {
// This compute the grand total
int grandTotal = 0;
for (int i = 0; < grandTotal.length; i++)
grandTotal += (grandTotal[i] + hw[i] + test[i] + lab[i] / grandTotal);
}
private int calPercentage () {
int percentage = 0;
for (int i = 0; < grandTotal[i] + hw[i] + laB[i] / 100);

}
public String toString () {
return this toString() + "Name" + Name + "TechID" + techID + "HomeWork"+ hw + "labs"
+ lab + "test" + test;
}
}
Susilo Saja
Ranch Hand

Joined: May 27, 2003
Posts: 91
is it compile-error? if it's, what is the message?
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Originally posted by Pam Perkins:
Could someone please tell what I am doing wrong with this code that is driving me so crazy?
Thanks,
Pam Perkins

So you have an extra close bracket at the start of the class that prevents your methods from being included...


Steve
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What am I doing Wrong?