Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm writing a C++ code for my school that reads a data file that displays different name of different classes and the number of boxes

I'm writing a C++ code for my school that reads a data file that displays different name of different classes and the number of boxes of cookies that were sold by each class. I have read the file and also have correct output for the program but, I will get an extra point if I can sort the parallel array. I have an example of the output and I was able to sort the numerical values in ascending order but I can't get the name of the class to correspond to the values.

Example of my output.

class Name boxes of cookies sold

---------

cat 68

dog 55

cow 95

horse 105

(Note: There are more data than that is displayed here, in very random order).

so now i need to sort this in an order where class name corresponds the number of boxes sold.

Example of output I want is

horse 105

cow 95

cat 68

dog 55

Would you please help me sort this type of data? Thank you!!

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

Database Processing Fundamentals Design And Implementation

Authors: David M. Kroenke

5th Edition

B000CSIH5A, 978-0023668814

More Books

Students also viewed these Databases questions

Question

How flying airoplane?

Answered: 1 week ago