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
An angle measures 43°. Find the measure of its supplement and the measure of its complement
Varvara68 [4.7K]

Answer:

supplement: 137

complement: 47

Step-by-step explanation:

Supplement is two angles that equal 180, so just subtract 43 from 180.

complement is two angles that equal 90, so 90-43=47

7 0
2 years ago
A department store sells t-shirts for $16.00. Every month that a t-shirt doesn’t sell, the store reduces the selling price by 25
GenaCL600 [577]

Answer:

$4.00

Step-by-step explanation:

Mark down it by 25% three times will be 75%, so when you multiply the two, it becomes 75%. do 16/4 to get the reduction for 25%,, and you get 12. Then dive it by for 2 more times to get $4

5 0
3 years ago
You have 666 reindeer, Prancer, Rudy, Balthazar, Quentin, Jebediah, and Lancer, and you want to have 333 fly your sleigh. You al
Irina-Kira [14]

Answer:

4 or 3 i think

Step-by-step explanation:

5 0
3 years ago
Please help me! (slopes) (brainliest)
Whitepunk [10]
Y=65x+5, i think but I don’t know for sure
6 0
2 years ago
Find the value of x. Give the answer in simplest radical form.
Vilka [71]

Answer:

X = 8√2.

Step-by-step explanation:

In a 45-45-90 triangle the ratio of the sides are x:x:√2 x.

So here, x = 8 and the side X = 8√2.

8 0
3 years ago
Other questions:
  • There are 5 persons and at a time only 3 can be arranged. What is the total number of arrangements?
    12·1 answer
  • Select whether the equation has a solution or not.<br> √x = 7
    8·1 answer
  • Choose one. Statistics are A) Measures of populations; B) Always estimations; C) Notated with small Roman letters; D) (b) and (c
    12·1 answer
  • A case of 3 items costs $4.11 at Costco. what is the price of each item?
    8·2 answers
  • F(x)=24/3x-2 find f(-2)
    12·1 answer
  • ASAP HELP RN
    6·1 answer
  • What is 22,119 rounded to the nearest hundred?
    13·2 answers
  • What is an exponent for 147
    12·1 answer
  • carl bought 0.8 pounds of peanuts and 0.3 pounds of raisins. how many pounds of snacks did he buy in all?
    5·2 answers
  • Subtract 3x-4 from -7x+2 help asap I am on a math assignment and I don’t know the answer
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!