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
Westkost [7]
3 years ago
13

3. Write the code to print the No. 50 Fibonacci number. (2 points) 4. A homophone is one of two or more words that are pronounce

d alike but are different in meaning or spelling; for example, the words "two", "too", and "to". Write a Java program that uses HashMap to find the most words that has the same homophones and return the count of the number of words. (2 points)
Mathematics
1 answer:
DiKsa [7]3 years ago
8 0

Answer:

Answers explained below

Step-by-step explanation:

<u>SOLUTION 3</u>

//Till 50 numbers

import java.util.ArrayList;

import java.util.LinkedList;

public class Driver {

public static void main(String[] args) {

//Upto 50

int num = 50, x = 0, y = 1;

 

System.out.print("Till number " + num + ": ");

for (int i = 1; i <= num; ++i)

{

System.out.print(x + " + ");

int addition = x + y;

x = y;

y = addition;

}

}

}

<u>Solution 4: </u>

import java.util.ArrayList;

import java.util.Arrays;

import java.util.HashMap;

import java.util.LinkedList;

public class Driver {

public static void main(String[] args) {

// Some homophonic words are:

/*

* ate, eight

* bare, bear

* buy, by, bye

* eye, I

*

*/

// Creating Hashmap

HashMap<String, String[]> homo = new HashMap<String, String[]>();

homo.put("ate", new String[] { "ate", "eight" });

homo.put("bare", new String[] { "bare", "beare" });

homo.put("buy", new String[] { "buy", "bye", "by" });

homo.put("eye", new String[] { "eye", "I" });

for (String i : homo.keySet()) {

int count=homo.get(i).length;

System.out.println(i+" has "+count+" homophone words");

}

}

}

You might be interested in
Are these two expressions equal?
Orlov [11]

Answer:

not equal no property shown

4 0
3 years ago
Read 2 more answers
A recipie needs 5/8 cups of sugar. What percent of a whole cup is that?
katen-ka-za [31]

Answer: 62.5 percent

Step-by-step explanation:

4 0
3 years ago
Read 2 more answers
ine segment MN has endpoints M(-5,4) and N(1,-2). Find the equation for the perpendicular bisector of line segment MN.
Gre4nikov [31]

Answer:

y=x-3

Step-by-step explanation:

slope=4+2/-5-1=-1

perpendicular slope= negative reciprical=1

y=x+b

midpoint on perpendicular bisector= (-5+1/2, 4-2/2)=(-2,1)

substitution-2=1+b, b=-3

y=x-3

4 0
3 years ago
4|w − 5| = 4
anastassius [24]

Answer:

   w = 9 or  w = 1

Step-by-step explanation:

4|w − 5| = 4

Divide both sides by 4

w - 5 = 4                         w - 5 = -4

   + 5    + 5                          + 5     + 5

     w = 9                             w = 1

7 0
3 years ago
Find the vale of x need help
babunello [35]

Answer:

x=45 degrees

Step-by-step explanation:

You can see based off of the markings on the 2 sides, that it is an isosceles triangle, so that means the 2 base angles are equal.

so 2x+90=180 degrees

so 2x=90 degrees

x=45  

4 0
3 years ago
Read 2 more answers
Other questions:
  • PLEASE HELP ASAP!!
    12·1 answer
  • Sally can buy 3 pieces of candy for $1.20 or 5 pieces for $2.50, which has a better unit rate? Explain.
    12·2 answers
  • Tina spent 3/5 of her paycheck on a trip to the beach. She spent 3/8 of her paycheck on new clothes for the trip. What fraction
    12·1 answer
  • Can you tell me the differences between assumed mean and arithmetic mean​
    14·1 answer
  • 9. Given the point (6,-8) values of the six trig function.
    5·1 answer
  • A social scientist wishes to conduct a survey. She plans to ask a yes/no question to a random sample from the U.S. adult populat
    6·2 answers
  • Mr. Molesky observes a group of monkeys for 24 hours to learn about their behavior. He records how long they slept (in hours), h
    8·1 answer
  • Can you please help me​
    15·1 answer
  • One cup of​ grated, fresh Parmesan cheese weighs 3 ounces. How many cups of grated cheese can you expect to get from a​ 4.5-poun
    15·1 answer
  • The fee to check luggage with anew arline is based on the weightof each bag. Brett paid $7.14 tocheck a 42-pound bag. Howmuch wi
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!