The following Java program is NOT designed using class/object
concept.
public class demo_Program4_non_OOP_design {
public static void main(String[] args) {
String bottle1_label="Milk";
float bottle1_volume=250;
float bottle1_capacity=500;
bottle1_volume=addVolume(bottle1_label,
bottle1_volume,bottle1_capacity,200);
System.out.println("bottle label: " + bottle1_label +
", volume: " + bottle1_volume +
", capacity: " +bottle1_capacity);
String bottle2_label="Water";
float bottle2_volume=100;
float bottle2_capacity=250;
bottle2_volume=addVolume(bottle2_label,
bottle2_volume,bottle2_capacity,500);
System.out.println("bottle label: " + bottle2_label +
", volume: " + bottle2_volume +
", capacity: " +bottle2_capacity);
}
public static float addVolume(String label, float bottleVolume,
float capacity, float addVolume)...