Dr. Conly\'s beverage cellar needs to be organized. He wants a program that can
ID: 3779629 • Letter: D
Question
Explanation / Answer
void order(String data[]){
String[] quantity = new String[data.length];
int index = 0;
for(String val : data){
quantity[index] = val.substring(val.lastIndexOf(":"),val.length());
// beverages[index] = val.substring(0,val.lastIndexOf(":"));
index++;
}
for(int i : data.length-1){
for(int j : data.length){
if(quantity[i]>quantity[j]){
int t= quantity[i];
quantity[i]=quantity[j];
quantity[j]=t;
String x = data[i];
data[i] = data[j];
data[j]=x;
}
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.