EBK JAVA PROGRAMMING
8th Edition
ISBN: 9781305480537
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 1, Problem 10PE
Program Plan Intro
Comments in Java
Define the class “Comments”.
- Define the main method.
- Display the given statement in output window using the print statement.
- Show the given statement in Line comment, Block comment and Javadoc comments.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Write, compile, and test a class that displays at least four lines of your favorite song. Save the class as FavoriteSong.java.
Every praise is to our God.Every word of worship with one accordEvery praise every praise is to our God.Sing hallelujah to our GodGlory hallelujah is due our GodEvery praise every praise is to our God.
This assignment will help you to get started with NetBeans and using Java compiler:
To begin, put a block comment at the beginning of your Java file (and every Java source file in the future) with the assignment number, assignment title, program author [your name], and the date it's due.
Next, similar to the programs presented in the first chapter of the textbook, use System.out object to display the following information:
Your first name
The name of the operating system you are using
The name of your project (or simply the folder name if not using the IDE)
The name of the class that contains the main() method in your source file.
Note: Your program should print each of the above items on a separate output line.
"The name of the class that contains the main() method in your source file.public class MyClass { public static void main(String[]) { System.out.println( "Hi" ); }}
Create a new Java class with a main() method that displays "Hello World!" followed by a new line with your name on it. The final printout should look like:
Hello, World!
by <your name here>
Remember to follow Java standard conventions by giving the class and file name the same name, such as "public class HelloWorld" and HelloWorld.java. By giving the file name the same name as your class name, the Java executable will know what compiled class name to look for the after you compile the file named "HelloWorld.java".
Make sure you create your Java Project, create your Java class and run / execute this program in your IDE. Submit the JAVA file only by clicking on the submit link above and selecting to Attach it before you click "Submit" button.
Chapter 1 Solutions
EBK JAVA PROGRAMMING
Ch. 1 - Prob. 1RQCh. 1 - Prob. 2RQCh. 1 - Prob. 3RQCh. 1 - Prob. 4RQCh. 1 - Prob. 5RQCh. 1 - Prob. 6RQCh. 1 - Prob. 7RQCh. 1 - Prob. 8RQCh. 1 - Prob. 9RQCh. 1 - Prob. 10RQ
Ch. 1 - Prob. 11RQCh. 1 - Prob. 12RQCh. 1 - Prob. 13RQCh. 1 - Prob. 14RQCh. 1 - Prob. 15RQCh. 1 - Prob. 16RQCh. 1 - Prob. 17RQCh. 1 - Prob. 18RQCh. 1 - Prob. 19RQCh. 1 - Prob. 20RQCh. 1 - Prob. 1PECh. 1 - Prob. 2PECh. 1 - Prob. 3PECh. 1 - Prob. 4PECh. 1 - Prob. 5PECh. 1 - Prob. 6PECh. 1 - Prob. 7PECh. 1 - Prob. 8PECh. 1 - Prob. 9PECh. 1 - Prob. 10PECh. 1 - Prob. 11PECh. 1 - Prob. 12PECh. 1 - Prob. 1DECh. 1 - Prob. 1GZCh. 1 - Prob. 1CPCh. 1 - Prob. 2CP
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write, compile, and test a class that displays the first few lines of the lyrics of your favorite song. save the class as favoritesong. java.arrow_forwardWrite Java (Swing) statements to create the following: 1) A statement that creates a JPanel object named accountPanel. 2) A statement that assigns the BorderLayout manager to the JPanel object named accountPanel. 3) A statement that creates a JButton object named save with an appropriate label. 4) A statement that creates an action listener for the JButton object named save.arrow_forwardWrite a java programme create a text based user interface class called WorkOutUI Create tow fields that will be accessible through the whole class A static constant field called ABBA to store the string "Agnetha#Benny#Bjorn#annafrid". A static field called an integer called totalPoints. Code a method Called processWorkOuts.The method must accept the name of the member of Abba whose text file must be processed.This method must be called from the main method. In the processWorkOuts Method: Display the name of the Abba Group whose file is being processed. add ".txt" to the file name sent as a parameter. instantiate a WorkOut object called workOut Using the constructor:+constructor(p:real, n:interger) ,send 0 for an initial points value and 0 as the initial numWorkOuts value. Open the text file and loop through the file extracting the start ,end,description and level fields from the file.Display an error message if the file cannot open. a) Instantiate a workout object using the…arrow_forward
- 5. Fill up the blanks with suitable JavaFx code of the following JavaFx code segment: public class test extends Application { public void start(Stage primaryStage) { primaryStage.______;\\ Display the stage on the screen } public static void main(String[] args) { launch(args); } } a. diplay( ) b. Display( ) c. Show( ) d. show ( )arrow_forwardWrite, compile, and test a class that displays the pattern shown in Figure 1-26. Write your Java code Class Triangle { public static void main(String[] args) { // Write your code here } }arrow_forwardcreate methods that create and return something that can be output by a calling program. Maker sure to separate the processing (functionality) and presentation (user interface) into two separate java files. Write a recursive method that is passed a single int parameter, N, and create and return a String containing all the odd numbers between N and 0 in descending order. Subject: Java Programmingarrow_forward
- First, launch the IDE and close any previous projects that may be open (at the top menu go to File ==> Close All Projects). Then create a new Java application called "CheckString" (without the quotation marks) according to the following guidelines. Note: Each method below, including main, should handle (catch) any Exceptions that are thrown. Note: If an Exception is thrown and caught, print the Exception's message to the command line. Write a complete Java method called checkWord that takes a String parameter called word, returns nothing, and is declared to throw an Exception of type Exception. In the method, check if the first character of the parameter is a letter. If it is not a letter, the method throws an Exception of type Exception with the message of: "This is not a word; the first character is not a letter." Write a complete Java method called getWord that takes no parameters and returns a String. The method prompts the user for a word, and then calls the checkWord method…arrow_forward1 Preparation A Zip archive containing the files for the assignment is provided in Minerva. When you unzip it, you should see three files of earthquake data, along with four .java files. One of these, QuakeException.java, is complete and ready for you to use; the other three files containing empty Java classes. There are 'To Do' comments inside the classes that summarise the code that you need to write, and detailed step-by-step instructions are provided below. Before you begin programming, take some time to study the sample data. You can use a spreadsheet application to do this. Each row in the dataset represents a single earthquake. The different columns represent various parameters measured for an earthquake. You don't need to know what most of these are, although further details can be found at the USGS Earthquake Hazards Program website if you are interested. The only columns relevant to this assignment are: latitude, longitude, depth and magnitude. Note that filenames consist of…arrow_forwardUse the Java Class, Account.java, provided. Please do not rename or make any changes to this class. Do not turn in the Account class. Your program will be tested with the Account class provided. Write a Java Program that meets the following requirements:1. Write a Java class, rinoel_Bank.2. At the beginning of the program include a comment with your name and a brief description of the program. Please include a short comment befor each method3. The Bank class will have the following instance variables: a. An Array of Account objects that can hold 20 Accounts named, bank.b. An int variable, numberOfAccounts which indicates the number of Account objects in the account array4. The Bank class will have the following constructor:a. A default/noargs constructor: i. It will create the Array of Account objectsii. Set the numberOfAccounts to zerob. One accessor method:public int getNumberOfAccounts() //returns the numberOfAccountsc. The following methods:public void addAccount (Account a) Adds…arrow_forward
- Which one of a, b, c, d correct? During the writing of a program, you are confronted with a coding problem very similar to one you've already solved in another part of the program. One way to take advantage of this is by copying and pasting the a)comments b)code c) import statements you wrote previously. The problem is that any changes made to the copied code will then need to be applied to a) the original code b)all the javadoc comments c)the program’s API. A more effective strategy is to construct a a)try/catch block b)a method c)a ternary operator that is used in both situationsarrow_forwardLet's create our first Java file, called Welcome.java, which can be done in any text editor (like Notepad, Notepad++, Visual code, etc.). Open a file and paste the following Java code. public class Main { public static void main(String[] args) { System.out.println("mudau shudufhadzo welcome to BIS2142/ 2542 class"); } } Execute/ run it using a command prompt. Your output should contain a name and welcome to BIS2142/ 2542 class message. Therefore, your display message will look like this "mudau shudufhadzo "welcome to BIS2142/2542 class".arrow_forwardFirst, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).Then create a new Java application called "BackwardsStrings" (without the quotation marks) that:Prompts the user at the command line for one 3-character string.Then (after the user inputs that first 3-character string) prompts the user for another 3-character string.Then prints out the two input strings with a space between them.Finally prints on a separate line the two input strings 'in reverse' (see example below) with a space between them.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT