Answer to Question #299689 in C# for khan

Question #299689

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?"


1
Expert's answer
2022-02-19T02:39:10-0500


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();
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS