Write a program that declares/intializes two arrays as described in main() and has two functions. main() - The size of both arrays is 5. The first array has elements of type double. The values are for distance measurements. Choose a descriptive name for this array.The second array will have the unit of measure. Choose a descriptive name for this array. Initialize the first 4 elements using an initialization list with the values "mi", "mi", "km", "km". Assign a new value to the first element of the second array: "km"Assign a value to the last element of the second array: "mi" Use a loop with statement that ask the user to type in all of the values for the temperatures and assign them to the first array. Function calls in main() -- you might want to write the definitions first (or at least read about them) before coming back to main() to write the calls. call the function that prints the measurements along with the unit of measure.Call the function that can count the number of times a string appears in an array. Use "mi" as one of the arguments so that the function returns the number of times "mi" is in the array. From main(), print the value. Function definitions:Write a function that prints the measurements using a loop: it'll be values from both arrays so that it prints the number from one array followed by the unit of measure from the other array followed by a new line. Repeat until all of the values are printed from both arrays in that order. The function returns no values. Write a function that can count the number of times a string appears in an array and return the count. The function takes an array of string, its size and the string it is keeping a count of. Declare a local variable called count (you might want to initialize it). Write a loop that goes through the array parameter. In the loop, write an if statement: if the element is equal to the string it is counting, increment the count variable. Return a value if necessary. C++

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Write a program that declares/intializes two arrays as described in main() and has two functions. main() - The size of both arrays is 5. The first array has elements of type double. The values are for distance measurements. Choose a descriptive name for this array.The second array will have the unit of measure. Choose a descriptive name for this array. Initialize the first 4 elements using an initialization list with the values "mi", "mi", "km", "km". Assign a new value to the first element of the second array: "km"Assign a value to the last element of the second array: "mi" Use a loop with statement that ask the user to type in all of the values for the temperatures and assign them to the first array. Function calls in main() -- you might want to write the definitions first (or at least read about them) before coming back to main() to write the calls. call the function that prints the measurements along with the unit of measure.Call the function that can count the number of times a string appears in an array. Use "mi" as one of the arguments so that the function returns the number of times "mi" is in the array. From main(), print the value. Function definitions:Write a function that prints the measurements using a loop: it'll be values from both arrays so that it prints the number from one array followed by the unit of measure from the other array followed by a new line. Repeat until all of the values are printed from both arrays in that order. The function returns no values. Write a function that can count the number of times a string appears in an array and return the count. The function takes an array of string, its size and the string it is keeping a count of. Declare a local variable called count (you might want to initialize it). Write a loop that goes through the array parameter. In the loop, write an if statement: if the element is equal to the string it is counting, increment the count variable. Return a value if necessary. C++
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education