1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
adoni [48]
3 years ago
6

For the function definition int SomeFunc( /* in */ int alpha, /* in */ int beta ) { int gamma; alpha = alpha + beta; gamma = 2 *

alpha; return gamma; } what is the function postcondition?
Computers and Technology
2 answers:
Sonbull [250]3 years ago
3 0

Answer:

A function post-condition refers to what will happen  and return after calling the function.

Given the function definition as follows:

  1. int SomeFunc( /* in */ int alpha, /* in */ int beta )
  2. {
  3.    int gamma;
  4.    alpha = alpha + beta;
  5.    gamma = 2 * alpha;
  6.    return gamma;
  7. }

If we call the function by passing two values, 3 and 4, as input parameters, the 3 will be captured by alpha and 4 by beta. The two input values will by calculated based on the formula defined inside the function as follows:

alpha = 3 + 4 = 7

gamma = 2 * 7 = 14

At last the function will return 14.

lbvjy [14]3 years ago
3 0

Answer:

function value == 2*([email protected] + [email protected])

Explanation:

int SomeFunc( /*in */ int alpha,  /* in */ int beta )

{

int gamma;

alpha = alpha + beta;

gamma = 2 * alpha;

return gamma;

}

The post-condition is useful for testing purposes. It represents what value the function SomFunc is expected to return at the time of program execution in a simplified manner.

For the given problem the post-condition is

function value == 2*([email protected] + [email protected])

Where @entry represents the value of alpha and beta at the moment when the function was called.

Note:  /*in */  it represents comment in c++ language and is ignored by the compiler

You might be interested in
. How is using 0 / 1 or true / false in specifying digital an abstraction?
andreyandreev [35.5K]

Answer:

Digital electronics involves 2 states which are abstracted as 0/1 or true/false.

Explanation:

Digital electronics involves 2 states. For TTL logic this corresponds to 0 Volt (0) or 5 Volt (1). Analyzing further, a  digital waveform has a square shape  (not necessarily a perfect square) with 2 levels denoting the two states, namely, true(1) or false(0). So a 0 or 1 is not actually absolute but 0 corresponds to voltage level below a threshold voltage whereas 1 corresponds to voltage level above a threshold voltage.

5 0
3 years ago
How do media and networks interact
valkas [14]

Answer:

Media are connected to networks that make information easier to access and pass on.

7 0
3 years ago
Declare a prototype for a function called isPrime that returns true or false and expects a single parameter named number of type
Sphinxa [80]

<u>Answer:</u>

<em>A prototype for a function called isPrime that returns is true.</em>

<u>Explanation:</u>

Function prototype is just a skeletal part of the function which has <em>a return type, function name and the respective parameters. </em>

There is a difference between function and function prototype.

Function is nothing but a <em>function definition</em>, where it actually has all the lines of codes which need to be processed when it is called. It can be invoked any number of times and anywhere within the<em> scope of the function</em>. <em> </em>

As per the given question, the prototype can be,

<em>bool isPrime (int); </em>

7 0
2 years ago
If I wanted to include a picture of a dog in my document, I could use _____. SmartArt WordArt clip art AutoCorrect
Taya2010 [7]

Answer:

clip art / smart art

Explanation:

6 0
3 years ago
Write a query to show the price reduced by 10% for all products that are tables or entertainment centers with a standard price g
IceJOKER [234]

Answer:

Below is the required code:

Explanation:

SELECT Product_Finish AS "Desk Finish",

avg(Standard_Price) AS "Average Price"

FROM Product_T

WHERE "Average Price">200

ORDER BY "Average Price" DESC;

8 0
3 years ago
Other questions:
  • The logical view of a database system refers tohow a user or programmer conceptually organizes and understands the data. how the
    5·1 answer
  • An individual is first with the network before they are authorized to access resources on the network A. countermeasure B. vulne
    11·1 answer
  • Which of these computers was marketed as a computer/game machine?
    15·2 answers
  • Instructions:Drag the tiles to the boxes to form correct pairs.
    11·2 answers
  • Use unit analysis to determine the unit of measurement for the expression 10x + 25y​
    8·1 answer
  • what notation system supports presenting the largest numbers using fewest digits; Binary, decimal or hexadecimal?
    11·1 answer
  • How often does colleges update the cost of attendance on their website?.
    13·1 answer
  • Design a hierarchy c hart or flowchart for a program that calculates the current balance in a savin gs account. The program must
    8·1 answer
  • WHO WANT P O I N T S.................................................
    9·1 answer
  • Which instruction is used to convert an integer value to float and push it onto the fpu stack?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!