Answered step by step
Verified Expert Solution
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.
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 eStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started