Hey everyone,
I'm new to the programming world and I'm currently taking my first java programming course. I have to do an assignment which requires me adjust the altitude of two different balloons in a tester class. So far I believe I've done everything according to the professors instructions, but I'm stuck near the end. The question asks to "make the object you created in step 2 descend to the same altitude as the other object." He wants us to do this without just calculating the altitude ourselves and setting it as an int. I have no idea what to do here! Please help! My code so far looks like this:
public class BalloonTester {
public static void main(String[] args)
{
Balloon balloon = new Balloon("Balloon", 100);
Balloon balloon2 = new Balloon ("Balloon2",-100);
int Altitude ;
String Name ;
Name = balloon.getName() ;
Altitude = balloon.getAltitude() ;
System.out.println(Name);
System.out.println(Altitude);
Name = balloon2.getName() ;
Altitude = balloon2.getAltitude();
System.out.println(Name);
System.out.println(Altitude);
balloon.ascendTo(250) ;
balloon2.adjustAltitude(+200) ;
Name = balloon.getName() ;
Altitude = balloon.getAltitude() ;
System.out.println(Name);
System.out.println(Altitude);
Name = balloon2.getName() ;
Altitude = balloon2.getAltitude();
System.out.println(Name);
System.out.println(Altitude);
balloon.adjustAltitude(-100);
--- Update ---
the next line would be the step that he's asking us to complete. I feel its fairly simple, I just for the life of me can't figure it out.