Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ use 2D arrays The table below shows the cost of one way travel using the future Gulf Rail train between different cities in the

C++ use 2D arrays

The table below shows the cost of one way travel using the future Gulf Rail train between different cities in the gulf area in AED. For instance, the cost of travelling from Doha to Riyadh is 850 AED, and the cost of travelling from Riyadh to Doha is 720 AED. The below table can be saved into a two dimensional array where the rows and columns represent the cost to travel between these cities.

image text in transcribed

Exercise #1: Future Gulf Rail The table below shows the cost of one way travel using the future Gulf Rail train between different cities in the gulf area in AED. For instance, the cost of travelling from Doha to Riyadh is 850 AED and the cost of travelling from Riyadh to Doha is 720 AED. The below table can be saved into a two dimensional array where the rows and columns represent the cost to travel between these cities To Doha Abu DhabiRiv adh Manama From 1100 850 600 400 1300 Doha Abu Dhabi Rivadh Manaina 890 720 550 850 1000 350 Write a C++code that does the following: 1. Read the cos ts from keyboard and stores them in a two dimensional array called GulfRail where the number of cities is 4 Calculate the average cost for traveling To Doha. Modify the two dimensional array GulRail by reducing the cost of travel tom Riyadh by 20%. 2. 3. nter the 16 costs:0 1100 850 400 898 600 1300 720 850 0 280 550 1000 350 0 1100 850 400 90 8 600 1300 720 850 0 280 50 1000 350 he average is: 720 Print the array after reduction: 1100 850 400 90 680 1300 76 680 0 224 550 1000 350 e

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions

Question

Find dy/dx if x = te, y = 2t2 +1

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago