![]() |
Rail ticket machine using c++
First,Merry Christmas and Happy New Year.
Second,as you all know,we enter uni on the 4th of January and I have a c++ assignment in which our dr told us that is a little difficult for beginners in c++, I look at the assignment and agreed with the dr:D,so i'm seeking your help here (as always:p). Fa farjouna bara3etkon:D. ================================================== ======== “Rail ticket machine” Design and implement in C++ a program that manages a rail ticket machine. The rail ticket machine functions as follows: a user selects a departure town, a destination town, a class (first or second), and a possible deduction (30%, 50%, or 60%). The rail ticket machine shows then the price of the ticket (as an integer expressed in Euros). The user inserts a sum of money as a set of coins. Four cases are then possible: 1. the sum of money is equal to the price of the ticket, the rail ticket machine delivers the ticket to the user; 2. the sum of money is greater than the price of the ticket and the rail ticket machine has enough change, the rail ticket machine returns the change and delivers the ticket to the user; 3. the sum of money is less than the price of the ticket, the rail ticket machine displays a message saying that the inserted sum is insufficient and returns the inserted money, 4. the sum of money is greater than the price of the ticket but the rail ticket machine does not have enough change, it indicates that the change is insufficient and returns the inserted money. 5. We assume that the accepted coins are in the categories 0.2, 0.5, 1 and 2 Euro. 6. We provide a table showing for two towns linked up directly by the rail the distance separating them. We also provide the price of a ticket in the first and the second class. Write an algorithm that implements the rail ticket machine. When no direct link exists between the two given towns, your algorithm should find an intermediate town so that the total distance be minimized. Your solution should manage the stock of money available in the machine in order to minimize the number of coins returned to the user. The algorithm should print a ticket containing the following information: departure town, destination tow, via town, class, deduction, price. DATA NOTE:I don't know if this is important,but ba3ed ma darasna el pointers,we only know arrays and functions and loops ,pointers ba3ed ma wsolnelon. so "GOOGLE","TAWA" and vcoderz c++ freaks i really need your help:D |
No, it's not difficult, you should've improved from the time we helped you last until now.
You're not learning anything if everytime you want someone to do it for you. In addition, you didn't even make an effort and showed us where you reached. // Looks like you havn't even started. Anyways, I'll look into it. |
Code:
|
Tawa: I liked your first answer better :( I am really against this when people go online and post their homework/assignment in full and ask for someone to do it. You are causing more harm then doing good.
It would have been better if he had specific questions. That proves to me that he is trying to understand the problem. |
Free to ask for help. Free to respond.
|
Quote:
In addition, some people won't learn even if they made their own homework, and others will just lookup some exercises to learn and maybe they can learn from this one :p |
| All times are GMT +1. The time now is 01:21 PM. |
Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger