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
stepan [7]
3 years ago
14

Write the definitions for three functions named max. Each receives two parameters, of the same type, and returns the larger of t

he two values. Define one of these functions to apply to type double, another to type int and a third to type char.
Computers and Technology
1 answer:
AnnZ [28]3 years ago
5 0

Answer:

public double max(double m, double n)

{

if (m>=n)

return m;

else

return n;

}

public int max(int m, int n)

{

if (m>=n)

return m;

else

return n;

}

public char max(char m, char n)

{

if (m>=n)

return m;

else

return n;

}

Explanation:

In each of the three methods declarations (Java) above, we are comparing two variables. m and n. The question did not specify what should happen when both variables are the same (i.e. m = =n). We make an assumption and set the condition to be if(m>=n) m should be returned as the greater.

You might be interested in
Define what is meant by an entity in a data model. How should an entity be named? What information about an entity should be sto
AURORKA [14]

Answer:

Check the explanation

Explanation:

An entity can be a person, place, thing, or even an event about which data is collated and stored. Entities names usually are nouns.

The Entity Data Model (EDM) is an extensive model of the Entity-Relationship model which identifies the conceptual model of the data using a variety of modeling technique. It acan also be termed as a set of concepts that illustrates data structure, regardless of its stored form.

The Information stored or can be stored in a CASE repository regarding an entity includes:

Name

Definition

Special Notes

7 0
3 years ago
Which is the following should be selected in the paragraph dialogue box to prevent page break from occurring within a paragraph
Savatey [412]

Answer:

Explanation: keep lines together

6 0
3 years ago
Do the police check your mobile device during police checks?
Marat540 [252]
it depends............

4 0
3 years ago
Read 2 more answers
Pig Latin is a nonsense language. To create a word in pig Latin, you remove the first letter and then add the first letter and "
LUCKY_DIMON [66]

Answer:

Hi there  Sandrathompson5661!  

Using Java as the language for implementation, the PigLatin translation program can simply be coded as shown below. The program uses the Scanner module in java utils package to prompt the user for input of word(s) and splits the input with any of the matching delimiters. The rule to swap the first character and append it to the end with an “ay” for a normal word, or the appending of “yay” for a vowel word, is then applied. The result is printed on the screen before the program exits.

Explanation:

import java.util.Scanner;

public class PigLatin {    

 public static void main(String[] args)     {        

   char[] delimiterChars = { ' ', ',', '.', ':', ';', '\t' };        

   String[] words_array;        

   Scanner words = new Scanner(System.in);        

   System.out.println("Please enter a word (for multiple words use any of the following delimiters {' ', ',', '.', ':', ';', '\t' }): ");        

   String input_words = words.nextLine();        

   words_array = input_words.split("[,\\s\\-:.;' '\\\t]");  

   System.out.println("PigLatin translation: ");        

   for (int i=0; i<words_array.length; i++) {

     System.out.println(makePigLatin(words_array[i]));        

   }    

 }      

 public static String makePigLatin(String word)     {        

    String vowels = "aeiou";        

    if (vowels.indexOf(Character.toLowerCase(word.charAt(0))) != -1) {          

       word = word + "yay";        

    }        

    else {          

       word = word.substring(1, word.length()) + word.charAt(0) + "ay";        

    }        

    return word;      

 }

}

7 0
3 years ago
Write a function named "json_filter" that takes a JSON formatted string as a parameter in the format of an array of objects wher
7nadin3 [17]

Answer:

Check the explanation

Explanation:

kindly check the well written code below to get the solution to your question.

import json

def json_filter(input_string):

   jsonFormat = json.loads(input_string)

   result = []

   for obj in jsonFormat:

       if obj["temperature"] > 38.46:

           result.append(obj)

   return json.dumps(result)

7 0
3 years ago
Other questions:
  • You can write as many constructors for a class as you want, as long as they all have different ____ lists.
    8·1 answer
  • What hernia repair codes can be reported with add-on code 49568?
    6·1 answer
  • Does Android have text-to-voice?
    11·1 answer
  • For the following scenario, indicate whether the action is a good practice or bad practice for safeguarding your personally iden
    6·1 answer
  • Weak Induction
    8·1 answer
  • Please someone helpp
    12·2 answers
  • Can anyone help and write a sample answer to this please x
    7·1 answer
  • Describe how a black and white image could be represented in binary
    11·2 answers
  • Select the correct answer from each drop-down menu.
    12·1 answer
  • Why is internet download speed slower on a computer vs phone
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!