subject
Engineering, 03.12.2019 18:31 oglejack6138

The subparts to this problem involve errors in the use ofpointers. a. this program is supposed to write 30 20 10, but it doesn't. find all ofthe bugs and show a fixed version of the program: int main() { intarr[3]={5,10,15}; int *ptr = arr; *ptr = 10; // set arr[0] to 10 *ptr + 1 = 20; // set arr[1] to 20 ptr +=2; ptr[0] = 30; // set arr[2] to 30 while (ptr > = arr) { ptr--; cout < < ' '< < *ptr; // print values } cout < endl; } b. the finddisorder function is supposed to find the first item in an array that is less than the element preceding it, and set the p parameter to point to that item, so the caller can know the location of that item. explain why this function won't do that, and show how to fix it. your fix must be to the function only; you must not change the the main routine below in any way, yet as a result of your fixing the function, the main routine below must work correctly. void finddisorder(int arr[], int n, int* p) { for(int k=1; k

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
What difference(s) did you notice using a pneumatic circuit over hydraulic circuit.explain why the pneumatic piston stumbles when it hits an obstacle.
Answers: 2
question
Engineering, 04.07.2019 19:10
An engine, weighing 3000 n, is supported on a pedestal mount. it has been observed that the engine induces vibration into the surrounding area through its pedestal at the maximum operating speed. determine the stiffness of the dynamic vibration absorber spring in (n/m) that will reduce the vibration when mounted on the pedestal. the magnitude of the exciting force is 250 n, and the amplitude of motion of the auxiliary mass is to be limited to 2 mm note: in this question type-in right numbers, no decimals, no fractions, no unit. approximate to right number if needed
Answers: 3
question
Engineering, 04.07.2019 19:20
Liquid flows at steady state at a rate of 2 lb/'s through a pump, which operates to raise the elevation of the liquid 100 ft from control volume inlet to exit. the liquid specific enthalpy at the inlet is 40.09 btu/lb and at the exit is 40.94 btub. the pump requires 3 btu/s of power to operate. if kinetic energy effects are negligible and gravitational acceleration is 32.174 tt/s, the heat transfer rate associated with this steady state process is most closely 1)-2,02 btu/s from the liquid to the surroundings 2)-3.98 btu/s from the surroundings to the liquid. 3)-4.96 btu/s from the surroundings to the liquid. 4)-1.04 btu/s from the liquid to the surroundings.
Answers: 2
question
Engineering, 04.07.2019 19:20
To design a steam turbine to produce 12,000 hp power. a engineer comsiders using a steady state stean low st 1160fr and engineer considers using a steady state steam flow at 1160°r and 450 psia to drive this steam turbine. the exhaust of the steam is cooled by the lake (vacuum). heat losing to the surroundings is measured at a rate of 555.55 btu/s. (a) sketch the system with the given conditions. (b) neglecting kinetic and potential energy changes from inlet to exit, determine the volumetric flow rate of the steam at the inlet, (ft'/hr). must clearly show unit conversions at crtical terms.
Answers: 1
You know the right answer?
The subparts to this problem involve errors in the use ofpointers. a. this program is supposed to wr...
Questions
Questions on the website: 13722367