View on GitHub

oop

Αντικειμενοστραφής Προγραμματισμός (C++)

Άσκηση 2

Εκφώνηση

Κώδικας

Μεταγλώττιση και εκτέλεση

Ο κώδικας είναι εφαρμογή στο Eclipse for Java και βρίσκεται στον φάκελο prepare01b

Eclipse: Run -> Run

Enter type of vehicle (C=Car/T=Truck):C
Enter registration number:32632636
Enter owner name:Nikos
Enter cubic centimeters:1200
Enter number of doors:4
Enter type of vehicle (C=Car/T=Truck):T
Enter registration number:32643634
Enter owner name:Petros
Enter cubic centimeters:4000
Enter max weight:5000
Enter type of vehicle (C=Car/T=Truck):C
Enter registration number:14374743
Enter owner name:Maria
Enter cubic centimeters:1600
Enter number of doors:5
Vehicle 32632636-Nikos-1200,0-4 tax:160.0
Vehicle 32643634-Petros-4000,0-5000,0 tax:400.0
Vehicle 14374743-Maria-1600,0-5 tax:200.0
TOTAL TAX=760.0