how to create a program that retrieves the user 's car make , model designation , year model and number_km (how far the car has traveled). For example, let the program ask:
"Which car brand and model?"
"Which model year?"
"How far has it gone?"
using System;
using System.Collections.Generic;
using System.Globalization;
namespace App
{
class Program
{
static void Main(string[] args)
{
Console.Write("Which car brand and model?: ");
string makeModelDesignation = Console.ReadLine();
Console.Write("Which model year?: ");
int yearModel = int.Parse(Console.ReadLine());
Console.Write("How far has it gone?: ");
int number_km = int.Parse(Console.ReadLine());
Console.WriteLine("Car brand and model: {0}", makeModelDesignation);
Console.WriteLine("Car model year: {0}", yearModel);
Console.WriteLine("The number of km the car has traveled: {0}", number_km);
Console.ReadLine();
}
}
}
Comments
Leave a comment