Exercise: Data Types
- Create a new class called DataTypes.
- Define a Run() method for that class.
- Define the following variables:
- string carName
- int carYear
- int carKm
- char carGroup (set the value to be one of this options A, B or C).
- Display the values on a message box as below:
- Add a new menu entry named “Data Types”.
- Call this class to display the message box from the menu
- Build and test.
Your DataTypes Class supposed to look like this code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Northwind.Exercises
{
class DataTypes
{
public void Run()
{
string carName = "Mini";
int carYear = 2015;
int CarKM = 20000;
char carGroup = 'A';
System.Windows.Forms.MessageBox.Show("My car is a " + carName +"\nit's from year "+carYear+"\nI already drove it for "+CarKM );
}
}
}
Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com