Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given a configuration file config.txt given below, create a c++ program to read in and display a map in the format given. config.txt // The

Given a configuration file config.txt given below, create a c++ program to read in and display a map in the format given.

config.txt

// The range of 'horizontal' and "vertical" indices, inclusive GridX_IdxRange=0-8 GridY_IdxRange=0-8

// [x,y] grid-areas citylocation.txt cloudcover.txt] pressure.txt

citylocation.txt

[1, 1]-3-Big_City [1, 2]-3-Big_City [1, 3]-3-Big_City [2, 1]-3-Big_City [2, 2]-3-Big_City [2, 3]-3-Big_City [2, 7]-2-Mid_City [2, 8]-2-Mid_City [3, 1]-3-Big_City [3, 2]-3-Big_City [3, 3]-3-Big_City [3, 7]-2-Mid_City [3, 8]-2-Mid_City [7, 7]-1-Small_City

image text in transcribed

image text in transcribed

cloudcover.txt

[0, 0]-41 [0, 1]-93 [0, 2]-90 [0, 3]-24 [0, 4]-70 [0, 5]-39 [0, 6]-47 [0, 7]-35 [0, 8]-83 [1, 0]-38 [1, 1]-66 [1, 2]-45 [1, 3]-11 [1, 4]-53 [1, 5]-35 [1, 6]-88 [1, 7]-75 [1, 8]-21 [2, 0]-56 [2, 1]-81 [2, 2]-34 [2, 3]-76 [2, 4]-53 [2, 5]-44 [2, 6]-70 [2, 7]-38 [2, 8]-32 [3, 0]-86 [3, 1]-13 [3, 2]-23 [3, 3]-93 [3, 4]-68 [3, 5]-26 [3, 6]-53 [3, 7]-52 [3, 8]-29 [4, 0]-76 [4, 1]-60 [4, 2]-43 [4, 3]-82 [4, 4]-40 [4, 5]-72 [4, 6]-48 [4, 7]-29 [4, 8]-75 [5, 0]-16 [5, 1]-49 [5, 2]-36 [5, 3]-53 [5, 4]-18 [5, 5]-47 [5, 6]-27 [5, 7]-98 [5, 8]-78 [6, 0]-68 [6, 1]-63 [6, 2]-33 [6, 3]-92 [6, 4]-27 [6, 5]-48 [6, 6]-13 [6, 7]-15 [6, 8]-37 [7, 0]-47 [7, 1]-3 [7, 2]-8 [7, 3]-17 [7, 4]-62 [7, 5]-62 [7, 6]-14 [7, 7]-35 [7, 8]-84 [8, 0]-7 [8, 1]-23 [8, 2]-63 [8, 3]-24 [8, 4]-37 [8, 5]-18 [8, 6]-44 [8, 7]-6 [8, 8]-18

image text in transcribed

image text in transcribed

image text in transcribed

Interpretation of each line : Data item #1 : [x, y] => the grid indices of the "lower-left" corner of a grid area [1, 1]-3-Big_City [1, 2]-3-Big_city [1, 3]-3-Big_city [2, 1]-3-Big_city [2, 21-3-Big_City [2, 3]-3-Big_City [2, 71-2-Mid City [2, 81-2-Mid_City [3, 1]-3-Big_City [3, 2]-3-Big_City [3, 3)-3-Big_city [3, 7-2-Mid City [3, 81-2-Mid City 17, 71-1-Small_City Delimiter char between data items #1 and #2 => '' Data item #2 : 3 => the city id to be displayed later on map) Delimiter char between data items #2 and #3 => '-' Data item #3 : Big_City => the name of the city (to be shown later on weather forecast summary report) @ vmw_ubuntu@vmwubuntu: -/TEMP/CSC1251/Assn1 Note : # # # # # # # 2 2 # 2 2 1 The city id is displayed on the relevant grid areas, instead of city names! 8 7 6 5 4 3 2 1 ########### ########### 3 3 3 3 3 3 3 (ii) Refer to Fig. B-1, which describes how each city's id value is stored in the input file # # # # # # # # # # # 0 1 2 3 4 5 6 7 8 Vmw_ubuntu@vmwubuntu:-/TEMP/CSCI251/Assn1$ The entire extent of the map is bounded by the '#' char! Note : #7247 # # # # # # # # # # # 8 # 8 2 2 7 7 3 8 1 # 7 # 7 5 9 1 3 6 # 4 8 5 2 1 1 4 # 5 # 3 2 4 4 6 1 # 4. # 7 5 6 4 1 2 6. 3 # 3 # 2 9 8 5 9 1 2 # 2 # 9 4 4 3 6 # 1 #06 8 1 6 4 6 0 2 # 0 # 4 3 5 8 7 1 4 0 # # # # # # # # oli 2 3 4 5 6 7 8 NRW 00 www (i) All the cloud cover input values has been reduced to a SINGLE-DIGIT "cloudiness index" value ranging from 0 to 9! 3 3 N 6 Refer to the origin grid area [0, 0] previously have a value of '41', which is now transformed into a single- digit cloudiness index" value = 4 !!! vmw_ubuntu@vmwubuntu:-/TEMP/CSCI251/Assn1$ 1 For each grid area (x, y], if original cloud Then the corresponding cover value falls within the range ... "cloudiness symbol" value is : 0 the grid indices of the "lower-left" corner of a grid area [1, 1]-3-Big_City [1, 2]-3-Big_city [1, 3]-3-Big_city [2, 1]-3-Big_city [2, 21-3-Big_City [2, 3]-3-Big_City [2, 71-2-Mid City [2, 81-2-Mid_City [3, 1]-3-Big_City [3, 2]-3-Big_City [3, 3)-3-Big_city [3, 7-2-Mid City [3, 81-2-Mid City 17, 71-1-Small_City Delimiter char between data items #1 and #2 => '' Data item #2 : 3 => the city id to be displayed later on map) Delimiter char between data items #2 and #3 => '-' Data item #3 : Big_City => the name of the city (to be shown later on weather forecast summary report) @ vmw_ubuntu@vmwubuntu: -/TEMP/CSC1251/Assn1 Note : # # # # # # # 2 2 # 2 2 1 The city id is displayed on the relevant grid areas, instead of city names! 8 7 6 5 4 3 2 1 ########### ########### 3 3 3 3 3 3 3 (ii) Refer to Fig. B-1, which describes how each city's id value is stored in the input file # # # # # # # # # # # 0 1 2 3 4 5 6 7 8 Vmw_ubuntu@vmwubuntu:-/TEMP/CSCI251/Assn1$ The entire extent of the map is bounded by the '#' char! Note : #7247 # # # # # # # # # # # 8 # 8 2 2 7 7 3 8 1 # 7 # 7 5 9 1 3 6 # 4 8 5 2 1 1 4 # 5 # 3 2 4 4 6 1 # 4. # 7 5 6 4 1 2 6. 3 # 3 # 2 9 8 5 9 1 2 # 2 # 9 4 4 3 6 # 1 #06 8 1 6 4 6 0 2 # 0 # 4 3 5 8 7 1 4 0 # # # # # # # # oli 2 3 4 5 6 7 8 NRW 00 www (i) All the cloud cover input values has been reduced to a SINGLE-DIGIT "cloudiness index" value ranging from 0 to 9! 3 3 N 6 Refer to the origin grid area [0, 0] previously have a value of '41', which is now transformed into a single- digit cloudiness index" value = 4 !!! vmw_ubuntu@vmwubuntu:-/TEMP/CSCI251/Assn1$ 1 For each grid area (x, y], if original cloud Then the corresponding cover value falls within the range ... "cloudiness symbol" value is : 0

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_2

Step: 3

blur-text-image_3

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions