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
just olya [345]
3 years ago
15

Write a method called average that accepts two integer parameters and returns their average as a floating point value: Overload

the average method you just wrote to accept four integer parametersand return their average:HTML EditorKeyboard Shortcuts
Computers and Technology
1 answer:
kherson [118]3 years ago
5 0

Answer:

   public static double average(int num1, int num2){

       return (num1+num2)/2;

   }

   public static double average(int num1, int num2, int num3, int num4){

       return (num1+num2+num3+num4)/2;

   }

Explanation:

  • In the first instance, the method average() accepts two parameters and returns their average
  • In the second instance the method accepts four parameters and returns their average
  • The concept of method overloading allows a program to have more than method with the the same name but with different parameters list like we find in this example
You might be interested in
C++
Nookie1986 [14]

Answer:

Following are the code to the given question:

#include <iostream>//header file

using namespace std;

class Window //defining a class Window

{

private:

int width, height;//defining integer variable

public:

friend ostream& operator << (ostream& stm, Window& width)//defining a friend function that takes two parameters

{

return stm<<"a ("<<width.width<<" x "<<width.height<<") window"; //use return keyword that return its values

}  

Window(int width, int height): width(width), height(height)//defining parameterized constructor that inherit width and height in its parameters  

{}

};

int main() //Main method

{

Window w(80,90);//calling class constructor

cout<<w;//print object value

return 0;

}

Output:

a (80 x 90) window

Explanation:

In the above code, a class "Window" is defined that uses a friend function "ostream& operator" is declared that uses the "ostrea&" as a data type to hold two-variable "stm and w" in its parameter, and declared the parameterized constructor to hold value by inheriting width and height in its parameters.

Inside the main method, a class object is created that calls the constructor and uses the print method to print object value.

7 0
4 years ago
A _____ is a web site that allows users to edit and change its content easily and rapidly.
Ivenika [448]

The web site you are looking for is Wiki, web application that allows users to easily add and edit content on a web page.

7 0
3 years ago
You asked your colleague to provide feedback on a blog post you recently wrote. When they sent you their feedback, they made edi
Soloha48 [4]

Explanation:

This question can have both answers that is yes as well as no.

1.Yes, it can serve as an editor who completes your content and ensures it will read well to others.

2. No, the editor should have tracked changes which would have shown you where they would apply recommended edits.

7 0
4 years ago
How to add links in HTML? ​
saveliy_v [14]

Answer:

<a href="url">link text</a>

6 0
2 years ago
You review a design written by somebody else for an application and you find these: - an interface Shape with a method draw() -
laila [671]

This is the Composite pattern, one of the "Gang-of-Four" design patterns (check out their book!).

6 0
3 years ago
Other questions:
  • Jessica has pinned her favorite applications as icons on her desktop. She always clicks on these icons to work on them. Which us
    10·1 answer
  • Longer speeches should be separated into the paragraphs of:
    9·1 answer
  • To reach fifty million users, it took _____.
    10·2 answers
  • Kendall receives an email stating that a leading computer company is giving away free computers, asking her to forward the email
    15·1 answer
  • Write a main method that prompts the user for an integer between 1 &amp; 20 (inclusive). If the user enters an invalid number, p
    8·1 answer
  • Which kind of file would be hurt most by lossy compression algorithm
    8·2 answers
  • What are the benefits of maintaining your vehicle?
    5·2 answers
  • Are scripted languages easier or more difficult to port than programming languages? Why?
    6·1 answer
  • Sami is creating a web page for her dog walking business. Which item will set the theme for her page? Background color Heading c
    11·2 answers
  • Complete the following sentences.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!