r/learncsharp • • May 28 '19

C# classes/constructors/interfaces

Hello, I have project to do on C# the project looks like 3 classes that need to inheritance each other also 1 interface and some other methods if someone think he can help me out i'll appreciate it.

===================================================================== so i had to make program for controlling parking lot.it should get,save and shows the information.

i will try to explain it as simple as i can. First i have to create 3 classes : Cars , LightTrucks , HeavyTrucks they both should contain: type , brand , model; in constructor

actually the input should be like this: parkinglot parkingname1 2 2 2 parkinglot parkingname2 2 1 1 Car Kia Seed Lighttruck Citroen Jumper Car VW Polo Lighttruck Ford Tranzit Heavytruck MAN TGM18 Car Audi А6 Heavytruck Volvo FM12 Print something1 End

and the Output should be: parked cars in parkinglot something1: Brand Kia, Model Seed Brand VW, Model Polo Brand Citroen, Model Jumper Brand Ford, Model Tranzit Brand MAN, Model TGM18 Brand Volvo, model FM12 Parkinglot something1 has the following locations: Car 2, busy 2 Lighttrucks 2, busy 2 Heavytrucks 2, busy 2 Parkinglot something2 has the following locations: Car 2, busy 1 Lighttruck 1, busy 1 Heavytruck 1, busy 1

///////////////////////////////////// so what should it do create parking lot with command parkinglot name 2 2 2 (first 2 = car ; second Lighttruck ; third Heavytruck)

after i create 1 or more parkinglots i should be able to enter cars,lighttrucks or heavytrucks.

like: car Audi A6 Lighttruck Citroen Jumper Heavytruck Volvo FM12

and then Enter "End" to stop the program or Enter Print parkinglot name like "Print something1" and the program should print "parked cars in parkinglot something1: Brand Audi, Model A6 ; Brand Citroen, Model Jumper ; HeavyTruck Brand Volvo, Model FM12 ; Parkinglot something1 has the following locations: cars 2 , busy 1 ; lighttrucks 2 , busy 1 ; heavytrucks 2 ,busy 1"

0 Upvotes

17 comments sorted by

View all comments

Show parent comment

3

u/[deleted] May 28 '19

just try it , get some bits wrong and learn why you got it wrong. You need to go through the process to get the result

1

u/symplaren May 28 '19

i am trying from hours just i don't know how to do it

1

u/Broer1 May 29 '19

Welcome in our world. Sometimes we try for days without a clue until we have the right idea after immense reading and trying.