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 circle measures 12 feet in diameter What's its area to the nearest foot?
melomori [17]

Answer:

113.1ft²

Step-by-step explanation:

5 0
3 years ago
You buy four packages of shoelaces. You pay with a $10 bill and receive $3.24 in change. Determine the price of each package.
Mnenie [13.5K]
I think each package would be $1.69. first you subtract 3.24 from 10 to get what you payed then divide that by 4 to get 1.69
8 0
3 years ago
What is a parallel slope for the line y = 2x + 2?
ArbitrLikvidat [17]

Answer: 2

Step-by-step explanation:

The slope is equal to 2 by it being in the slope place of y=mx+b

5 0
3 years ago
The number of students at jefferson school is even. The number has three digits. The digit in the ten place is 4. write there nu
Burka [1]
Let's assign three blanks for each digit of the unknown number. But let's fill in the tens digit because it is already specified.

_ 4 _

The last digit should be even to make it even. The possible digits for this are 2, 4, 6, and 8. The first digit could be any digit from 1 to 9. Therefore, the possible answers are 

142  242  342  442  542  642  742  842  942
144  244  344  444  544  644  744  844  944
146  246  346  446  546  646  746  846  946
148  248  348  448  548  648  748  848  948

Therefore, there are a total of 36 possible answers.

5 0
3 years ago
what is the opportunity cost (in civilian output) of a defense buildup that raises military spending from 4.0 to 4.3 percent of
Sati [7]

Answer:

hdhdhdhrheheheheheehhdhdududueueehheb

8 0
3 years ago
Other questions:
  • WILL MARK BRANLIESTIn a multiplication problem, if the first factor has 5 digits after the decimal and the second factor has 4 d
    9·2 answers
  • What does x equal .....​
    12·1 answer
  • What is the sign of the product (–7)(–2)(–5)(1)?
    12·2 answers
  • How do you solve 5n + 3 + 4n = 30
    6·2 answers
  • Consider the line y=10 x -1 and the point P=(2,0). (a) Write the formula for a function d(x) that describes the distance between
    8·1 answer
  • Light travels at 186,000 miles per second. Light takes about 11⁄3 seconds to travel from the earth to the moon. Calculate the di
    15·1 answer
  • I need help with this question
    5·1 answer
  • What is the slope of the line? A. -1 <br> B. 0<br> C. 1 <br> D. 20
    5·2 answers
  • It says Stephen has a box in the shape of a hexagonal prism where the hexagonal bases are regular a net of the box is below
    11·1 answer
  • Im in a goo mode and wanted to spread the love yall have a good day
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!