Question: Write an example method that overrides the + operator to create a new car whose name of the model is a concatenation of the model

Write an example method that overrides the + operator to create a new car whose name of the model is a concatenation of the model of two Cars. The price of the new car is equal to the sum of the prices of the original Cars. For example, if the first car's model is "Berlingo" and the second car's model is "Picasso", the concatenated model will be "Berlingo and Picasso". If the first car's price is $85000.55 and the second car's price is $120000.00, the price of the new car will be $205000.55. Assume the Car class is defined as: using System; using static System.Console; using System. Globalization; public class Car { public Car(string model, double price) 1 Model = model; Price = price; } public string Model { get; set; } public double Price { get; set; } // Your code as answer }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
