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
Lera25 [3.4K]
3 years ago
9

Which of the following are valid calls to Math.max? 1. Math.max(1,4) 2. Math.max(2.3, 5) 3. Math.max(1, 3, 5, 7) 4. Math.max(-1.

5, -2.8f) A. 1, 2 and 4 B. 2, 3 and 4 C. 1, 2 and 3 D. 3 and 4
Computers and Technology
1 answer:
stiv31 [10]3 years ago
8 0

Answer:

1, 2 and 4

Explanation:

the Math.max() is the function in java which is used to compare the two values and it gives the maximum of two values.

it take only two argument and the data type can be int, float etc.

Math.max(1,4): it takes two int values and give the output 4. it is valid call.

Math.max(2.3, 5): it takes two values and give the output 5.0. it is valid call.

Math.max(1, 3, 5, 7): it takes 4 values which is wrong because function takes only two variables. it is not valid call.

Math.max(-1.5, -2.8f): it takes two values and give the output -1.5. it is valid call.

You might be interested in
5. Write a program to remove any duplicate letters from a word and display the new word maintaining the original order. For exam
dexar [7]

Answer:

word = input('Enter a single word: ', 's');

n = length(word);

nodupWord = [];

for i = 1:n

  dup = false;

  c = word(i);

  for j = 1:i-1

      if word(j) == c

          dup = true;

          break;

      end

  end

  if ~dup

      nodupWord = [nodupWord, c]; %add the non-duplicate char to end

  end

end

disp(['Adjusted word: ', nodupWord])

Explanation:

The code is in Python.

3 0
3 years ago
Explain the steps in starting the MS Access from the Start Menu.​
blondinia [14]

Explanation:

<em>As</em><em> </em><em>with</em><em> </em><em>most</em><em> </em><em>windows</em><em> </em><em>programs</em><em> </em><em>Access</em><em> </em><em>can</em><em> </em><em>be</em><em> </em><em>executed</em><em> </em><em>by</em><em> </em><em>navigation</em><em> </em><em>the</em><em> </em><em>start</em><em> </em><em>menu</em><em> </em><em>in</em><em> </em><em>the</em><em> </em><em>lower</em><em> </em><em>left</em><em> </em><em>hand</em><em> </em><em>corner</em><em> </em><em>of</em><em> </em><em>the</em><em> </em><em>windows</em><em> </em><em>desktop</em><em>. </em><em>To</em><em> </em><em> </em><em>Acess</em><em>,</em><em> </em><em>click</em><em> </em><em>on</em><em> </em><em>the</em><em> </em><em>start</em><em> </em><em>button</em><em>,</em><em> </em><em>then</em><em> </em><em>the</em><em> </em><em>programs</em><em> </em><em>menu</em><em> </em><em>then</em><em> </em><em>move</em><em> </em><em>to</em><em> </em><em>the</em><em> </em><em>Microsoft</em><em> </em><em>Office</em><em> </em><em>m</em><em>enu</em><em> </em><em>a.d</em><em> </em><em>finally</em><em> </em><em>click</em><em> </em><em>on</em><em> </em><em>the</em><em> </em><em>Microsoft</em><em> </em><em>Access</em><em> </em><em>menu</em><em> </em><em>item</em><em>. </em>

6 0
2 years ago
What happens if you create multiple accounts just to get points faster?
balandron [24]
I don’t think it will work sadly. You can probably accumulate points though on your pre existing account. Hope that helps!
8 0
3 years ago
Project Description The Department plans to purchase a humanoid robot. The Chairman would like us to write a program to show a g
artcher [175]

Answer:

C++ code is explained below

Explanation:

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

// Variables to store inputs

string robot_name = "Nao";

string visitor_name;

int age, first_num, second_num;

// Constant variable initialisation for programmer name

const string programmer_name = "XXXXXXXX";

// Constant variable initialisation for assignment number

const string assignment_num = "123546";

// Constant variable initialisation for due date

const string due_date = "16 August, 2019";

// Displaying robot's name as script

cout << "Hello, welcome to Montgornery College!";

cout << "My name is " << robot_name << " . May I have your name?" << "\n\n";

// Taking visitor's name as input from the visitor

cin >> visitor_name;

// Displaying vistor's name as script

cout << "\n\nNice to have your with us today, " << visitor_name << "! ";

cout << "Let me impress you with a small game.";

cout << "Give me the age of an important person or a pet to you. ";

cout << "Please give me only a number!" << "\n\n";

// Taking human age as input from the visitor

cin >> age;

// Displaying human's age as script

cout << "\n\nYou have entered " << age << ". If this is for a person,";

cout << " the age can be expressed as " << age << " years or ";

// Computing months, days, hours, minutes and seconds from age input

double months = age*12;

double days = months*30;

double hours = days*24;

double minutes = hours*60;

double seconds = minutes*60;

// Computing dogs and fish age from human's age

double dogs_age = 7*age;

double gold_fish_age = 5*age;

// Displaying months, hours, minutes, hours and seconds as script

cout << months << " months or about " << days << " days or";

cout << " about " << fixed << setprecision(0) << hours << " hours or about " << minutes;

cout << " or about " << fixed << setprecision(0) << seconds << " seconds. If this is for a dog.";

// Displaying dogs age and gold fish age as script

cout << " it is " << dogs_age << " years old in human age.";

cout << " If this is for a gold fish, it is " << gold_fish_age;

cout << " years old in human age" << "\n\n";

cout << "Let's play another game, " << visitor_name << "!";

cout << "Give me a whole number." << "\n\n";

// Taking first whole number from the visitor

cin >> first_num;

cout << "\nVery well. Give me another whole number." << "\n\n";

// Taking second whole number from the vistor

cin >> second_num;

// Computing sum and division for displaying in the script

double sum = first_num+second_num;

double division = first_num/second_num;

float floatDivision = (float)first_num/second_num;

// Displaying sum and division script

cout << "\nUsing the operator '+' in C++,";

cout << " the result of " << first_num << " + " << second_num;

cout << " is " << sum << ". Using the operator '/', the result ";

cout << "of " << first_num << " / " << second_num << " is " << division;

cout << "; however, the result of " << first_num << ".0 /" << second_num;

cout << ".0 is about " << floatDivision << "." << "\n\n";

cout << "Do you like the games, " << visitor_name << "?";

cout << " If you do, you can learn more by taking our classes.";

cout << ". If you don't, I am sad, You should talk to our Chairman!" << "\n\n";

// Displaying Programmer Name, Assignment Number and due date to output screen

cout << "Programmer Name : " << programmer_name << endl;

cout << "Assignment Number : " << assignment_num << endl;

cout << "Due Date : " << due_date << endl;

 

return 0;

}

4 0
3 years ago
Modify the WordCount program so it outputs the wordcount for each distinct word in each file. So the output of this DocWordCount
stepladder [879]

Answer and Explanation:

package PackageDemo;

import java.io.IOException;

import org.apache.hadoop.conf.Configuration;

import org.apache.hadoop.fs.Path;

import org.apache.hadoop.io.IntWritable;

import org.apache.hadoop.io.LongWritable;

import org.apache.hadoop.io.Text;

import org.apache.hadoop.mapreduce.Job;

import org.apache.hadoop.mapreduce.Mapper;

import org.apache.hadoop.mapreduce.Reducer;

import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;

import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

import org.apache.hadoop.util.GenericOptionsParser;

public class WordCount {

public static void main(String [] args) throws Exception

{

Configuration c=new Configuration();

String[] files=new GenericOptionsParser(c,args).getRemainingArgs();

Path input=new Path(files[0]);

Path output=new Path(files[1]);

Job j=new Job(c,"wordcount");

j.setJarByClass(WordCount.class);

j.setMapperClass(MapForWordCount.class);

j.setReducerClass(ReduceForWordCount.class);

j.setOutputKeyClass(Text.class);

j.setOutputValueClass(IntWritable.class);

FileInputFormat.addInputPath(j, input);

FileOutputFormat.setOutputPath(j, output);

System.exit(j.waitForCompletion(true)?0:1);

}

public static class MapForWordCount extends Mapper<LongWritable, Text, Text, IntWritable>{

public void map(LongWritable key, Text value, Context con) throws IOException, InterruptedException

{

String line = value.toString();

String[] words=line.split(",");

for(String word: words )

{

Text outputKey = new Text(word.toUpperCase().trim());

IntWritable outputValue = new IntWritable(1);

con.write(outputKey, outputValue);

}

}

}

public static class ReduceForWordCount extends Reducer<Text, IntWritable, Text, IntWritable>

{

public void reduce(Text word, Iterable<IntWritable> values, Context con) throws IOException, InterruptedException

{

int sum = 0;

for(IntWritable value : values)

{

sum += value.get();

}

con.write(word, new IntWritable(sum));

}

}

}

8 0
3 years ago
Other questions:
  • Fill in the blanks:(a)Every Java program must have at least one ______________.(b)The Java program is executed from _________ me
    12·1 answer
  • What type of program would use to create a personal budget?
    14·1 answer
  • You will start by doing a bit of research on viewfinders and LCD displays on digital cameras. After you feel that you have an un
    10·1 answer
  • To copy noncontiguous slides, open Slide Sorter view, click the first slide thumbnail, press and hold ____, click each additiona
    15·1 answer
  • A person who wants to buy a compact disc (cd) has just enough money to buy one, and chooses cd a instead of cd
    10·2 answers
  • A _____ is a unique name that identifies an Internet site. URL Browser AOL IA
    13·1 answer
  • Write a program that asks the user for a CSV of the NYC Open Data Film Permits: There is a sample file for June 2019 film permit
    9·2 answers
  • While doing research on the Internet, what kind of website should you avoid because the information may be biased?
    11·1 answer
  • Complete the problem about Olivia, the social worker, in this problem set. Then determine the telecommunications tool that would
    11·1 answer
  • You can use this keyboard shortcut to toggle the visibility of the command line. If for some reason your command line is hidden
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!