![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jan 2008
Posts: 8
Rep Power: 0
![]() |
c#
Dear all sifu,
pls help me !! i duno how to do it given these data sets: departure city : KL, PJ, KLANG arrival city : Penang, Kedah, Ipoh stop by city : ipoh. pls write a application in c# that generate all the possible departure city-arrival city pair. e.g., the result should have, one way trip : KL - Penang KL - Kedah KL - Ipoh KL - Ipoh - Penang ... round trip ------------- KL - Penang - KL KL - Ipoh - Penang - KL ... all the possible routes must be saved in a file. a console application is good enough. |
|
|
|
|
|
#2 |
|
Omlette du fromage
Join Date: Oct 2007
Posts: 29
Rep Power: 0
![]() |
Re: c#
Two string arrays for the departure and arrival cities.
A string for the stop by city then two nested loop: write line "one way trip:" Outer loop (for each departure city).... Oooh oooh single funtion pass in param whether it's single or return flight! (hint String.Format()) Ah that's what it's like in my head, he he. You must attempt some code first sorry, that's how it works here. I've given you some hints. Try some code even if it doesn't compile, have a go and post it here. Then we'll help you get it working. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jan 2008
Posts: 8
Rep Power: 0
![]() |
Re: c#
thx!! but can u write code for me?
|
|
|
|
|
|
#4 |
|
Omlette du fromage
Join Date: Oct 2007
Posts: 29
Rep Power: 0
![]() |
Re: c#
Nope it's not allowed, you have to write and post some first. Then I will post any necessary additional or correcting code.
You might get lucky. Sometimes a forum member can't resist showing off and may post the complete solution, but I wouldn't hold your breath he he ![]() |
|
|
|
|
|
#5 |
|
Newbie
Join Date: Jan 2008
Posts: 8
Rep Power: 0
![]() |
Re: c#
thx!! but i wan to know izzit GUI application or command program!!
|
|
|
|
|
|
#6 |
|
Omlette du fromage
Join Date: Oct 2007
Posts: 29
Rep Power: 0
![]() |
Re: c#
Just do a command programme, also known as a Console programme.
|
|
|
|
|
|
#7 |
|
Newbie
Join Date: Jan 2008
Posts: 8
Rep Power: 0
![]() |
Re: c#
actually i not really understand this question. can u explain for me. I also duno what to do it
|
|
|
|
|
|
#8 |
|
Expert Programmer
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4
![]() |
Re: c#
This looks like a homework question. From my experience, homework comes from instructors. Last time I checked, instructors have office hours where students can go and ask questions like: "I don't understand what you're asking me to do".
Once you have that sorted out, we'll be glad to help you with the algorithm (which I believe hollystyles already covered). |
|
|
|
|
|
#9 | |
|
Omlette du fromage
Join Date: Oct 2007
Posts: 29
Rep Power: 0
![]() |
Re: c#
Quote:
if yes: Step 1. Do you have the .NET framework 2.0 installed on a PC ? Start -> Run. Type: cmd press enter type cd "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" press enter type csc press enter. if no: What language(s) are you allowed to use ? The exercise involves these programing techniques: Variables Loops Standard Output These can be done in any language, it's just a matter of syntax and environment (computer and operating system) as to how you: 1. Write the source code 2. Compile/execute the programme Last edited by hollystyles; Jan 30th, 2008 at 7:14 AM. |
|
|
|
|
|
|
#10 |
|
Newbie
Join Date: Jan 2008
Posts: 8
Rep Power: 0
![]() |
Re: c#
i need use c# to do it but i duno how to start it
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|