LeviCoding
LeviCoding
CC#
Created by LeviCoding on 12/10/2023 in #help
I don't know how to structure my program...
We are suposed to use the repository pattern
18 replies
CC#
Created by LeviCoding on 12/10/2023 in #help
I don't know how to structure my program...
of the program, I should've done this instead of asking for code xp
18 replies
CC#
Created by LeviCoding on 12/10/2023 in #help
I don't know how to structure my program...
?
18 replies
CC#
Created by LeviCoding on 12/10/2023 in #help
I don't know how to structure my program...
You asked cgpt to give you a good structure
18 replies
CC#
Created by LeviCoding on 12/10/2023 in #help
I don't know how to structure my program...
No it's great thank you 😄
18 replies
CC#
Created by LeviCoding on 12/10/2023 in #help
I don't know how to structure my program...
It should be possible to add or remove a fleet.The same fleet of course only appears once. A fleet must also be quickly searchable by name. A shipping company is active in several ports, so it must be possible to add ports to a shipping company (and also to remove ports). It must also be possible to give an overview of the ports belonging to a shipping company in alphabetical order.Ports are simply represented by a name only (e.g. Antwerp, Rotterdam, ...) It must also be possible to place a ship in another fleet (e.g. place ship "De Plank "in fleet "Stille oceaan"). Furthermore it should be possible to give an overview of :-The total cargo value of the ships belonging to a shipping company.-The total number of passengers.-The tonnage per fleet to be listed (from large to small).-The total amount of volume the tankers can carry.-The available tugs.A shipping company should also be able to display info about a particular ship (based on the name of the ship).
18 replies
CC#
Created by LeviCoding on 12/10/2023 in #help
I don't know how to structure my program...
We enter the world of shipping.The management of ships is done by shipping companies, where each shipping company has several fleets, and each fleet consists of a number of ships. There are different types of ships, we distinguish:-Containership: length, width, tonnage, name, number of containers, cargo value-RoRo ship: length, width, tonnage, name, number of autos, number of trucks, cargo value-Cruise ship: length, width, tonnage, name, number of passengers, route-Ferry: length, width, tonnage, name, number of passengers, route-Olite tanker: length, width, tonnage, name, cargo value, volume (liters), cargo (oil, benzene,diesel or naphtha)-Gast tanker: length, width, tonnage, name, cargo value, volume (liters), cargo (LPG, LNG or ammonia)-Tugboat: length, width, tonnage, nameExtra info:-Cargo value: is the value of the cargo expressed in euros. -Tonnage: is the volume of the ship-Traject: for a ferry this is a fixed route between 2 ports, for a cruise ship this is a variable list of ports called at. In the route of a cruise ship, the sequence of ports is important. Ports can easily be represented by their names.A fleet has a name (e.g. North Sea fleet) and has a number of ships. It should be possible both to add ships to a fleet and to remove ships. One ship is allowed of course but
18 replies
CC#
Created by LeviCoding on 12/10/2023 in #help
I don't know how to structure my program...
__ This is the assignment
18 replies
CC#
Created by LeviCoding on 12/9/2023 in #help
Fast search an object in a list using his attribute
Is the use of a dictionary not faster? and using the name of the object as a key
8 replies
CC#
Created by LeviCoding on 12/9/2023 in #help
Fast search an object in a list using his attribute
We can not use lambdas, cuz we only learn it later in our course.
8 replies
CC#
Created by LeviCoding on 12/9/2023 in #help
Fast search an object in a list using his attribute
c#
public Ship SearchShip(List<Ship> ships, string shipName){}
c#
public Ship SearchShip(List<Ship> ships, string shipName){}
8 replies
CC#
Created by LeviCoding on 12/9/2023 in #help
Fast search an object in a list using his attribute
c#
public abstract class Schip
{
private double _lengte;
public double Lengte { get; set; }

private double _breedte;
public double Breedte { get; set;}

private double _tonnage;
public double Tonnage { get; set; }

private string _naam;
public string Naam { get; set; }

public Schip(double lengte, double breedte, double tonnage, string naam)
{
Lengte=lengte;
Breedte=breedte;
Tonnage=tonnage;
Naam=naam;
}
}
c#
public abstract class Schip
{
private double _lengte;
public double Lengte { get; set; }

private double _breedte;
public double Breedte { get; set;}

private double _tonnage;
public double Tonnage { get; set; }

private string _naam;
public string Naam { get; set; }

public Schip(double lengte, double breedte, double tonnage, string naam)
{
Lengte=lengte;
Breedte=breedte;
Tonnage=tonnage;
Naam=naam;
}
}
8 replies
CC#
Created by LeviCoding on 12/7/2023 in #help
IComparer problem
So I have to IComparers. Hmmm idk thank your for your help alex 😄 I'll take some time to process it xp
24 replies
CC#
Created by LeviCoding on 12/7/2023 in #help
IComparer problem
ok it works, but why having "using System.Collections.Generic;" if we still need to type it full
24 replies
CC#
Created by LeviCoding on 12/7/2023 in #help
IComparer problem
No description
24 replies
CC#
Created by LeviCoding on 12/7/2023 in #help
IComparer problem
But where in my code is the definition xp in my RatingComparer class or in the interface
24 replies
CC#
Created by LeviCoding on 12/7/2023 in #help
IComparer problem
a using domain?
24 replies
CC#
Created by LeviCoding on 12/7/2023 in #help
IComparer problem
So I have to remove a using statement?
24 replies
CC#
Created by LeviCoding on 12/7/2023 in #help
IComparer problem
I cant see da domein.IComparer<T> i this code
24 replies
CC#
Created by LeviCoding on 12/7/2023 in #help
IComparer problem
c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WC_Movie.Domein;

namespace WC_Movie.Domein
{
public class RatingComparer : IComparer <Movie>
{
public int Compare(Movie m1, Movie m2)
{
int firstComp = m1.Rating.CompareTo(m2.Rating);
return firstComp;
}
}
}
c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WC_Movie.Domein;

namespace WC_Movie.Domein
{
public class RatingComparer : IComparer <Movie>
{
public int Compare(Movie m1, Movie m2)
{
int firstComp = m1.Rating.CompareTo(m2.Rating);
return firstComp;
}
}
}
24 replies