1. Write a function named time() that has an integer parameter named seconds and three integer reference parameters name
Posted: Tue Apr 12, 2022 10:23 am
1. Write a function named time() that has an integer parameter named seconds and three integer reference parameters named hours, mins, and secs. The function is to convert the passed number of seconds into an equivalent number of hours, minutes, and seconds. Using the reference parameters, the function should alter the arguments in the calling function. 2. The equivalent diameter of a circular duct that provides the same pressure loss as a rectangular duct (see figure below) is given by the Huebsher equation: d is the equivalent dimeter (mmatik is the rectangular doct width (mment bis the rectangular duct height (mmer Use this formula, write and test a C++ function named equivDuct() that accepts two double-precision arguments (width and height of the duct) from the user input. Then calculates and returns the equivalent diameter for a circular duct that provides the same pressure loss as the rectangular duct having the width and height specified by function's arguments. Use your program to fill the following table: Width (mm) Height (mm) Equivalent diameter (mm) 6 Write a C++ program that tests the effectiveness of the rand() library function. Start by initializing 10 counters to 0, and then generate a large number of pseudorandom integers between 0 and 9. Each time a 0 occurs, increment the variable you have designated as the zero counter, when a l occurs, increment the counter variable that's keeping count of the Is that occur, and so on. Finally, display the number of Os, Is, 2s, and so on that occurred and the percentage of the time they occurred.