EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
bartleby

Concept explainers

bartleby

Videos

Expert Solution & Answer
Book Icon
Chapter 1, Problem 2PE

Explanation of Solution

Naming conventions:

It is the set of rules used for choosing the character sequence of identifier name. The naming conventions denote variables, methods, classes, and constants.

Naming conventions for method name:

  • Naming conventions for method are:
    • If the name of the method consists of multiple words, join them into one.
    • Make the first letter as lowercase and capitalize the first letter of each sub word.
    • Examples: “numberOfPassmarks”, “calculateMarks()”, etc.
Method Identifiersabc
LegalConventionalLegalUnconventionalIllegal
associationRules()YesYes   
void()    Yes, the method identifier is illegal, since “void” is keyword

Blurred answer
Students have asked these similar questions
QUESTION 11 Given the following method header public void someMethod ( float x, boolean y, boolean z) what is the signature of this method? For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac).
Create a project in JAVA name "Supermarket Management System" Project should include:1. Authentication or login using credentials with new user signup2. Loop3. Method4. Arrays5. Encapsulation6. Inheritance7. Polymorphism8. Abstract class9. Interface10. File11. Exception 12. Frontend: JAVA GUI13. Backend: Eclipse14. Database: Mysql15. JAVA GUI using Swing. (You should not use JavaFX) NB: Project should be created in eclipse
Read each step below and write a program using an IDE or text editor. 31-32. Create a class named MyAccount. This class should have the main method with a welcome message, "Welcome to my account". 33-34. Create an enum and name it as Account. 35-36. Inside the implementation of enum, create three constants named, PREMIUM(10), GOLD (7), and BASIC(3). 37-38. Create an int member variable inside the enum named discount and set its access modifier to private. 39-40. Inside the main method, create a variable named dis with a data type Account. 41-42. Create the constructor of enum with parameter int discounted. 43-44. Inside the constructor, assign discounted to discount. Create a public method named getDiscount(), set its return type to int and return discount. 45-46. In the main method, assign PREMIUM to dis using the Account enum 47-48. Print the discount using the getDiscount() method. 49-50. Concatenate "%" to getDiscount() method.
Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Linux - Tutorial for Beginners in 13 MINUTES! [ UPDATED ]; Author: bai;https://www.youtube.com/watch?v=BMGixkvJ-6w;License: Standard YouTube License, CC-BY
What is Linux?; Author: Techquickie;https://www.youtube.com/watch?v=zA3vmx0GaO8;License: Standard YouTube License, CC-BY
Introduction to Linux and Basic Linux Commands for Beginners; Author: sakitech;https://www.youtube.com/watch?v=IVquJh3DXUA;License: Standard Youtube License