Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab 5.1- Functions and Pseudocode Yoa bave been coding with modules in pseudocode and functions when using Python. Yon modules in pseudocode can be made

image text in transcribedimage text in transcribedimage text in transcribed

Lab 5.1- Functions and Pseudocode Yoa bave been coding with modules in pseudocode and functions when using Python. Yon modules in pseudocode can be made into functions by returning a value A fnction is a special type of module that retums a value back to the part of the program hat called it Most programming languages provide a library of prewritten functions that performm commonly needed tasks. Library fmctions are built into the programming language and you can call them as needed. They are commonly performed tasks. Help Video: lab5-1.wmv Writing Your Own Function that Returns an Integer Step 1: Afunction contains three parts: a header, a body, and a rethurn statement The first is a function beader which specifies the data type of the value that is to be returned, the name of the function, and any parameter variables used by the function to accept arguments. The body is comprised of one or more statements that are executed when the fumction is called In the following space, complete the following: (Reference: Writing Your Own Functions, page 236). a. Write a fimction with the header named adden. b. The finction will accept an Integer variable named mumber. C. The finction body will ask the user to enter a mumber and then add 10 to the umber. The answer will be stored in the variable mber d. The retum statement will retum the value of number. Function a Display "Enter number Input c number + 10 Return d End Function

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

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions