Question

In: Computer Science

Write a Visual C# project that will allow the user an option to choose from four...

Write a Visual C# project that will allow the user an option to choose from four different countries. When a country is chosen, the program will display the country flag and information that the user wishes to see. The name of the country selected will be displayed in a label under the country's flag image. The user may also choose to display or hide the form's title, the country name, and the name of the programmer/developer.   Check boxes will be used for the display/hide choices. Radio buttons will be used for the country selection.

You may choose the countries to display and their corresponding flags to display. In the Canvas module, you will see a zip file of flag images or you may choose your own.

Note: see the Note from the previous projects. These are now considered Basic Expectations and are expected in each program you develop and submit for grading.

Additionally, include keyboard access keys for all option buttons, check boxes, and command buttons. (add to Basic Expectations)
Be sure the tab order is set in the most logical order for the user.   (add to Basic Expectations)

Solutions

Expert Solution

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Here a new Windows Forms Application in C# is created using Visual Studio 2017 with name "CountryApplication".This application contains a form with name "Form1.cs".Below are the files associated with form1.

Form1.cs

//namespace
using System;
using System.Windows.Forms;
//application namespace
namespace CountryApplication
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//When Indian Flag radio button checked , display indian flag and information
private void rbtIndia_CheckedChanged(object sender, EventArgs e)
{
pbCountryFlag.Image =System.Drawing.Image.FromFile(Application.StartupPath +"\\Flags\\India.jpg");//set flag
lblName.Text="India";//set country name
}
//When Australia Flag radio button checked , display Australia flag and information
private void rbtAustralia_CheckedChanged(object sender, EventArgs e)
{
pbCountryFlag.Image = System.Drawing.Image.FromFile(Application.StartupPath + "\\Flags\\Australia.jpg");//set flag
lblName.Text = "Australia";//set country name
}
//When Japan Flag radio button checked , display Japan flag and information
private void rbtJapan_CheckedChanged(object sender, EventArgs e)
{
pbCountryFlag.Image = System.Drawing.Image.FromFile(Application.StartupPath + "\\Flags\\Japan.jpg");//set flag
lblName.Text = "Japan";//set country name
}
//When Germany Flag radio button checked , display Germany flag and information
private void rbtGermany_CheckedChanged(object sender, EventArgs e)
{
pbCountryFlag.Image = System.Drawing.Image.FromFile(Application.StartupPath + "\\Flags\\german.jpg");//set flag
lblName.Text = "Germany";//set country name
}
//checkbox to hide and display choices
private void chkChoices_CheckedChanged(object sender, EventArgs e)
{
if(chkChoices.Checked==true)
{
this.Text = "";//do not display title
lblName.Visible = false;//hide the country name
lblProgrammer.Visible = false;//hide pogrammer name
}
else
{
this.Text = "Country Selection";// display title
lblName.Visible = true;//show the country name
lblProgrammer.Visible = true;//show pogrammer name
}

}
}
}

======================================================

Output : Run application using F5 and will get the screen as shown below

Screen 1 :

Screen 2:Screen when choices are hidden

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.


Related Solutions

C++: Write a program to convert from gallons to liters. The program should allow the user...
C++: Write a program to convert from gallons to liters. The program should allow the user to input the amount with decimal places and then see the result on the screen.
Write a C++ program that : 1. Allow the user to enter the size of the...
Write a C++ program that : 1. Allow the user to enter the size of the matrix such as N. N must be an integer that is >= 2 and < 11. 2. Create an vector of size N x N. 3. Call a function to do the following : Populate the vector with N2 distinct random numbers. Display the created array. 4. Call a function to determines whether the numbers in n x n vector satisfy the perfect matrix...
Write a code in C that will take four words from the user and show those...
Write a code in C that will take four words from the user and show those in ascending order.
C# ( asp.net ) 2019 visual studio I have a dropdown option. If I choose "date"...
C# ( asp.net ) 2019 visual studio I have a dropdown option. If I choose "date" option, I get to enter list of dates like 02/08/1990, 06/14/1890 in (mm/dd/YYYY) format. How can I sort these dates in ascending order?. Can you provide me some code. Thank you
write a complete C++ program that allows the user to choose from one of several options....
write a complete C++ program that allows the user to choose from one of several options. The program will display a menu and each option will be in a separate function. The program will continue looping until the user chooses to quit. The module descriptions are given below. a. Prompt for and take as input 3 floating point values (l, w, and h). The program will then calculate the volume (volume = l*h*w ). The program should then output to...
Write a C++ program that allows a user choose item to purchase from a list; ask...
Write a C++ program that allows a user choose item to purchase from a list; ask for the amount to calculate the cost of the purchase; offer to add a tip; add a delivery fee based on the subtotal; then calculate the total amount that the user needs to pay. ---------------------------------- ----- GROCERY SHOPPING ITEMS ----- Milk     - $5.99 / gallon Egg      - $6.99 / dozen Cheese   – $10.98 / 8oz Pasta    – $2.75 / packet ---------------------------------- Other Values to...
write a complete C++ program that allows the user to choose from one of several options....
write a complete C++ program that allows the user to choose from one of several options. The program will display a menu and each option will be in a separate function. The program will continue looping until the user chooses to quit. The module descriptions are given below. 1. Prompt for and take as input 3 floating point values (l, w, and h). The program will then calculate the volume (volume = l*h*w ). The program should then output to...
Directions: Write a C++ program that will create an array of four integers. It will allow...
Directions: Write a C++ program that will create an array of four integers. It will allow the user to enter in four valid scores and store them in the array. ( valid range is 0 - 100) It will compute the letter grade based upon the four scores, namely, A = 90 - 100, B= 80- 89, C = 70-79, D = 60-69, otherwise F. It will display the scores and letter grade to the screen. NOTE: No menu is...
Create a table in C of conversion from Celsius to Rankin. Allow the user to enter...
Create a table in C of conversion from Celsius to Rankin. Allow the user to enter the starting temperature and increment between lines. Print 25 lines in the table. Rankin = 9/5(Celsius + 273.15)
Write a C++ program to allow the user to: 1. Create two classes. Employee and Departments....
Write a C++ program to allow the user to: 1. Create two classes. Employee and Departments. The Department class will have: DepartmentID, Departmentname, DepartmentHeadName. The Employee class will have employeeID, emploeename, employeesalary, employeeage, employeeDepartmentID. Both of the above classes should have appropriate constructors, accessor methods. 2. Create two arrays . One for Employee with the size 5 and another one for Department with the size 3. Your program should display a menu for the user to do the following: 1....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT