Computer Systems: Program... -Access
Computer Systems: Program... -Access
3rd Edition
ISBN: 9780134071923
Author: Bryant
Publisher: PEARSON
Question
Book Icon
Chapter 6.2, Problem 6.8PP
Program Plan Intro

Given Information:

Three different functions are given:

Function-1:

/*clear1 function with a pointer variable and integer as arguments */

void clear1 ( point *p, int n)

{

//variable declaration

int i,j;

//traverse throughout the structure

for(i=0;i<n;i++)

for(j=0;j<3;j++)

  //multiply the point with velocity

  p[i].vel[j]=0;

      for(j=0;j<3;j++)

  //multiply the point with acceleration

  p[i].acc[j]=0;

}

}

Function-2:

/*clear2 function with a pointer variable and integer as arguments */

void clear2 ( point *p, int n)

{

//variable declaration

int i,j;

//traverse throughout the structure

for(i=0;i<n;i++)

for(j=0;j<3;j++)

  //multiply the point with velocity

  p[i].vel[j]=0;

  //multiply the point with acceleration

  p[i].acc[j]=0;

}

Function-3:

/*clear3 function with a pointer variable and integer as arguments */

void clear3 ( point *p, int n)

{

//variable declaration

int i,j;

//traverse throughout the structure

for(j=0;j<3;i++)

for(i=0;i<n;j++)

  //multiply the point with velocity

  p[i].vel[j]=0;

     for(i=0;i<n;j++)

  //multiply the point with acceleration

  p[i].acc[j]=0;

}

}

Blurred answer
Students have asked these similar questions
PROBLEM 12. [TIME ALLOWED = 5 MINUTES]   Give the contrapositive and converse of the following proposition:   “If it is sunny, then I will go swimming.”
4 We consider the following initial value problem for two functions y(x),z(x): 0=y′′+(y′+6y)cos(z), 5z′=x^2+y^2+z^2, where 0≤x≤2 and y(0)=1.7, y′(0)=−2.7, z(0)=0.5. Approximate the solution of this initial value problem using Euler's method with 100 steps. (use Maple) What approximation value do you obtain for y(2) and z(1)?
3. The diagram below shows the main land routes for vehicular traffic between points A and G in a city. The figures in the arcs represent the cost of traveling between each pair of nodes.   a) Manually apply Dijkstra's algorithm to find the cheapest route between A and G (visited nodes and total distance). b) Formulate a linear programming problem in extended form, to determine the shortest route to travel from A to G. Do not use subscripts, name 14 variables, for example XFE would be the variable that indicates that the arc from F to E is used. c) If there is a fixed cost for visiting each node, modify the formulation of the problem to include said fixed cost in the objective function, and the variables and restrictions that are required.     NODE A B C D E F G FIXED COST 25 18 32 20 28 18 34
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole