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
Java Programming (MindTap Course List)
- Design 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_forwardDesign a class named CustomerRecord that holds a customer number, name, and address. Include separate methods to 'set' the value for each data field using the parameter being passed. Include separate methods to 'get' the value for each data field, i.e. "return" the field's value. Pseudocode:arrow_forwardUsing 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_forward
- Focus 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_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_forwardDesign 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_forward
- In 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_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_forwardObjective: Write a class that will test dates and times inputted by the user and determine whether or not it is valid. This will focus on the usages of methods to organize code. First download the driver and put it in your project DO NOT ALTER THE DRIVER! Use this to run your project The driver : public class DateAndTimeDriver { public static void main(String[] args) { // TODO Auto-generated method stub DateAndTimeTester dtTester = new DateAndTimeTester(); dtTester.run(); } } Write a class file called DateAndTimeTester This DOES NOT have a main method Create the following methods run: This method returns nothing and takes no parameters. This is called by the driver and should handle all of the input from the Scanner and dialog for the user. isValid: returns true or false if a given String has the correct date and time. The String parameter should be formatted “MM/DD hh:mm” This method should call the methods isValidDate and isValidTime to determine this. isValidDate: returns…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_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT