answer.
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
Aleonysh [2.5K]
2 years ago
10

Import java.util.scanner; public class sumofmax { public double findmax(double num1, double num2) { double maxval; // note: if-e

lse statements need not be understood to // complete this activity if (num1 > num2) { // if num1 is greater than num2, maxval = num1; // then num1 is the maxval. } else { // otherwise, maxval = num2; // num2 is the maxval. } return maxval; } public static void main(string [] args) { double numa = 5.0; double numb = 10.0; double numy = 3.0; double numz = 7.0; double maxsum = 0.0;
Computers and Technology
1 answer:
jeyben [28]2 years ago
6 0

Here you go,


Import java.util.scanner

public class SumOfMax {

   public static double findMax(double num1, double num2) {

       double maxVal = 0.0;

       // Note: if-else statements need not be understood to

       // complete this activity

       if (num1 > num2) { // if num1 is greater than num2,

           maxVal = num1; // then num1 is the maxVal.

       }

       else { // Otherwise,

           maxVal = num2; // num2 is the maxVal.

       }

       return maxVal;

   }

   public static void main(String[] args) {

       double numA = 5.0;

       double numB = 10.0;

       double numY = 3.0;

       double numZ = 7.0;

       double maxSum = 0.0;

       /* Your solution goes here */

       maxSum = findMax(numA, numB); // first call of findMax

       maxSum = maxSum + findMax(numY, numZ); // second call

       System.out.print("maxSum is: " + maxSum);

       return;

   }

}

/*

Output:

maxSum is: 17.0

*/

You might be interested in
Suppose a host has a 1-MB file that is to be sent to another host. The file takes 1 second of CPU time to compress 50%, or 2 sec
kozerog [31]

Answer: bandwidth = 0.10 MB/s

Explanation:

Given

Total Time = Compression Time + Transmission Time

Transmission Time = RTT + (1 / Bandwidth) xTransferSize

Transmission Time = RTT + (0.50 MB / Bandwidth)

Transfer Size = 0.50 MB

Total Time = Compression Time + RTT + (0.50 MB /Bandwidth)

Total Time = 1 s + RTT + (0.50 MB / Bandwidth)

Compression Time = 1 sec

Situation B:

Total Time = Compression Time + Transmission Time

Transmission Time = RTT + (1 / Bandwidth) xTransferSize

Transmission Time = RTT + (0.40 MB / Bandwidth)

Transfer Size = 0.40 MB

Total Time = Compression Time + RTT + (0.40 MB /Bandwidth)

Total Time = 2 s + RTT + (0.40 MB / Bandwidth)

Compression Time = 2 sec

Setting the total times equal:

1 s + RTT + (0.50 MB / Bandwidth) = 2 s + RTT + (0.40 MB /Bandwidth)

As the equation is simplified, the RTT term drops out(which will be discussed later):

1 s + (0.50 MB / Bandwidth) = 2 s + (0.40 MB /Bandwidth)

Like terms are collected:

(0.50 MB / Bandwidth) - (0.40 MB / Bandwidth) = 2 s - 1s

0.10 MB / Bandwidth = 1 s

Algebra is applied:

0.10 MB / 1 s = Bandwidth

Simplify:

0.10 MB/s = Bandwidth

The bandwidth, at which the two total times are equivalent, is 0.10 MB/s, or 800 kbps.

(2) . Assume the RTT for the network connection is 200 ms.

For situtation 1:  

Total Time = Compression Time + RTT + (1/Bandwidth) xTransferSize

Total Time = 1 sec + 0.200 sec + (1 / 0.10 MB/s) x 0.50 MB

Total Time = 1.2 sec + 5 sec

Total Time = 6.2 sec

For situation 2:

Total Time = Compression Time + RTT + (1/Bandwidth) xTransferSize

Total Time = 2 sec + 0.200 sec + (1 / 0.10 MB/s) x 0.40 MB

Total Time = 2.2 sec + 4 sec

Total Time = 6.2 sec

Thus, latency is not a factor.

5 0
1 year ago
python A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun
e-lub [12.9K]

Answer:

// program in Python.

#read year

i_year=int(input("Please Enter a year:"))

#check leap year

if((i_year % 4 == 0 and i_year % 100 != 0) or (i_year % 400 == 0)):

   print("{} is a leap year.".format(i_year))

else:

   print("{} is not a leap year.".format(i_year))

Explanation:

Read year from user and assign it to variable "year".If year is completely divisible by 4 and not divisible by 100 or year is completely divisible by 400 then year is leap year otherwise year is not a leap year.

Output:

Please Enter a year:2003                                                                                                          

2003 is not a leap year.

3 0
2 years ago
Read 2 more answers
Write a copy assignment operator for CarCounter that assigns objToCopy.carCount to the new objects's carCount, then returns *thi
Olin [163]

The following cose will be used to copy assignment operator for CarCounter

<u>Explanation:</u>

Complete Program:

#include <iostream>

using namespace std;

class CarCounter

{

public:

CarCounter();

CarCounter& operator=(const CarCounter& objToCopy);

void SetCarCount(const int setVal)

{

 carCount = setVal;

}

int GetCarCount() const

{

 return carCount;

}

private:

int carCount;

};

CarCounter::CarCounter()

{

carCount = 0;

return;

}

// FIXME write copy assignment operator

/* Your solution goes here */

CarCounter& CarCounter::operator=(const CarCounter& objToCopy)

{

if(this != &objToCopy)

 carCount = objToCopy.carCount;

return *this;

}

int main()

{

CarCounter frontParkingLot;

CarCounter backParkingLot;

frontParkingLot.SetCarCount(12);

backParkingLot = frontParkingLot;

cout << "Cars counted: " << backParkingLot.GetCarCount();

cout << endl << endl;

system("pause");

return 0;

}

5 0
2 years ago
Olivia creates a personal budget. She enters her current savings account balance in cell D3. In cell A3, she calculates her inco
alexdok [17]

Answer is :

=D3+A3-B3

These Cell address contain following statement:

D3= Olivia saving account balance

A3= Olivia 3 month income

B3= Olivia 3 month expense

so, Expense are also deducted from income and income is added into saving balance.

In this situation we are use this formula:

=D3+A3-B3

5 0
1 year ago
Respond to the following in a paragraph of no less than 125 words. Describe the steps to active listening.
Agata [3.3K]

Answer

• Maintaining eye contact

• Paying attention in the talk

• Listening without jumping to conclusion

• Formulating a picture in mind as you listen

• Avoid interruption to suggest solutions

• Asking clarification when the speaker has paused

• Asking questions to improve understanding

• Understanding the mood of the speaker

• Giving the appropriate feedback

Explanation

A person can improve his active listening skills by being aware of his or her personal style of communicating. A good listener is productive  and able to influence others when talking because he or she will have mastered the technique of persuading and negotiating with audience when talking. The journey to becoming an active listener is through paying attention, showing that you are following the speaker ,providing good feedback, avoiding judging the speaker and providing the appropriate feedback.



8 0
2 years ago
Read 2 more answers
Other questions:
  • Kleene star of {1} generates {1, 11, 111, 1111, 11111……}.<br> True<br> False
    12·1 answer
  • Initialize the list short_names with strings 'Gus', 'Bob', and 'Zoe'. Sample output for the givenprogram:Gus Bob Zoeshort_names
    13·1 answer
  • Sara is having a tough time finding the cause of a problem on a computer she is troubleshooting. She found a possible problem bu
    15·1 answer
  • A triangular number is a number that is the sum of the integers from 1 to some integer n. Thus 1 is a triangular number because
    11·1 answer
  • Suppose that we have a set of activities to schedule among a large number of lecture halls, where any activity can take place in
    8·1 answer
  • Jen is trying to discover if a motor has failed windings. What sort of test can she do.
    6·1 answer
  • You can deal with gaps in an PHP array in all but one of the following ways. Which one is it? a. Use the array_values() function
    14·1 answer
  • #Write a function called "in_parentheses" that accepts a
    5·1 answer
  • (Java) Which of the following code segments correctly declare a Strings and gives it a value of "fortran".
    12·1 answer
  • A homeowner uses a smart assistant to set the house alarm, get packages delivery updates, and set time on the outdoor lights. Wh
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!