Let me begin, I am a college student in a basic programming class and I honestly have a tough time learning Java. I'm here because I have a lab I'm trying to do and it's like I have a hard time filling in the blanks because our teachers don't teach us, they just say "go". So, any offering help is much obliged.
My lab link is located http://www.cse.unt.edu/~ecelikel/spr...ments/lab4.doc. It's a .doc file. I'm supposed to create two files for a jet fighter simulation and I'm a little stuck as I'm not very experience with the scanner class or with doing some methods. Yes, I've read the Sun Tutorials, I have them open, just I don't understand sometimes. It's like I'm trying to read latin. But here's what I have so far. The asterisks are my name, just choose not to display.
At "private boolean outOfFuel()" it says I'm missing a return value, and I can't figure out how to put that in. Other than that, I'm still working on it as you read this trying to add more and figuring out how to organize all of this. Thank you very much for any help at all.
My lab link is located http://www.cse.unt.edu/~ecelikel/spr...ments/lab4.doc. It's a .doc file. I'm supposed to create two files for a jet fighter simulation and I'm a little stuck as I'm not very experience with the scanner class or with doing some methods. Yes, I've read the Sun Tutorials, I have them open, just I don't understand sometimes. It's like I'm trying to read latin. But here's what I have so far. The asterisks are my name, just choose not to display.
Code:
package *****;
public class fighterJet {
double setRange=0; // number of miles flown before running out of fuel
double distanceTraveled=0; // how far jet has flown since last refuel
double xOffset=0; // how far east, west using negative numbers
double yOffset=0; // how far north, south using negative numbers
int numMisslesRemaining=0; // number of missles remaining
public fighterJet (double setRange, int setNumMissles) {
}
private boolean outOfFuel(){
if (setRange == 0) {
boolean outOfFuel = true;
System.out.println("Oh no, you ran out of fuel!");}
if (setRange != 0){
}
}
public void fly(double distanceX, double distanceY){
double x = distanceX - xOffset;
double y = distanceY - yOffset;
double current = Math.sqrt((x*x)+(y*y));
System.out.println(current);
distanceTraveled += current;
}
}
package *****;
import java.util.Scanner;
public class *****SecretMission {
public static void main(String[] args) {
// create scanner for input
Scanner input = new Scanner (System.in);
//obtain user input
System.out.println("Enter your destination coordinates");
double
}
}
Comment