Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could you help me solve the qusetion? USing C++. Thanks! 1) Create a class named Country with a default constructor, a public methods ReadFile, getMaxAreaState

Could you help me solve the qusetion? USing C++. Thanks!

image text in transcribed

1) Create a class named Country with a default constructor, a public methods ReadFile, getMaxAreaState and a private data members- stateName, which is an array with 50 string values area, which is an array of 50 Integer values Use -1.0 to initialize all the area values of the array and empty string for the stateName values initialization. 2) The public method ReadFile will read each line from the given filename and store each value into the arrays. Each line of the file contains a stateName and its area separated by a comma. This method does not return a value. Please note, each line in the file contains a stateName and its area but not necessarily in order, you need to determine if the read value is a stateName or area. Note: state names will be in lower case only. Hint stoteName will consist of only olphabets and area only of digits. e.g. Data in File can be in following order Question 6 Not answered Mark 0.00 out of 10.00 P Flag question alaska,1723337 colorado, 269681 219882, utah 295234,arizona 3) The public method getMaxAreaState returns the name of the state with maximum area. You only need to write the class definition and any code that is required for that class. Place all code within the class definition. Our code will create and test your class. NOTE: We have provided a function that may make the parsing casier: int split (string s, char sep, string words[], int max words); Answer (penalty regime: 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

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

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions