Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use VPA for this Subroutines are similar to functions, except they don't return one specific value. This subroutine will ask the user for input, manipulate

Use VPA for this image text in transcribed
Subroutines are similar to functions, except they don't return one specific value. This subroutine will ask the user for input, manipulate it, and display the bottom hole pressure. Use the following to complete your code: f. Sub TestBHP) (Not all code here you will need to write variable declarations and a few lines of input) SurfPressure-cDbl (InputBox ("What is the Wellhead Pressure (psi)? ")) Sg-CDbl (InputBox ("What is the gas specific gravity (-)2")) GasBHP GasBHP f (SurfPressure, Sg, Depth, AvgTemp) MsgBox("The bottomhole pressure is "& str (GasBHP)&" psi. ") End Sub N.B.: In VBA, the CDbl function converts input into a Double. Run the subroutine by going to Developer, Macros. Choose TestBHP and run it. Use the following test data: Pwh = 2000 psi, Zav = 1.0, Tav = 140F, Sg = 0.65, Depth- 5000 ft. Snip the resulting dialog box and submit as Figure 2

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

Building Database Driven Catalogs

Authors: Sherif Danish

1st Edition

0070153078, 978-0070153073

More Books

Students also viewed these Databases questions