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
makkiz [27]
3 years ago
10

Write the statement that includes a friend function named before in the class dateType that takes as parameters two objects of t

ype dateType and returns true if the date represented by the first object comes before the date represented by the second object; otherwise, the function returns false.
Computers and Technology
1 answer:
Lerok [7]3 years ago
8 0

Answer:

In opp friend function is a function that gives the same access to private and protected data. It is declared in class that is granting access.

Explanation:

#include<iostream.h>

using namespace std;

class Sum

{

 int a, b, add;

 public:

 void input()  

{

 cout << "Enter the value of l and m:";

 cin >> l>>m;     taking input from users

}

 friend void add(sum &t);

 void display()  

{

  cout << "The sum is :" << z;

}

};

 void add(sum & p)  

{

  p.add = p.a + p.b;

}

 int main()  

{

  sum p1;

  p1.input();

  add(p1);

  p1.display();

  return false;  

if(display==5)  

{

 return true;  //true is returned if sum is equal to 5

}

else        //if they are not the same

{

 return false;

}

}

You might be interested in
Create an application containing an array that stores 10 integers. The application should call five methods that in turn (1) dis
tensa zangetsu [6.8K]

Answer:

  1.     public class Main {
  2.    public static void main(String[] args) {
  3.        int myArray[] = {3, 7, 2, 5, 9,11, 24, 6, 10, 12};
  4.        int myArray2 [] = {1, 2, 3, 4 ,5};
  5.        displayValue(myArray);
  6.        reverseDisplay(myArray);
  7.        displaySum(myArray);
  8.        displayLess(myArray, 10);
  9.        displayHighAvg(myArray);
  10.        displayBoth(myArray, myArray2);
  11.    }
  12.    public static void displayValue(int arr[]){
  13.        for(int i = 0; i < arr.length; i++){
  14.            System.out.print(arr[i] + " ");
  15.        }
  16.        System.out.println();
  17.    }
  18.    public static void reverseDisplay(int arr[]){
  19.        for(int i = arr.length-1; i >= 0; i--){
  20.            System.out.print(arr[i] + " ");
  21.        }
  22.        System.out.println();
  23.    }
  24.    public static void displaySum(int arr[]){
  25.        int sum = 0;
  26.        for(int i = 0; i < arr.length; i++){
  27.            sum += arr[i];
  28.        }
  29.        System.out.println(sum);
  30.    }
  31.    public static void displayLess(int arr[], int limit){
  32.        for(int i = 0; i < arr.length; i++){
  33.            if(arr[i] < limit){
  34.                System.out.print(arr[i] + " ");
  35.            }
  36.        }
  37.        System.out.println();
  38.    }
  39.    public static void displayHighAvg(int arr[]){
  40.        int sum = 0;
  41.        for(int i = 0; i < arr.length; i++){
  42.            sum += arr[i];
  43.        }
  44.        double avg = sum / arr.length;
  45.        for(int i = 0; i < arr.length; i++){
  46.            if(arr[i] > avg){
  47.                System.out.print(arr[i] + " ");
  48.            }
  49.        }
  50.        System.out.println();
  51.    }
  52.    public static void displayBoth(int arr1[], int arr2 []){
  53.        for(int i = 0; i < arr2.length; i++){
  54.            for(int j = 0; j < arr1.length; j++){
  55.                if(arr1[j] == arr2[i]){
  56.                    System.out.print(arr1[j] + " ");
  57.                }
  58.            }
  59.        }
  60.        System.out.println();
  61.    }
  62. }

Explanation:

There are five methods written to solve all the problems stated in the question.

Method 1 : displayValue    (Line 15 - 21)

This is the method that take one input array and use the print() method to display the all the elements in the array.

Method 2: reverseDisplay (Line 23 - 26)

This method will take one input array and print the value in the reverse order. We just need to start with the last index when running the for-loop to print the value.

Method 3: displaySum (Line 31 - 37)

This method will take one input array and use a for-loop to calculate the total of the values in the array.

Method 4: displayLess (Line 39 - 47)

This method will take one two inputs, a array and a limit. We use the limit as the condition to check if any value less than the limit, then the value will only be printed.

Method 5: displayHighAvg (Line 50 - 64)

This method will take one input array and calculate the average. The average will be used to check if any element in the array higher than it, then the value will only be printed.

Method 6: displayBoth  (Line 66 - 75)

This method will take two input arrays and compare both of them to find out if any value appears in both input arrays and print it out.

3 0
3 years ago
What aspect do you need to keep in mind when you add images in a word document?
Trava [24]

While adding images in word you cant do anything with the picture unless you add Wrap text. Usually the wrap text icon is always beside the pic or you can go to Layout or format and select from there. If you're adding a photo between an article, position  works well. You can change the wrap text and position choices according to your needs.

Hope this helps, Please mark as brainliest

5 0
3 years ago
Read 2 more answers
A computer emergency response team is called at midnight to investigate a case in which a mail server was restarted. After an in
ANEK [815]

<u>Answer</u>:   B. Identify the source of the active connection

<em>Any problem can be fixed only finding of the source of it. We can fix a problem in ‘n’ number of ways but it might again come back if source of it is not identified.</em>

<u>Explanation:</u>

Identify the source of the active connection is the NEXT step the team should take. It is very similar to our human body.

If the infection is coming in the body again and again and gets fixed in the treatment, the reason for come - back will be identified so that it does not <em>lead to unnecessary treatment. </em>

In a similar way, if source are identified then the problem of come-back can be avoided. <em>So option B would be the right choice.</em>

4 0
4 years ago
Compare and contrast the various write strategy used in cache technologies<br>​
scZoUnD [109]

Answer:

The abiotic factors are non-living factors in an ecosystem that affect the organisms and their lifestyle. In this case, low temperature and low humidity lead to the conditions that are unfavorable for birds. So, the birds must adapt to these factors by hiding the food in the caches.

Explanation:

8 0
3 years ago
"Look at the following code. Which line will cause a compiler error?
crimeas [40]

Answer:

i got a feeling c

Explanation:

5 0
3 years ago
Other questions:
  • Consider an interface p ublic interface NumberFormatter { String format (in n); } Provide four classes that implement this inter
    15·1 answer
  • Everyone’s favorite speedy blue hedgehog recently returned to his 2D origins in a critically acclaimed side-scrolling game. What
    8·2 answers
  • Create a function named PrintStudents, which takes a string input filename and an integer minimum score value and a string outpu
    14·1 answer
  • Computer ________ involves identifying, extracting, preserving, and documenting computer evidence. a. inoculation b. forensics c
    8·1 answer
  • Which of the following is the most effective password?
    15·2 answers
  • What are 6 steps to take to figure out what's wrong with your computer?
    5·1 answer
  • Which one of the following items is an example of software?
    5·1 answer
  • One shortcoming of rapid application development (RAD) is _____.
    9·1 answer
  • The Danger zone around a robot is?
    13·2 answers
  • I NEED THIS DONE NOW ASAP, PLS HELP ME
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!