Computers & Internet Logo

Related Topics:

Posted on Apr 13, 2009

Design a Menu-driven interactive programme to find out all the Capital cities of India using switch statement

1 Answer

Anonymous

Level 1:

An expert who has achieved level 1.

Mayor:

An expert whose answer got voted for 2 times.

  • Contributor 2 Answers
  • Posted on Apr 23, 2009
Anonymous
Contributor
Level 1:

An expert who has achieved level 1.

Mayor:

An expert whose answer got voted for 2 times.

Joined: Dec 12, 2007
Answers
2
Questions
0
Helped
477
Points
5

Import java.io.*;
public class capital
{
public static void main(String args[]) throws Exception
{
System.out.println("Enter 1 for Andra Pradesh");
System.out.println("Enter 2 for Arunachal Pradesh.");
System.out.println("Enter 3 for Assam.");
System.out.println("Enter 4 for Bihar.");
System.out.println("Enter 5 for Chhattisgarh.");
System.out.println("Enter 6 for Goa.");
System.out.println("Enter 7 for Karnataka.");
System.out.println("Enter 8 for Gujrat.");
System.out.println("Enter 9 for Haryana.");
System.out.println("Enter 10 for Himachal Pradesh.");
System.out.println("Enter 11 for Mizoram.");
System.out.println("Enter 12 for Jammu & Kashmir.");
System.out.println("Enter 13 for Jharkhand.");
System.out.println("Enter 14 for Kerala.");
System.out.println("Enter 15 for Madhya Pradesh.");
System.out.println("Enter 16 for Maharashtra.");
System.out.println("Enter 17 for Manipur.");
System.out.println("Enter 18 for Meghalaya.");
System.out.println("Enter 19 for Nagaland.");
System.out.println("Enter 20 for Orissa.");
System.out.println("Enter 21 for Punjab.");
System.out.println("Enter 22 for Rajasthan.");
System.out.println("Enter 23 for Sikkim.");
System.out.println("Enter 24 for Tamil Nadu.");
System.out.println("Enter 25 for Tripura.");
System.out.println("Enter 26 for Uttar Pradesh.");
System.out.println("Enter 27 for Uttaranchal.");

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String read = br.readLine();
int ch = Integer.parseInt(read);

switch(ch)
{
case 1: System.out.println("Hyderabad");
break;
case 2: System.out.println("Itanager");
break;
case 3: System.out.println("Dispur");
break;
case 4: System.out.println("Patna");
break;
case 5: System.out.println("Raipur");
break;
case 6: System.out.println("Panaji");
break;
case 7: System.out.println("Bangalore");
break;
case 8: System.out.println("Gandhinagar");
break;
case 9: System.out.println("Chandigarh");
break;
case 10: System.out.println("Shimla");
break;
case 11: System.out.println("Aizawl");
break;
case 12: System.out.println("Srinagar(Summer) & Jammu(Winter)");
break;
case 13: System.out.println("Ranchi");
break;
case 14: System.out.println("Trivandrum");
break;
case 15: System.out.println("Bhopal");
break;
case 16: System.out.println("Bombay");
break;
case 17: System.out.println("Imphal");
break;
case 18: System.out.println("Shillong");
break;
case 19: System.out.println("Kohima");
break;
case 20: System.out.println("Bhubaneswar");
break;
case 21: System.out.println("chandigarh");
break;
case 22: System.out.println("Jaipur");
break;
case 23: System.out.println("Gangtok");
break;
case 24: System.out.println("Chennai");
break;
case 25: System.out.println("Agartala");
break;
case 26: System.out.println("Lucknow");
break;
case 27: System.out.println("Dehra Dun");
break;
default: System.out.println("Invalid entry!");
break;
}
}
}

(IGNOU - BCA - CS-74 - Q.4 - 2009)
Visit : Www.hamidraza.page.tl

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

2helpful
1answer

I am not able to set time for cities in India with time differenc

Go this page, find your watch and click on INTERACTIVE SETTING INSTRUCTIONS.

http://www.citizenwatch.com/CUK/English/technicalinfo.asp?caliber=U600&ModelNumber=JY0000-53E

Rate me, please.

0helpful
1answer

I want to solution of this program.

In what language? VB?Java?C++? Will you have the data placed into the program or ll be obtained automatically from the net? This program ll be able to run in what operating systems?Will it be in a CD or what? Plz more infos!
Not finding what you are looking for?

426 views

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Grand Canyon Tech
Grand Canyon Tech

Level 3 Expert

3867 Answers

Brad Brown

Level 3 Expert

19187 Answers

Cindy Wells

Level 3 Expert

6688 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...