1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
xeze [42]
3 years ago
6

Write an application that allows a user to select a country from a list box that contains the following seven options. After the

user makes a selection, display the country’s capital city.
Country
Capital Austria
Vienna Canada
Toronto England
London France
Paris Italy
Rome Mexico
Mexico City Spain
Madrid
Computers and Technology
1 answer:
hodyreva [135]3 years ago
6 0

Answer:

Programming Language not stated;

But this application definitely requires a graphical user interface platform (so, I'll use Microsoft Visual C# - Winforms).

Controls to be used are.

1. Form

2. List box

I'll name the Form, Form1 and the list box, listbox1.

Explanation:

The code goes thus;

private void Form1_Load(object sender, System.EventArgs e)

{

//Load country into empty listbox

listbox1.Items.Add("Austria");

listbox1.Items.Add("Canada");

listbox1.Items.Add("England");

listbox1.Items.Add("France");

listbox1.Items.Add("Italy");

listbox1.Items.Add("Mexico");

listbox1.Items.Add("Spain");

}

private void listbox1_SelectedIndexChanged(object sender, System.EventArgs e)

{

//Check if an item is really selected

if(listbox1.SelectedIndex >= 0)

{

//Index 0 represents 1st item that was added to the listbox and that's Austria

if(listbox1.SelectedIndex ==0)

{

MessageBox.Show("Vienna");

}

else if(listbox1.SelectedIndex == 1)

{

MessageBox.Show("Toronto");

}

else if(listbox1.SelectedIndex ==2)

{

MessageBox.Show("London");

}

else if(listbox1.SelectedIndex == 3)

{

MessageBox.Show("Paris");

}

else if(listbox1.SelectedIndex ==4)

{

MessageBox.Show("Rome");

}

else if(listbox1.SelectedIndex == 5)

{

MessageBox.Show("Mexico City");

}

else if(listbox1.SelectedIndex == 6)

{

MessageBox.Show("Madrid");

}

}

else

{

MessageBox.Show("No item selected");

}

}

You might be interested in
John's boss asks for a recommendation for connecting the company network to a small satellite building about 1 km from the main
tresset_1 [31]

Answer:

C. Ethernet over multi mode fiber .

Explanation:

Given that the distance to be covered is 1 km. Multi-mode optic fiber is best suited for short distances of up to 2 km and can withstand harsh environments with less signal attenuation. Single mode fiber is best suited long distance of up to 200 km or more and is expensive as compared to multi-mode fiber Ethernet over twisted pair is best for indoor use and can only cover very short distances. Although UTP and STP are relatively cheap they cannot withstand harsh environments without great signal loss.

4 0
4 years ago
Which display technology was developed by apple, produces vibrant colors, and supports viewing from all angles?
Vedmedyk [2.9K]
4.5K Retina display I think that is the answer you’re looking for
3 0
2 years ago
Kylie lives near a beautiful beach and has grown up surfing the waves. Many families come to visit her area and Kylie has notice
ch4aika [34]
La gente de que no me han dicho que me ha dado un teléfono y me han
4 0
3 years ago
HELPPP ME PLEASEEE!!
natita [175]
It’s the last one! The key to an effective persuasion is to know what you want and be clear about your response.
4 0
3 years ago
(within 200 words) analyzing the importance of information and communication technology in personal life.
Volgvan

Explanation:

Information technology is inescapable in modern day life, turn on the coffee pot and there are tiny microprocessor inside. Start your automobile and every aspect of operation is controlled by dozens of computer control modules. The current mobile phone amazing power and speed for the user. Technology is transforming every aspect of our life. Nowever is this more apparent than our place of employment. Developing of it makes our family to live happy because it helps the members of family to spend their most time with their family. It helps us to communicate the family member who live far from their family. It is also used in house hold work. It's saves our time to do more better and better

6 0
3 years ago
Other questions:
  • When performing conflict management, it is important to identify your;
    6·1 answer
  • Rachelle is an office manager for an active real estate agency. She’s overseeing a transition to a more complete reliance on ele
    9·1 answer
  • Computer security:
    15·1 answer
  • Name the written test a potential driver must pass and list the minimum required score to earn a learner’s license.
    8·2 answers
  • A filter is limited to extracting data from a single table. <br> a. True <br> b. False
    9·1 answer
  • &lt;BUTTON TYPE="BUTTON" VALUE="SUBMIT"&gt;SUBMIT YOUR FORM&lt;/BUTTON&gt;
    7·1 answer
  • If a pixel displayed on a screen has a red DN of 127, a green DN of 127, and a blue DN of 127, what color is the pixel
    7·1 answer
  • _____ drives are storage drives that contain both solid-state storage and hard disks in an attempt to gain the speed and power o
    13·1 answer
  • Toni is reviewing the status of his organization's defenses against a breach of their file server. He believes that a compromise
    14·1 answer
  • Variables that can take only 2 variables are referred to as which one of the following?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!