Dexter
New member
- Joined
- Mar 24, 2022
- Messages
- 1
- Programming Experience
- Beginner
0
I have a small project which I am working on as a beginner in OOP and I would like to ask for some help on a particular problem I encountered.
I have Vehicle class that looks like this:
And I have an order class that makes orders and I have a constructer in that class that takes data from a text file reads it and creates a new vehicle. The constructer looks like this:
So I would like to have vehicleDetails which is the data to create a specific vehicle type. I would like to know which is the fastest and simplest way I could achieve such a result?
I have a small project which I am working on as a beginner in OOP and I would like to ask for some help on a particular problem I encountered.
I have Vehicle class that looks like this:
C#:
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace CarGarageSoftware
{
class Vehicle
{
public string Lplate
public string Make;
public string LMOT;
public string Esize;
public string Transmission;
public string Mileage;
public string FuleT;
class PersonalUseCars:Vehicle
{
}
class BussinessCars:Vehicle
{
public string CompanyN;
public string CompanyA;
public string FleetN;
}
class WorkVehicle:Vehicle
{
public string CompanyN;
public string CompanyA;
public string purpose;
public string Type;
}
class Motobykes:Vehicle
{
}
And I have an order class that makes orders and I have a constructer in that class that takes data from a text file reads it and creates a new vehicle. The constructer looks like this:
C#:
public Order(string ordLine, string vehLine,string[] logLine)
{
orderDetails = new JobDetails(ordLine);
vehicleDetails = new Vehicle();
mechanicLog = new WorkLog();
for(int i = 0; i < logLine.Length; i = i + 2)
{
mechanicLog.MakeNewEntry(logLine[i], logLine[i + 1]);
}
orderName = $"O_{vehicleDetails.Lplate}_{orderDetails.CustomerName}";
}
So I would like to have vehicleDetails which is the data to create a specific vehicle type. I would like to know which is the fastest and simplest way I could achieve such a result?
Last edited by a moderator: