Concept explainers
a.
(a)Legal and conventional:
The method identifier whose name starts with lowercase letter, contains no space and emphasizes each new word with initial uppercase letter comes under the legal and conventional method identifiers in Java.
(b)Legal but unconventional:
The class identifier whose new words starts with initial uppercase letters, using underscore, indicating the whole letter with the uppercase is considered as the legal but unconventional method identifiers in Java.
(c)Illegal:
The class identifier whose name has space between two words, using reserved keywords, staring the names with digits and using “#” symbol are considered as the illegal method identifiers in Java.
b.
Explanation of Solution
Void():
“void()” is considered a...
c.
Explanation of Solution
Golden Retriever():
“Golden Retriever()” is con...
d.
Explanation of Solution
Invoice():
“Invoice()” is considered as leg...
e.
Explanation of Solution
36542ZipCode():
“36542ZipCode()” is co...
f.
Explanation of Solution
Apartment():
“Apartment()” is considered as l...
g.
Explanation of Solution
Phone#:
“Phone#” is considered as ill...
h.
Explanation of Solution
8888:
“8888” is considered a...
i.
Explanation of Solution
displayTotal():
“displayTotal()” is considere...
j.
Explanation of Solution
Accounts_Receivable():
“Accounts_Receivable()” is con...
Want to see the full answer?
Check out a sample textbook solutionChapter 1 Solutions
EBK JAVA PROGRAMMING
- 3 Select the default method called when an activity is removed from memory. d O a. onTerminated() out of O b. Finished question O c. onDestroyed() O d. onFinished()arrow_forwardDesign a program in Visual Basic.net languages to test a username and password using a method users information: username: OMAR Password: ADlreMlpfeN1 Second user username: MOHAMED Password: 12lre34pfe56 When the user write username: OMAR and Password: ADMIN1 or write username: MOHAMED and Password:123456 open another Form.arrow_forwardFocus on classes, objects, methods and good programming style. Program has to be written in basic python. Your task is to create a BankAccount class. Class name BankAccount Attributes __balance float __pin integer Methods __init_() get_pin() check_pin() deposit() withdraw() get_balance() The bank account will be protected by a 4-digit pin number (i.e. between 1000 and 9999). Thepin should be generated randomly when the account object is created. The initial balance shouldbe 0.get_pin()should return the pin.check_pin(pin) should check the argument against the saved pin and return True if itmatches, False if it does not.deposit(amount) should receive the amount as the argument, add the amount to the accountand return the new…arrow_forward
- Using JAVASCRIPT write an object prototype for a Person that has a name and age, has a printInfo method, and also has a method that increments the persons age by 1 each time the method is called. Create two people using the 'new' keyword, and print both of their infos and increment one persons age by 3 years. Use an arrow function for both methods */ // Create our Person Prototype // Use an arrow to create the printInfo method // Create another arrow function for the addAge method that takes a single parameter // Adding to the agearrow_forwardIn java preferably eclipse Task: Create 2 Java classes Book BookDemo → contains the main() method Instructions: First create a class called Book The class Book DOES NOT HAVE a main method Create instance variables for: title: a String that contains the title of the book. author: a String that contains the name of the author publisher: a String that contains the name of the publishing house numCopiesSold: an int that holds the number of book copies sold. This must be a nonnegative value. yearOfRelease: an int that contains the year of the book's release. Only consider books released during 1950 – 2020. Create the Default Constructor – sets everything to default values and has no parameters. Create a Parameterized Constructor – with 5 parameters Create Accessors and Mutators for each instance variable MAKE SURE THE MUTATORS CHECK FOR VALID VALUES! Create the following Methods toString(): returns a String that contains the values of all instance variables for a particular Book object.…arrow_forwardPlease provide Handwritten answer with explanation. Computer Science 14. We can add many values in CHECKBOX component in applet using additem() method. Select one: True False ----------------------------- 15. A class can have many objects. Select one: True False ---------------------------- 16. String and StringBuffer will have same set of methods. Select one: True Falsearrow_forward
- Design a class that holds the following personal data: name, address, age, and phone number. Write appropriate accessor and mutator methods. Also, design a program that creates three instances of the class. One instance should hold your information, and the other two should hold your friends’ or family members’ information. very basic ALGORITHM in PSUEDOCODE NOT PYTHON. Use fictitious information.arrow_forward1. Let's say you have a zoo (A place with animals). You want to store different animals. You will like to store their name, type/species, age, friendly-level, attendance (how long they have stayed in the zoo) etc. a. Create the class b. Create a method to set the attributes, create a method to get the attributes c. Write a method that prints the name and the type/species of the animal - on one line.arrow_forwardThe class's methods are all accessible to the public. Characteristics: -int ID -name -status (int ID, String name, String status) setiD (int ID) (int ID) setName (String name) (String name) setStatus (String status, String getName), string getStatuso, toString0 Choose one True/Falsearrow_forward
- JAVA PROGRAMMING - Write a program that displays the employees Ids together with their first and last names. Use two classes. The first class contains the employee data and separate methods to set and get the ID’s and names. The other class creates objects for the employees and uses the objects to call the methods. Create several employees and display their data.arrow_forward1. Create a program class, TestFrame, that contains a main() to test and use the above class. This process should contain methods as follows: main(): This method should: 1. Call makeFrame() to get the inputs and create a Frame object. 2. Call calcCost() to determine the cost of the picture. 3. Display the cost of the picture along with the attribute values. 4. Ask the user if he/she wants another picture. 5. If the answer is No, display the total cost of the picture 6. If the answer is Yes, implement steps 1 and 2 again (without a loop), then display: ● the number of frames created (through a variable) • total cost of the picture(s), and • average picture cost. 6. The program should then end. Class methods: makeFrame() A function to prompt the user for inputs and accept the four (4) input values needed to create an instance of a Frame. It instantiates a Frame object and returns the object to the calling method. follows: calcCost() This function has a Frame object as its formal argument…arrow_forwardRead 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.arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT