Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Multi-Dimensional Arrays question. unsure how to set srcCode
Author Message
xdynasty

Posted: Sun Apr 04, 2004 7:34 pm   Post subject: Multi-Dimensional Arrays question. unsure how to set srcCode

Highway maps often contain tables showing distances between various cities. A table showing
distances between cities 1, 2, and 3 might take the following form, which indicates, for example,
that the distance between 1 and 3 is 240 km.
1 -
2 240 -
3 120 165 -
1 2 3
Write a program that reads number pairs (over the range 1 to 8) and the distance in kilometers
between that pair of cities. Your program should produce a distance table like the one shown in
the preceding example.
Your program should not attempt to check for invalid data but it should be able to accept the
pairs of number codes in either order. For example, input of either 12 240 or
21 240 should both be acceptable. Your program should not expect values of all inter-city
distances to be available to it. If an entry is missing, a question mark should be printed in the
appropriate location in the table.

help with this question would be greatly appreciated. its not for any tests or anything, its a question my teacher gave us to try. realy not to sure what she means.
thanks
ps. the numbers of 123 are below the second and third coloumn.

Delos

Posted: Sun Apr 04, 2004 8:43 pm   Post subject: (No subject)

Conditional Statements by Tony
http://www.compsci.ca/v2/viewtopic.php?t=367

Repetition by Cervantes
http://www.compsci.ca/v2/viewtopic.php?t=3678

2-Dim Arrays by Thuged_out_G
http://www.compsci.ca/v2/viewtopic.php?t=3248

Arrays by Tony
http://www.compsci.ca/v2/viewtopic.php?t=366

Records by Dodge
http://www.compsci.ca/v2/viewtopic.php?t=2325
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 2 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: