19.11.2020

SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN JAVA.Assume that the classes listed in the Java Quick Reference have been imported where appropriate.Unless otherwise noted in the question, assume that parameters in method calls are not null and that methods are called only when their preconditions are satisfied.In writing solutions for each question, you may use any of the accessible methods that are listed in classes defined in that question. Writing significant amounts of code that can be replaced by a call to one of these methods will not receive full credit.This question involves computing the greatest common factor between two positive integers and using greatest common factors to reduce fractions. You will write two methods in the NumberSystem class that follows.public class NumberSystem{/** Precondition: a and b are positive integers.* Returns the greatest common factor of a and b, as described in part (a).*/public static int gcf(int a, int b){ /* to be implemented in part (a) */ }/** Precondition: numerator and denominator are positive integers.* Reduces the fraction numerator / denominator* and prints the result, as described in part (b).*/public static void reduceFraction(int numerator, int denominator){ /* to be implemented in part (b) */ }}The greatest common factor (GCF) of two integers a and b is the largest integer that divides evenly into both a and b. For example, the GCF of 8 and 12 is 4.The greatest common factor can be computed using the following rules.Case I: If a is evenly divisible by b, then the GCF is b.Case II: If a is not evenly divisible by b, then the GCF of a and b is equal to the GCF of b and the remainder when a is divided by b.If the rule in case II is repeatedly applied, it is guaranteed to eventually result in case I. Consider the following examples.Example 1In determining the GCF of 30 and 3, case I applies because 30 is evenly divisible by 3. Therefore, the GCF of 30 and 3 is 3.Example 2In determining the GCF of 3 and 30, case II applies because 3 is not evenly divisible by 30. The GCF of 3 and 30 will be equal to the GCF of 30 and the remainder when 3 is divided by 30, or 3.In determining the GCF of 30 and 3, case I applies because 30 is evenly divisible by 3. The GCF of 30 and 3 is 3, and therefore the GCF of 3 and 30 is also 3.Example 3In determining the GCF of 24 and 9, case II applies because 24 is not evenly divisible by 9. The GCF of 24 and 9 will be equal to the GCF of 9 and the remainder when 24 is divided by 9, or 6.In determining the GCF of 9 and 6, case II applies because 9 is not evenly divisible by 6. The GCF of 9 and 6 will be equal to the GCF of 6 and the remainder when 9 is divided by 6, or 3.In determining the GCF of 6 and 3, case I applies because 6 is evenly divisible by 3. The GCF of 6 and 3 is 3, and therefore the GCF of 24 and 9 is also 3.Example 4In determining the GCF of 7 and 3, case II applies because 7 is not evenly divisible by 3. The GCF of 7 and 3 will be equal to the GCF of 3 and the remainder when 7 is divided by 3, or 1.In determining the GCF of 3 and 1, case I applies because 3 is evenly divisible by 1. The GCF of 3 and 1 is 1, and therefore the GCF of 7 and 3 is also 1.(a) The gcf method returns the greatest common factor of parameters a and b, as determined by case I and case II. Write the gcf method below. You are encouraged to implement this method recursively./** Precondition: a and b are positive integers.* Returns the greatest common factor of a and b, as described in part (a).*/public static int gcf(int a, int b)

. 15

Step-by-step answer

17.02.2022, solved by verified expert
Unlock the full answer
3 students found this answer . helpful

Public String getHostName()

{

Return hostName;

}

Public String setAddress(String ad)

{

address=ad;

}

Public String invite(String nme)

{

Return “Dear “+nme+“, please attend my event at ”+address+“. See you

then, ”+hostName+ “.”

}

Explanation:

It is was helpful?

Faq

Computers and Technology
Step-by-step answer
P Answered by Specialist

Check the explanation

Explanation:

Player 1 Coin

Player 2 Coin

Player 1

Player 2

Round

Count at

Count at

Player

Player

Coin

Coin

Number

Beginning of

Beginning of

1

2

Outcome

Count at

Count at

Round

Round

Spends

Spends

End of

End of

Round

Round

Off-by-

one,

10 - 1

10

10

2

player 2

10 - 2

+

= 8

1

gains 1

= 10

coin

Same,

10 - 2

2

8

10

2

2

player 2

-

gains 1

6

+

=

1

=

9

coin

Off-by-

two,

6 - 1

+

3

6

9

3

player 1

2

9 - 3

gains 2

=

=

7

6

coins

Same,

4

7

6

2

2

player 2

7 - 2

6 - 2+

gains 1

=

5

=

coin

5

Kindly check the attached image below to see the well arranged table to solve the above question.


SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN JAVA. Assume that the classe
Computers and Technology
Step-by-step answer
P Answered by PhD
Answer: c. internet of things.

Explanation:
The technology that combines with the 5G capabilities which was used in the monitoring of the shopping trends is the Internet of Things.
- Internet of Things (IoT) simply means when there are interrelated, and internet-connected objects which collects and transfers data without human intervention through a wireless network or makes use of sensors.
- This is being used by the retailer in the example given to monitor the shopping trends. In conclusion, the correct option is Internet of Things.
Computers and Technology
Step-by-step answer
P Answered by PhD

The solution that would help the client pool their data together is a data integration solution. This type of solution allows for the collection and consolidation of data from various sources into a single, unified database. This can be achieved through a variety of methods, including Extract, Transform, Load (ETL) processes, data warehousing, and master data management. By implementing a data integration solution, the client will be able to access and analyze their data more efficiently, leading to better insights and informed decision-making.

Computers and Technology
Step-by-step answer
P Answered by Master

The correct answer to the following question will be "Auto-encoder".

Explanation:

It is indeed a form of artificial neural net that utilizes in an unmonitored way to practice successful information coding.

The objective of such an auto-encoder seems to be to acquire a specification (encoding) for a collection of information, usually for reducing degrees of freedom, by teaching the channel to overlook the "noise" message.Learn a few things of endogenous model representation and then use it to recreate the object.
Computers and Technology
Step-by-step answer
P Answered by Master
When one encounters another vessel and assess the situation and believes that you are the stand-on vessel, You should still maintain your course unless the give-away vessel or vessel you have encountered is not taking appropriate actions, what you should do is, you should take action and move away from the vessel, do not go toward the vessel nor pass in front of it.
Computers and Technology
Step-by-step answer
P Answered by PhD

boolean rsvp;

int selection;

String option1;

String option2;

(a) if(rsvp){

System.out.println("Attending");

} else {

System.out.println("Not attending");

}

(b) if (selection == 1){

System.out.println("Beef");

} else if (selection == 2){

System.out.println("Chicken");

} else if (selection == 3) {

System.out.println("Pasta");

} else {

System.out.println("Fish");

}

(c) switch(selection){

case 1:

if(rsvp){

option1 = "Thanks for attending. You will be served beef.";

} else{

option1 = "Sorry you can't make it";

}

break;

case 2:

if(rsvp){

option1 = "Thanks for attending. You will be served chicken.";

} else{

option1 = "Sorry you can't make it";

}

break;

case 3:

if(rsvp){

option1 = "Thanks for attending. You will be served pasta.";

} else{

option1 = "Sorry you can't make it";

}

break;

default:

if(rsvp){

option1 = "Thanks for attending. You will be served fish.";

} else{

option1 = "Sorry you can't make it";

}

break;

}

(d) if (option1 == option2){

System.out.println("True");

} else {

System.out.println("False");

}

Explanation:

This code snippet is written in Java.

a) Uses if statement to print "attending" if rsvp is true and "not attending" if rsvp is false.

b) Uses if-else statement to print the variety of food based on user selection. If selection is 1, it print beef. If selection is 2, it print chicken. If selection is 3, it prints pasta else it print fish for any other value of selection.

c) Uses switch statement to determine the value of selection and then uses inner if statement to assign "Thanks for attending. You will be served beef." if rsvp is true to option1. The value of beef changes depending on the value of selection. If rsvp is false, then "Sorry you can't make it." is assigned to option1.

d) Uses if statement to print true if option1 and option2 are equal else it print false.

Computers and Technology
Step-by-step answer
P Answered by Master

def get_word(sentence, n):

# Only proceed if n is positive

   if n > 0:

       words = sentence.split()

# Only proceed if n is not more than the number of words

       if n <= len(words):

           return words[n-1]

   return (" ")

print(get_word("This is a lesson about lists", 4)) # Should print: lesson

print(get_word("This is a lesson about lists", -4)) # Nothing

print(get_word("Now we are cooking!", 1)) # Should print: Now

print(get_word("Now we are cooking!", 5)) # Nothing

Explanation:

Added parts are highlighted.

If n is greater than 0, split the given sentence using split method and set it to the words.

If n is not more than the number of words, return the (n-1)th index of the words. Since the index starts at 0, (n-1)th index corresponds to the nth word

Computers and Technology
Step-by-step answer
P Answered by PhD

The technology that could be partnered with Cloud to allow the international fast-food chain to gain insights into customer data, including location and order patterns, is called data analytics or big data analytics. It involves using software algorithms and tools to analyze large and complex datasets like customer data, and extract useful insights and patterns that can be used to make informed decisions about customer-focused experiences such as promotions and unique user experiences. Data analytics can help businesses improve customer satisfaction, increase sales and revenue, and gain a competitive advantage in the marketplace.

Try asking the Studen AI a question.

It will provide an instant answer!

FREE