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
∠A and \angle B∠B are complementary angles. If m\angle A=(2x+10)^{\circ}∠A=(2x+10)
vlada-n [284]

Answer:

Step-by-step explanation:

3 0
2 years ago
URGENT FIND THE LCD <br> BRAINLY CROWN IF RIGHT
sveticcg [70]
The answer is B: (x-1)(x-6)(x+6)
4 0
2 years ago
Read 2 more answers
Mark uses an app that shows him how many kilometers he has run to prepare for a marathon. The app said he ran 9.654 kilometers.
Viefleur [7K]

Answer:

5.9987174899

Step-by-step explanation:

9.654km / 1.609344

= 5.9987174899mi

4 0
2 years ago
Why do the inequality signs stay the same in the last two steps of exercise 1
MrRissso [65]
The only reason an inequality would change would be because a number is divided or multiplied by a negative number. So if it stayed the same, then it would be because there was no division or multiplication by a negative number. Hope I helped :)
7 0
2 years ago
Read 2 more answers
Mario had 9 green,8 red 10 brown 6 orange and 9 blue M &amp;M's. What fraction of the M&amp;M's are orange?
IrinaK [193]
2/11 or 6/33 
hope it helps

8 0
2 years ago
Other questions:
  • 7. You have invested $2500 in a 30-day savings certificate paying 4.15% per annum. Find the
    12·1 answer
  • I need help with this question please someone help
    5·1 answer
  • So this is the question: Meg has 7/8 jug of orange juice. How many 1/2 jug servings can Meg get from that jug? Please help me!
    10·2 answers
  • Identify the function shown in this graph.
    9·2 answers
  • There are 7 red marbles, 7 blue marbles, 7 yellow marbles, and 7 green marbles in a bag. If a person randomly selects 1 marble f
    14·2 answers
  • How many degrees are in EACH angle of a REGULAR 8-sided polygon? (Hint - Do the triangle trick) (Hint - Remember your definition
    12·1 answer
  • What is the area of the polygon?<br> I will mark brainliest
    9·2 answers
  • Steve buys a shirt for 21$ plus an 8% tax. Matt buys a shirt at another store forb18$ plus an 8% tax. Enter the different in the
    12·1 answer
  • HELPPPP looks at the image and EXPLAIN
    6·2 answers
  • How to go in minutes from hours and hours to minutes answer in picture welcome in advance​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!