Computer Systems: A Programmer's Perspective (3rd Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
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
Which tool takes the 2 provided input datasets and produces the following output dataset? Input 1: Record First Last Output: 1 Enzo Cordova Record 2 Maggie Freelund Input 2: Record Frist Last MI ? First 1 Enzo Last MI Cordova [Null] 2 Maggie Freelund [Null] 3 Jason Wayans T. 4 Ruby Landry [Null] 1 Jason Wayans T. 5 Devonn Unger [Null] 2 Ruby Landry [Null] 6 Bradley Freelund [Null] 3 Devonn Unger [Null] 4 Bradley Freelund [Null] OA. Append Fields O B. Union OC. Join OD. Find Replace Clear selection
What are the similarities and differences between massively parallel processing systems and grid computing. with references
Modular Program Structure. Analysis of Structured Programming Examples. Ways to Reduce Coupling. Based on the given problem, create an algorithm and a block diagram, and write the program code: Function: y=xsin⁡x Interval: [0,π] Requirements: Create a graph of the function. Show the coordinates (x and y). Choose your own scale and show it in the block diagram. Create a block diagram based on the algorithm. Write the program code in Python. Requirements: Each step in the block diagram must be clearly shown. The graph of the function must be drawn and saved (in PNG format). Write the code in a modular way (functions and the main part should be separate). Please explain and describe the results in detail.
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
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning