Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ Program please use only 2d array or 2d dynamic or filling or character array and only use 2 library iostream and fstream and also

c++ Program please use only 2d array or 2d dynamic or filling or character array and only use 2 library iostream and fstream and also don't use string library and please do not use vector or recursion or other

image text in transcribed
Task 1: The l about e "data.brt" contains information about circles and squares in each line {record}. The le can store information maximum hundred squares and hundred circles. Each record starts with a character '5' or 'c' which represents square and circle respectively. The next number represents length ofthe square or radius ofthe circle. Provide a function- based CH solution to it. In your program, you must Read data from "databrt'" in a 20 array. Store the length of each square in the first row and the radius of each circle in the 'lZI'Ilfd row. Calculate area of each type of shape. Store the area of each square in the second row and the area of each circle in the fourth row. For each type of shape, calculate the maximum. area and the shape number which has the maximum area. Save the value of maximum area and shape number in second or fourii'l row [depending upon the shape type] right after the last inserted value. For each type of shape, calculate the minimum area and the shape number which has the minimum area. Save the value of minimum area and shape number in second or fourr row {depending upon the shape type] right after the last inserted value. For each type of shape, calculate the average area. Save the value of average area in second or fouri row [depending upon the shape} right after the last inserted value. Write data from the in array in les circle.brl and squaretirt in the format given below. Use appropriate number of parameters, their data type and return types for each function you make. 0 E----------- 1 81 2 3 3 data_bct cirdabct 3,3 Area of circle 1 with radius 3 is 23.2?. Area of circle 2 with radius 7 is 153.94. Area of circle 3 with radius 2.2 is 15.21. 153.94 of circle 2 15.21 of circle 3 55.81 Maximum Area Minimum Area Average Area with length with length with length with length 31 of square 1 1 of square 2 23.?5

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions