Can you please tell me how to upload this to netbeans, step by step. Write a pro
ID: 3917411 • Letter: C
Question
Can you please tell me how to upload this to netbeans, step by step.
Write a program using text to speech that counts from 1 to 25 and tells us if each number is a multiple of 3, a multiple of 5, a multiple of 7, a multiple of 11, or a Fibonacci number. The messages should be displayed onthe screen and spoken.
There is also a javadoc requirement for the Java application projects developed in the course. All Java projects must also contain javadoc documentation with it when submitted. There is an option to create javadocs in NetBeans. As long as you have your code commented properly, the javadoc will be automatically generated when you selected the option to generate it in NetBeans. I uploaded a pdf document describing how to comment your code to generate your javadoc documentation correctly. There are also two hyperlinks leading to internet tutorials on creating javadoc documentation.
Explanation / Answer
1) Creating a Maven Based NetBeans Platform Application Project
You can use the New Project wizard to create a NetBeans Platform Application from a Maven archetype. The wizard creates the Maven module projects that you need to develop an application on the NetBeans Platform. The wizard also provides the option of creating a NetBeans module in the application project.
Creating the Project
Perform the following steps to create the NetBeans Platform application using the New Project wizard.
Select NetBeans Application from the Maven category:
Type for the Project Name and set the Project Location to an appropriate folder on your system.
Select the version of the NetBeans APIs you want to use.
Click Finish
Create a class name as TextSpeech.
Note. If this is your first NetBeans Platform application using Maven, it can take some time to create the projects because the IDE needs to download any necessary artifacts from the NetBeans Maven repository.
For all Maven projects, the pom.xml file (POM) is located under the Project Files node in the Projects window.
open the Pom.xml and paste the following dependencies:-
<dependency>
<groupId>net.sf.sociaal</groupId>
<artifactId>freetts</artifactId>
<version>1.2.2</version>
</dependency>
And let the net beans download the appropriate jar files to run your application.
2) please write the below program to conert the text into speech in already created class named as TextSpeech.
package com.chegg.speechtotextdata.cheggspeechtotext;
import java.util.Locale;
import javax.speech.Central;
import javax.speech.synthesis.Synthesizer;
import javax.speech.synthesis.SynthesizerModeDesc;
/**
* @author raghav
*
*/
public class TextSpeech {
/**
* @param args
*/
public static void main(String[] args) {
int count = 25;
try {
checkFibonacciSeries(count);
} finally {
// Deallocate the Synthesizer.
System.exit(0);
}
}
/**
* @param seriesLength
* @return
*/
public static int fibonacci(int seriesLength) {
if (seriesLength == 1 || seriesLength == 2) {
return 1;
} else {
return fibonacci(seriesLength - 1) + fibonacci(seriesLength - 2);
}
}
/**
* @param count
* @throws IllegalStateException
*/
public static void checkFibonacciSeries(int count) throws IllegalStateException {
for (int i = 1; i <= count; ++i) {
if (i % 3 == 0) {
System.out.print(" " + i);
textToSpeechConversion(i + "a multiple of 3");
} else if (i % 5 == 0) {
System.out.print(" " + i);
textToSpeechConversion(i + "a multiple of 5");
} else if (i % 7 == 0) {
System.out.print(" " + i);
textToSpeechConversion(i + "a multiple of 7");
} else if (i % 11 == 0) {
System.out.print(" " + i);
textToSpeechConversion(i + "a multiple of 11");
} else {
int number = i;
int t = 1;
while (t > 0) {
int fibnumber = fibonacci(t);
if (fibnumber != number) {
if (fibnumber > number) {
break;
} else {
t++;
}
} else {
System.out.print(" " + i);
textToSpeechConversion(i + "is a fibonacci number");
break;
}
}
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
/**
* @param str
*/
public static void textToSpeechConversion(String str) {
try {
// set property as Kevin Dictionary
System.setProperty("freetts.voices", "com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory");
// Register Engine
Central.registerEngineCentral("com.sun.speech.freetts.jsapi.FreeTTSEngineCentral");
// Create a Synthesizer
Synthesizer synthesizer = Central.createSynthesizer(new SynthesizerModeDesc(Locale.US));
// Allocate synthesizer
synthesizer.allocate();
// Resume Synthesizer
synthesizer.resume();
// speaks the given text until queue is empty.
synthesizer.speakPlainText(str, null);
synthesizer.waitEngineState(Synthesizer.QUEUE_EMPTY);
}
catch (Exception e) {
e.printStackTrace();
}
}
}
3) Steps to generate Java doc in netbeans.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.