Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 30th, 2008, 12:08 AM   #1
nick85
Newbie
 
Join Date: Jan 2008
Posts: 8
Rep Power: 0 nick85 is on a distinguished road
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.
nick85 is offline   Reply With Quote
Old Jan 30th, 2008, 4:15 AM   #2
hollystyles
Omlette du fromage
 
hollystyles's Avatar
 
Join Date: Oct 2007
Posts: 29
Rep Power: 0 hollystyles is on a distinguished road
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.
hollystyles is offline   Reply With Quote
Old Jan 30th, 2008, 4:19 AM   #3
nick85
Newbie
 
Join Date: Jan 2008
Posts: 8
Rep Power: 0 nick85 is on a distinguished road
Re: c#

thx!! but can u write code for me?
nick85 is offline   Reply With Quote
Old Jan 30th, 2008, 4:24 AM   #4
hollystyles
Omlette du fromage
 
hollystyles's Avatar
 
Join Date: Oct 2007
Posts: 29
Rep Power: 0 hollystyles is on a distinguished road
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
hollystyles is offline   Reply With Quote
Old Jan 30th, 2008, 4:34 AM   #5
nick85
Newbie
 
Join Date: Jan 2008
Posts: 8
Rep Power: 0 nick85 is on a distinguished road
Re: c#

thx!! but i wan to know izzit GUI application or command program!!
nick85 is offline   Reply With Quote
Old Jan 30th, 2008, 4:39 AM   #6
hollystyles
Omlette du fromage
 
hollystyles's Avatar
 
Join Date: Oct 2007
Posts: 29
Rep Power: 0 hollystyles is on a distinguished road
Re: c#

Just do a command programme, also known as a Console programme.
__________________
==========================================
Web junky, fevered monkey
hollystyles is offline   Reply With Quote
Old Jan 30th, 2008, 4:42 AM   #7
nick85
Newbie
 
Join Date: Jan 2008
Posts: 8
Rep Power: 0 nick85 is on a distinguished road
Re: c#

actually i not really understand this question. can u explain for me. I also duno what to do it
nick85 is offline   Reply With Quote
Old Jan 30th, 2008, 6:42 AM   #8
OpenLoop
Expert Programmer
 
OpenLoop's Avatar
 
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4 OpenLoop is on a distinguished road
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).
OpenLoop is offline   Reply With Quote
Old Jan 30th, 2008, 6:57 AM   #9
hollystyles
Omlette du fromage
 
hollystyles's Avatar
 
Join Date: Oct 2007
Posts: 29
Rep Power: 0 hollystyles is on a distinguished road
Re: c#

Quote:
actually i not really understand this question. can u explain for me. I also duno what to do it
You have posted in a C# forum, does your homework specify that C# is to be used ?

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
__________________
==========================================
Web junky, fevered monkey

Last edited by hollystyles; Jan 30th, 2008 at 7:14 AM.
hollystyles is offline   Reply With Quote
Old Jan 30th, 2008, 7:11 AM   #10
nick85
Newbie
 
Join Date: Jan 2008
Posts: 8
Rep Power: 0 nick85 is on a distinguished road
Re: c#

i need use c# to do it but i duno how to start it
nick85 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:10 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC