I. Make use of a loop of your choice and write statement(s) that will display all array elements indicating the Municipality’s name as follows: (6)
Municipality 1: Steve Tshwete
Municipality 2: Nkomazi
etc
public class Municipality{
public static void main(String []args){
String []municipality={"Steve Tshwete","Nkomazi"};
for (int i = 0; i < municipality.length; i++) {
System.out.println("Municipality " + (i+1) +" : "+ municipality[i]);
}
}
}
Comments
Leave a comment