Question: the java program if I have the settings: how I can finish the following requirements? public CameraBattery (double batteryStartingCharge, double batteryCapacity) Constructs a new camera

the java program

if I have the settings:

how I can finish the following requirements?

the java program if I have the settings: how I can finish

the following requirements? public CameraBattery (double batteryStartingCharge, double batteryCapacity) Constructs a new

public CameraBattery (double batteryStartingCharge, double batteryCapacity) Constructs a new camera battery simulation. The battery should start disconnected from both the camera and the external charger. The starting battery charge and maximum charge capacity are given. If the starting charge exceeds the batteries capacity, the batteries charge is set to its capacity. The external charger starts at setting 0 . There are the following public methods: public void buttonPress () Indicates the user has pressed the setting button one time on the external charger. The charge setting increments by one or if already at the maximum setting wraps around to setting 0 . public double cameraCharge (double minutes) Charges the battery connected to the camera (assuming it is connected) for a given number of minutes. The amount of charging in milliamp-hours (mAh) is the number minutes times the CHARGE_RATE constant. However, charging cannot exceed the capacity of the battery connected to the camera, or no charging if the battery is not connected. The method returns the actual amount the battery has been charged. public double drain (double minutes) Drains the battery connected to the camera (assuming it is connected) for a given number of minutes. The amount of drain in milliamp-hours (mAh) is the number of minutes times the cameras power consumption. However, the amount cannot exceed the amount of charge contained in the battery assuming it is connected to the camera, or no amount drain if the battery is not connected. The method returns the actual amount drain from the battery. public double externalCharge (double minutes) Charges the battery connected to the external charger (assuming it is connected) for a given number of minutes. The amount of charging in milliamp-hours (mAh) is the number minutes times the charger setting (a number between 0 inclusive and NUM_CHARGER_SETTINGS exclusive) the CHARGE_RATE constant. However, charging cannot exceed the capacity of the battery connected to the camera, or no charging if the battery is not connected. The method returns the actual amount the battery has been charged

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!