Answer to Question #243130 in Java | JSP | JSF for junior

Question #243130

     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



1
Expert's answer
2021-09-27T13:34:40-0400
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]);
           }
     }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS