Question

In: Computer Science

(EXCEL) Create a user-defined function called Hexagon that takes one argument called side and returns the...

(EXCEL) Create a user-defined function called Hexagon that takes one argument called side and returns the area of a regular hexagon given the length of the side. Show that the function works in a worksheet by inserting the formula somewhere.

Solutions

Expert Solution

Step 1 : Open EXCEL and press ALT + F11 to get into visual basic editor.

Step 2 : Choose Insert -> Module in the editor.

Step 3 : Here we need to type the programming code

We take argument side as double type
and, area = (3 *sqrt(3) *a^2)/2 i.e area of regular hexagon
square root can be return in form of power 1/2.
Then we save the function and return to excel.

Step 4: Click the Insert Function button on the Formulas tab to display the Insert Function dialog box.

Then , click on the function you created , i.e AreaOfRegularHexagon

Step 5 : Then , input the length of the side

For example , side = 6 and click OK.

Finally , its done . This value appears on the sheet.


Related Solutions

Create a function called merge that takes two int vectors (x and y) as argument and...
Create a function called merge that takes two int vectors (x and y) as argument and returns an int vector (z) that is the result of merging the two vectors x and y. Here is an example to explain how the merge function works: If the vector x has the following values: 1 2 3 4 5, and the vector y has the following: 6 7 8 9 10 11 12, then the merging vector z will have: 1 6...
Create a function called time2Greeting. It takes a time (in military time) and returns a string...
Create a function called time2Greeting. It takes a time (in military time) and returns a string with the right greeting. Good Morning 4AM to before noon. Good Afternoon Noon to before 5PM Good Evening from 5PM to 11PM What are you doing up at this hour? between 11 and 4AM For illegal values, say: That is not a valid time. Example: What is your name?   John What time is it? 1315 Good afternoon, John. C++ programming
In C: Write a function definition called PhoneType that takes one character argument/parameter called phone and...
In C: Write a function definition called PhoneType that takes one character argument/parameter called phone and returns a double. When the variable argument phone contains the character a or A print the word Apple and return 1099.99 When phone contains anything else return a 0.0
Rewrite the grade program from Question 2.2 using a user-defined function called computegrade that takes a...
Rewrite the grade program from Question 2.2 using a user-defined function called computegrade that takes a score as its parameter and returns a grade as a string. (15 points) USING PYTHON LANGUAGE >= 0.9 A >= 0.8 B >= 0.7 C >= 0.6 D < 0.6 F Run the program repeatedly as shown below to test the various different values for input. Enter score: 0.95 A Enter score: perfect Bad score Enter score: 10.0 Bad score Enter score: 0.75 C...
Write a python function image compress() that takes one argument called filename, which is the name...
Write a python function image compress() that takes one argument called filename, which is the name of a file that contains a N × N (N-pixel by N-pixel) “grayscale bitmap image”. A “grayscale bitmap image” is an image of the following form where every pixel contains a grayscale color value between 0 − 255 (inclusive). Colour value 0 means that pixel should appear completely black and color value 255means completely white. Any other value in between stands for different shades...
Write a function bracket_by_len that takes a word as an input argument and returns the word...
Write a function bracket_by_len that takes a word as an input argument and returns the word bracketed to indicate its length. Words less than five characters long are bracketed with << >>, words five to ten letters long are bracketed with (* *), and words over ten characters long are bracketed with /+ +/. Your function should require the calling function to provide as the first argument, space for the result, and as the third argument, the amount of space...
In C++, create a function exchangesl that takes an argument of an array of integers (...
In C++, create a function exchangesl that takes an argument of an array of integers ( for C++ use implement void exchangesl(vector<int>& a) . Those integers need to be changed so that the smallest and largest values in the array are exchanged. Assume that there is at least one element, if the largest value occurs more than once then exchange the first instance, if the smallest value happens more than once then exchange the last instance.
In C++, create a function exchangesl that takes an argument of an array of integers (...
In C++, create a function exchangesl that takes an argument of an array of integers ( for C++ use implement void exchangesl(vector<int>& a) . Those integers need to be changed so that the smallest and largest values in the array are exchanged. Assume that there is at least one element, if the largest value occurs more than once then exchange the first instance, if the smallest value happens more than once then exchange the last instance. Use the following file:...
Write function words() that takes one input argument—a file name—and returns the list of actual words...
Write function words() that takes one input argument—a file name—and returns the list of actual words (without punctuation symbols !,.:;?) in the file. >>> words('example.txt') ['The', '3', 'lines', 'in', 'this', 'file', 'end', 'with', 'the', 'new', 'line', 'character', 'There', 'is', 'a', 'blank', 'line', 'above', 'this', 'line']
python practice! 1. Create a function that takes a user choice and one number as parameters...
python practice! 1. Create a function that takes a user choice and one number as parameters and returns the operation result. -Square: print the number square -Sqrt: print the square root of the number -Reverse: reverse the sign of the number (pos or neg) and print it Note: Detect invalid choices and throw an error message – Number can be anything. 2. Create a function that takes a user choice and two numbers (start and end) as parameters. For example,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT