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
bearhunter [10]
3 years ago
5

Look at the code below and use the following comments to indicate the scope of the static variables or functions. Place the comm

ent below the relevant line.
Module scope
Class scope
Function scope

#include
2
3 static const int MAX_SIZE=10;
4
5 // Return the max value
6 static double max(double d1)
7 {
8 static double lastMax = 0;
9 lastMax = (d1 > lastMax) ? d1 : lastMax;
10 return lastMax;
11 }
12
13 // Singleton class only one instance allowed
14 class Singleton
15 {
16 public:
17 static Singleton& getSingleton() { return theOne; }
18 // Returns the Singleton
19
Computers and Technology
1 answer:
astra-53 [7]3 years ago
7 0

Answer:

Explanation:

#include

static const int MAX_SIZE=10; //Class scope

// Return the max value

static double max(double d1) //Function scope

{

static double lastMax = 0;  //Function scope

lastMax = (d1 > lastMax) ? d1 : lastMax; //Function scope

return lastMax; //Module Scope

}

// Singleton class only one instance allowed

class Singleton  

{

public:

static Singleton& getSingleton()  //Function scope

{

return theOne; //Module Scope

}

// Returns the Singleton

You might be interested in
3. A hyperlink is important because it allows you to ___________. (1 point) click on the link to go directly to a website insert
ikadub [295]
A hyperlink is a link that can direct a person to another website when clicked. So the answer would click on the link to go directly to a website. To insert an image or sound you would use something else. And a hyperlink doesn't restrict a person to just the publisher information. I hope this helps!
3 0
3 years ago
Which tab in the Tasks view is used to modify the Current View?
Kay [80]

Answer:

It is view

Explanation:

To change the Inbox view, click the “View” tab in the Ribbon.

Then click the “Change View” button in the “Current View” group.

Then select the name of any of the views listed in the menu that appears to apply them to your inbox.

8 0
4 years ago
Read 2 more answers
You are creating a web page as part of a science project. Your role is to put your data on the webpage. You tracked the growth o
zysi [14]

The best way to represent this information on a web page is to put it on a table. I would use the <table> tag to create the table element. The <tr> tag for creating a series of row elements, the <td> tag to create cell divisions and the <br> tag for a line break.

I would use 10 rows for different plants and 8 columns for different points in time.

<em>Hope this helps :)</em>

7 0
2 years ago
Read 2 more answers
Which of the following is involved in creating technical communication?
Eva8 [605]

Answer:

(D) All of these answers are correct.

Explanation:

Technical communication is the transmission of any specialized information, be it scientific reports, medical procedures, and any other professional information. Technical information are passed for a specific a purpose are factual, precise, concise and clear. An electrical engineer filling out a standardized form, a webmaster revising a company web page, a company secretary writing a letter to a customer and a manager preparing an oral presentation are all conveying technical information.

8 0
3 years ago
Array Challenge Have the function ArrayChallenge (arr) take the array of numbers stored in arr and return the string true if any
vampirchik [111]

Answer:

The code is given as follows,

Explanation:

Code:

#include <stdio.h>

#include <string.h>  

int n; //to store size of array  

char* ArrayChallenge(int arr[]) //function returns string true or false

{

  int i, j;

  int sum = 0;

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

  {

      sum = sum + arr[i]; //count sum

  }  

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

  {

      for(j = i+1; j < n; j++) //loop for every two elements in array

      {

          if(arr[i]*arr[j] > 2*sum) //check if proudct of two elements > 2 times sum

          {

              printf("\n%d x %d = %d, 2xSum = %d\n", arr[i], arr[j], arr[i]*arr[j], 2*sum);

              return "true"; //If proudct of two elements > 2 times sum. return true

          }

      }

  }

  return "false"; // If proudct of two elements < 2 times sum. return false

}  

int main()

{  

  printf("\nEnter size of array: ");

  scanf("%d", &n); //read size of array

  int A[n]; //array of size n

  printf("\nEnter array elements: ");

  int i;

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

  {

      scanf("%d", &A[i]); //read array from stdin

  }

  printf("%s\n",ArrayChallenge(A)); //ccall function and print answer

 

  return 0;

}

6 0
3 years ago
Other questions:
  • If everyone's choice for their computer printer were an hp laserjet 4100, there would be a ___ preference segment in the compute
    8·1 answer
  • The negotiation by the transport layer at the sender with the transport layer at the receiver to determine what size packets sho
    14·1 answer
  • 3. By eliminating data redundancy, you're enforcing data A. validation. B. integrity. C. consistency. D. accuracy.
    14·2 answers
  • You are going to write a program for Computer test which will read 10 multiple choice questions from a file, order them randomly
    11·1 answer
  • What is the first step to apply the line and page breaks options to groups of paragraphs in a Word document?
    10·2 answers
  • Identifying How to Print a Record on One Page
    5·1 answer
  • Edhesive 4.6 lesson practice <br><br> Range is an example of a_______.
    10·2 answers
  • It is for employees to make mistakes that compromise the security of an organization’s computer devices and sensitive informatio
    10·2 answers
  • From which Menu option you can change page setup in MS Word​
    8·1 answer
  • What is the difference between DWT and CWT?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!