a.
(a)Legal and conventional:
The class identifier whose name starts with uppercase letter, contains no space and emphasizes each new word with initial uppercase letter comes under the legal and conventional class names in java.
(b)Legal but unconventional:
The class identifier whose new words does not starts with initial uppercase letters, using underscore, indicating the whole letter with the uppercase and beginning the initial letter with lowercase is considered as the legal but unconventional class names 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 class names in Java.
b.
Explanation of Solution
void:
“void” is considered as...
c.
Explanation of Solution
Golden Retriever:
“Golden Retriever” is cons...
d.
Explanation of Solution
Invoice:
“Invoice” is considered as lega...
e.
Explanation of Solution
36542ZipCode:
“36542ZipCode” is cons...
f.
Explanation of Solution
Apartment:
“Apartment” is considered as le...
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 c...
j.
Explanation of Solution
Accounts_Receivable:
“Accounts_Receivable” is consi...
Trending nowThis is a popular solution!
Chapter 1 Solutions
Java Programming
- 3. For which of the following would it be appropriate to use a class (circle the ones for which you should use a class)? (a) calculating the sum of all the integers up to a specified value (b) storing the information for a playing card and getting the blackjack value for the card (c) storing a street address, city, state, and zip code and printing a mailing address for it (d) determining the smallest of three numbers 4. List two benefits of using classes.arrow_forwardComplete the following fill in the blank, True/False, Multiple Choice questions (Explanations are optional) : 1. An object is an instance of a:_________ 2. As a blueprint is a design for a house, a class is a design for a:_________ 3. Variables which are defined without the STATIC keyword and are outside any method declaration are Object specific and are known as instance variables. _________True/ False 4. A static variable is common to all the instances (or objects) of the class because it is a class level variable. In other words you can say that only a single copy of static variable is created and shared among all the instances of the class.__________True/False 5. Which of these can be overloaded? a) Methods b) Constructors c) All of the mentioned d) None of the mentionedarrow_forwardSelect the answer that best describes the following statements: I. A class is an instance of an object. II. A reference type does not store data directly but points towards some data. O Only statement I is true Only statement II is true Both statements I and II are true Both statements I and II are falsearrow_forward
- Farrell, Joyce. Microsoft Visual C#: An Introduction to Object-Oriented Programming (p. 479). Kindle Edition. 9. Write a program named SalespersonDemo that instantiates objects using classes named RealEstateSalesperson and GirlScout. Demonstrate that each object can use a SalesSpeech() method appropriately. Also, use a MakeSale() method two or three times with each object, and display the final contents of each object’s data fields. First, create an abstract class named Salesperson. Fields include first and last names; the Salesperson constructor requires both these values. Include properties for the fields. Include a method that returns a string that holds the Salesperson’s full name—the first and last names separated by a space. Then perform the following tasks: • Create two child classes of Salesperson: RealEstateSalesperson and GirlScout. The RealEstateSalesperson class contains fields for total value sold in dollars and total commission earned (both of which are…arrow_forwardPlease help with the following: C# .NET change the main class so that the user is the one that as to put the name in other words. Write a driver class that prompts for the person’s data input, instantiates an object of class HealtProfile and displays the patient’s information from that object by calling the DisplayHealthRecord, method. MAIN CLASS---------------------- static void Main(string[] args) { // Instance created holding 6 parameters which are field with value HealthProfile heartRate = new HealthProfile("James","Kill",1978, 79.5 ,175.5, 2021 ); heartRate.DisplayPatientRecord();// call the patient record method } CLASS HeartProfile------------------- public class HealthProfile { // attibutes which holds the following value private String _FirstName; private String _LastName; private int _BirthYear; private double _Height; private double _Weigth; private int _CurrentYear; public HealthProfile(string firstName, string lastName, int birthYear, double height, double wt, int…arrow_forwardLaboratory Exercises – Java Lesson 5: Creating Classes and Objects 2. 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 3. a. Create a class named Circle with fields named radius, area and diameter. Include methods names setRadius(), getRadius(), computeDiameter() which computes a circles’s diameter and computeArea which computes a circle’s area. The diameter of a circle is twice its radius and the area is 3.14 multiplied by the square of the radius. b. Create a class named TestCircle whose main() declares three Circle objects. Using the setRadius() method, assign one circle a small radius value. Assign another circle a larger radius value and assign the third circle a radius of 1. Call…arrow_forward
- ASAP!! Solve the written question not the image one Q3 part 3 attached in the image with the table 1 if you want to recreate code then you can Do the following question: Question Write code for an Invoice class for a car sale. Printing an object of the Invoice should print thedetails about the seller, the buyer, the dealer, the date of transaction, the car being sold, the purchase and selling price, the commission earned by the dealer, sales tax, and the total price of the car (calculated given the details in Question 3 part 3). A generation of the invoice object should set the isSold variable of the car class to true. You do not need to write code for any other classes Syntax of the Q3 code is given below: import java.util.*; class Car{ //class car String[] name; int reg_number,eng_number, chassis_num,status; String[] city, model, color, date_reg,date_arr,type; float price; float abstract calculate (float price); } class Dealer extends Car{ //inherits…arrow_forwardWhat is the difference between a class and an object? O Blueprint class is an object make a An object is a blueprint to make a class A class is a blueprint to make an object A blueprint is an object to make a class Which one is not the basic element of * OOP? O Polymorphism Class Abstraction BlueJarrow_forwardObject Oriented Programming: 213COMP, 214COMP (Feb-2022) Assignment- I [10 marks] Academic honesty: O Only pdf file accepted & student ID, will be your upload file. O Student who submit copied work will obtain a mark of zero. O Late work or attach file by email message not allowed. Q1: Write the signature for a method that has one parameter of type String, and does not return a value. Q2: Write the signature for a method that has two parameters, both of type Student, and returns an int value. Q3: Write the constructor's headers of the followings? new Student (202101156, “Ahmed"); new Address(51, "jazan university","CS&IT" ); new Grade(true, 505235600, 4.5); Q4: a) Write a class Student that define the following information: name, stid , age. b) Explain a mutators (setters) and accessors(getters) methods for each attributes(fields). c) Add three constructors: • with empty constructor. one parameter constructor (name of student) two parameters constructor (name and stid) d) Create two…arrow_forward
- Complete the following fill in the blank, True/False, Multiple Choice questions:1. An object is an instance of a:_________2. As a blueprint is a design for a house, a class is a design for a:_________3. Variables which are defined without the STATIC keyword and are outside any method declaration are Object specific and are known as instancevariables. _________True/ False 4. A static variable is common to all the instances (or objects) of the class because it is a class level variable. In other words you can say that only asingle copy of static variable is created and shared among all the instances of the class.__________True/False5. Which of these can be overloaded?a) Methodsb) Constructorsc) All of the mentionedd) None of the mentionedarrow_forward1. Object-Oriented concept 2. Interface 3. Inheritance 4. Use scanner class Write a code that converts binary to decimal and decimal to binary, Hexadecimal to decimal. Then by using the arithmetic equation add, subtract, multiply, divide binary numbers as well as a decimal number. It is a must to use object-oriented concepts. you can use Integer.toBinaryString(), Integer.parseInt()arrow_forward1. Design the following class hierarchy. a. A GeometricObject represents a general geometric figure. It has properties:i. isFilledii. color iii. thickness. b. Rectangle and Circle are geometric objects. Add suitable data and methods.c. Drawing is a collection of geometric objects. Number of geometric objects can be 5. User should be able to calculate total area of Drawing and count the shapes which are filled. Note:Solve in Javaarrow_forward
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning