Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define an ordinary function called DisplayMin that has three parameters: the first two parameters are parallel arrays of different types and the third argument is

image text in transcribed

Define an ordinary function called DisplayMin that has three parameters: the first two parameters are parallel arrays of different types and the third argument is of type sizetrepresenting the size of both arrays. The function DisplavMin must work when called with various types of actual arguments, for example string DisplavMin(string names[, int calories[, int size) or int DisplavMin(int calories[, float prices[, int size) (Parallel Arrays are two arrays whose data is related by a common index. For example: with the string array and int array, index 3 of the string array would have some name, and index 3 of the int array would have an associated value to that name (say, number of calories).) Write one function that will take either set of arguments in, displays and return the value from the first array corresponding to the min value from the second arrav, in the form "The min value of belongs to ." Test your function by calling it with different inputs from a main() function and then printing the result of the function in the main program. Examples Given: names-> string] ("French Fries", "Cheeseburger, "Hamburger", "Soda", "Coffee"] calories ->int (300, 650, 550, 450, 50) size ->int 5 Output: "The min value of 50 belongs to Coffee." iiven: calories-int prices -float size ->int 6 300, 35, 650, 550, 450, 50) 2.99,.99,2.79,3.19,1.79, 2.15) Output: "The min value of 35 belongs to 0.99

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: KROENKE DAVID M.

1st Edition

8120322258, 978-8120322257

More Books

Students also viewed these Databases questions