ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 03 May 2017 My Price 8.00

Let the function fun be defined

  1. Let the function fun be defined as:

 

int fun(int *k)

{

   *k += 4;

   return 3 * (*k) – 1;

}

 

Suppose fun is used in a program as follows:

void main()

{

   int i = 10, j = 10, sum1, sum2;

   sum1 = (i/2) + fun(&i);

   sum2 = fun(&j) + (j/2);

}

 

What are the values of sum1 and sum2:

  1. if the operands in the expressions are evaluated left to right?
  2. if the operands in the expression are evaluated right to left?

 

Question-2 

 Rewrite the following pseudocode segment using a loop structure for in each of the following languages: Fortran 95, Ada and Java

pseudocode segment --

k= (j +13)/27

loop:

if k > 10 then goto out

k = k + 1

i = 3 * k - 1

goto loop

out:

out:

Fortran 95 Ada and Java

 

Answers

(11)
Status NEW Posted 03 May 2017 03:05 AM My Price 8.00

-----------

Not Rated(0)