Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Java I am your customer. I own a drone company. I need software to run my drone

ID: 3888315 • Letter: J

Question

Java

I am your customer. I own a drone company. I need software to run my drone and provide information to the users programs that will be flying the drones as well as ways to adjust the parameters of how the drone is flying. I have many different drones that I sell and it would be great if all the drones could be run with this one program. All the drones have motors and they all have the same camera. They all have a different size and they all have different weights, some have more motors than others do. They all fly on their own; you just have to tell it where to go. You can tell it to take a picture and it will. You can tell them to go to an x, y, z location and it will, with y being the height and you can think of x and z as longitude and latitude. Sometimes you only want to tell it to fly higher; this can be accomplished without changing the x and z. They all run on different batteries that have different capacities, so one drone might run twenty minutes and another might run an hour. The time that the battery has left over is automatically provided by a static method called time left in a class called Battery; it would be nice if our clients could request this value from our software if needed. The speed of the drone is 0-20 and sent in to the program from a app that will use our program, zero will just hover, and anything over that will have it move which ever direction it is facing. That’s pretty much what my drones do, can you design a piece of software to run this….and did I miss anything ?

Now design the software, no actual code, just classes, method definitions (input and output), and instance fields…..the functionality of the software without any logic. Empty methods.

Explanation / Answer

Drone Class
public class Drone
{
  
   //manufacturing parameters
   int batteryCapacity;
   int noOfMotors;
   int weight;
   boolean Camera;
  
   //operation parameters
           int x;
           int y;
           int z;
           int time;
           int speed;
          
   public void setX(int x)
   {
               this.x = x;
   }
   public void setY(int y)
   {
               this.y = y;
   }
   public void setZ(int z)
   {
               this.z = z;
   }
   public void setSpeed(int speed)
   {
               this.speed = speed;
   }
   public Drone(int batteryCapacity, int noOfMotors, int weight, boolean camera)
   {
      
       this.batteryCapacity = batteryCapacity;
       this.noOfMotors = noOfMotors;
       this.weight = weight;
       Camera = camera;
   }
   public int getBatteryCapacity() {
       return batteryCapacity;
   }
   public int getTimeLeft() {
       return time;
   }
   public int getNoOfMotors() {
       return noOfMotors;
   }
   public int getWeight() {
       return weight;
   }
   public boolean isCamera() {
       return Camera;
   }
   public void takePhoto()
   {
      
   }
  
  
}

App Class


public class App
{
   Drone connectedDrone;
  
   public App(Drone connectedDrone)
   {
      
       this.connectedDrone = connectedDrone;
   }
       int timeLeft()
           {
               return connectedDrone.getTimeLeft();
           }
           public void setX(int x)
           {
                   connectedDrone.setX(x);
           }
              
           public void setY(int y)
           {
               connectedDrone.setX(y);
           }
              
           public void setZ(int z)
           {
               connectedDrone.setX(z);
           }
           void displace(int x,int y,int z)
           {
               connectedDrone.setX(x);
               connectedDrone.setY(y);
               connectedDrone.setZ(z);
           }
           void adjustHeight(int y)
           {
               connectedDrone.setX(y);
           }
           void setSpeed(int speed)
           {
               connectedDrone.setSpeed(speed);
              
           }
           void takePhoto()
           {
               connectedDrone.takePhoto();
              
           }
          

}


Driver class (main)

public class Main {

   public static void main(String[] args)
   {

       Drone myDrone = new Drone(5000, 4, 400, true);// a drone is manufactured and purchased
       App ConnectedApp = new App(myDrone);// the user connects the drone to an app
       // the user can now call any method of the drone class from their app object

   }

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote