Use the class definition below to answer the following questions:- public class CBox { String BColor = “blue”; String BName; double BWeight; public void setBColor(String c) { BColor = c; } public String getBName() { return BName; } } a) Name any 2 field attribute for this class and their type? b) What is the name of the method that is a mutator? c) Why is the return type for the getBName method String?
Q: Learn all there is to know about social networking blogs and cloud computing.
A: Using social media Social networking is defined as interacting with family, friends, and individuals…
Q: Question 3: Consider a non-standard Ethernet segment. The maximum distance between the two computers…
A:
Q: How does the computer programming process work? What factors should be considered before settling on…
A: The question is to define how does the computer programming process works and What factors should be…
Q: What are the three most important things that need to be in place for a network to run effectively…
A: Introduction: This question clarifies the difference between network architecture and application…
Q: A characteristic of a control, similar to the properties of other controls, may alter how the…
A: Given: The attribute control charts are a series of control charts that were created particularly…
Q: What sets a quantum computer apart from a regular old computer is its ability to manipulate quantum…
A: Quantum computer: Classical Computing Quanta Computing Use Cubits, which may represent both 0 and 1…
Q: ach occupied unit requires an average of $27 per month for maintenance. How many units should be…
A: The program of output in the number of units is given as,
Q: What are the benefits of using compiled languages rather than interpreted languages, and how are…
A: Introduction: Computed languages provide the following advantages over interpreted languages:-…
Q: What are the several stages that comprise the life cycle of the software development process, and…
A: The software development life cycle contains seven phases:- 1.Planning 2. Examine 3.Designing 4. The…
Q: It is possible to classify as a distinct type of data model the type of data model that organises…
A: Intro Data modeling: The act of generating a visual representation of either a whole information…
Q: Two different kinds of memory are referred to by the words RAM and Register respectively.
A: Please find the detailed answer in the following steps.
Q: When it comes to the general design, why would it be a waste of time to delve into the particular…
A: Answer: Our functioning memory is where the magic happens with regards to undeniable level mental…
Q: The second step in threat modelling is to identify technologies and security measures that you are…
A: Inspection: Identify Trust Zones, Potential Adversaries, and Threats is the second phase in threat…
Q: What will the following Code segment print on the screen?
A: The output of the above java program will be :
Q: Design an interface between 8086 CPU and two chips of 16K X 8 EPROM and
A: Step 1: Total EPROM required = 64 KB Chip size available = 16 KB ∴Number of chips…
Q: Which views must be considered while creating models for software system architecture
A: Answer:
Q: What differentiates software engineering from other areas of technical expertise is that it focuses…
A: Given: We have to discuss What differentiates software engineering from other areas of technical…
Q: A discussion is offered on how formative assessment may be utilised to answer user issues and…
A: NOTE :- Below i explain the answer in my own words by which you understand it well.…
Q: This is due to the huge computational power of computers. Please explain how computers have become…
A: Introduction: Computers and their use increased swiftly and widely over the world, according to the…
Q: Insider risks to cloud security and possible countermeasures are the focus of this essay.
A: Here's the solution: To improve online security and shift from legacy to current information stages,…
Q: Write if-else if statements that will compare "price" variable with below values and output…
A: NOTE: Programming language is not mentioned, so doing in C++ In this question, we are asked to write…
Q: Number cruncher is the informal name for .. A. mini computer B. super computer C. micro computer D.…
A: There are many types of computers present inside the market as per their usage
Q: What is the influence of decreasing screen sizes on user interface design methodologies and…
A: The smartphone and tablet industry have revolutionised the market.
Q: To what extent does the operating system have a role in CPU scheduling?
A: CPUs are assigned processes by the operating system. CPU scheduling occurs in multiprogramming…
Q: What makes up the Internet backbone?
A: In this problem, we will discuss the components of the Internet Backbone.
Q: Demonstrate your ability to describe the needs of users and determine the effectiveness with which a…
A: Answer: Usability is a measure of how well a particular client in a particular setting can utilize…
Q: Is it feasible to influence cloud security and make a difference after a data breach has occurred?…
A: With the multiplication of online action, increasingly more data is saved as information…
Q: What are the main characteristics of Compiler Phases, and how do they work? Can you share an example…
A: Introduction: Compilers have two phases: analysis and synthesis. The analysis phase generates an…
Q: Install Linux on a personal computer, and then go through a series of instructions that are often…
A: How to install Linux?Linux is an open source and free app that you can install that allows anyone…
Q: Think about the benefits that wireless networks provide to countries that are still developing…
A: Users of mobile phones with access to wireless networks are able to obtain real-time data even as…
Q: Look at the following array definition: String[] colors = {"Blue","Green","Purple"}; What will be…
A: Given data: String[] colors={"Blue", "Green", "Purple"}; Given problem: colors[2].length()…
Q: A firm with ten hardware components?
A: Answer: Motherboard The motherboard is the primary printed circuit leading body of a PC framework.…
Q: Rs-Write an example of Background process?
A: A background process in Linux is a process that runs independently of the shell. The terminal window…
Q: Each model of a computer has a unique …. A. Assembley language B. Machine language C. High level…
A: Answer in step 2
Q: am for a class named Computer that has a private double field named price, you want to represent a…
A: As per the given data we need to provide the UML declaration for the standard-setter for the price…
Q: Can you use DFS to assess if two graphs are related? If you can find it, step-by-step instructions…
A: Given: Using DFS, can you identify if a graph is related? If you can discover it, explain it step…
Q: For each of the following distances, suggest how you would transmit data at the highest possible…
A: The non-zero frequency components of the signal s(t) correspond to the frequencies 1/2 Hz,3/2 Hz,…
Q: Explain the three main processes of testing a commercial software application in a few words.
A: A few phrases the three primary steps of testing a commercial software product are as follows:
Q: Investigate and evaluate the server capabilities of Linux, then compare and contrast them with those…
A: Microsoft Windows: Portrayal: Microsoft Windows is a gathering of OSs made by Microsoft. Windows is…
Q: Choose technology and security techniques to show your understanding of the second level of threat…
A: Threatening modeling is an effective strategy for testing online security threats. It involves…
Q: Explain the structure of circuit-switched networks. Briefly
A: Introduction: A circuit-switched network is an organization plan in which hubs convey across a…
Q: A block with the beginning address and the prefix length 205.25.36.64/38 is assigned to a tiny…
A: Answer: Slash notation is called the CIDR notation. A set of Internet protocol (IP) standards to…
Q: What are the consequences that computer science has had on society, and what are the supporting…
A: What are the ramifications of computer science and the supporting evidence that technology has had…
Q: Please give the space and time complexity of the two codes below and the reason why. Example: O(N),…
A: Code 1: The time complexity of code1 is o(n3) Explanation: in your code, if we focus highest…
Q: Discuss the situation in which there is inadequate memory for new processes and the activities that…
A: The above question is solved in step 2 :-
Q: What impact will AI have on the future? What are some of the current AI software applications?…
A: What is an artificial intelligence? AI is the ability of a machine to display human like…
Q: Consider the impact of wearable computing devices, such as the Apple Watch and Android Wear, on UI…
A: User-Interface Design: User Interface Design (UI Design) is concerned with anticipating what users…
Q: The National Identification Authority is in charge of collecting data on all residents and…
A: Intro For large volumes of data used in the database, Greenplum (SQL database) is the most…
Q: What is the objective of system modeling in the context of software engineering?
A: The question is to write the objective of system modeling in the context of software engineering.
Q: Look at the following array definition: String[ ] sArray = new String[3]; a. What will be…
A: length attribute in array is user to determing the length or number of elements in that array.…
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Use the class definition below to answer the following questions:-
public class CBox
{
String BColor = “blue”;
String BName;
double BWeight;
public void setBColor(String c)
{
BColor = c;
}
public String getBName()
{
return BName;
}
}
a) Name any 2 field attribute for this class and their type?
b) What is the name of the method that is a mutator?
c) Why is the return type for the getBName method String?
Step by step
Solved in 2 steps
- hello! can you help debug my program? it's in Java! here are the errors I'm getting: line 189: total_weight cannot be resolved or is not a fieldline 93: the type Snake must implement the inherited abstract method Animal.makeNoise()line 139: the method actual_num_animals(int) is undefined for the type Zooline 152: the left-hand side of an assignment must be a variableline 169: syntax error, insert } to complete Blockline 152: syntax error, insert “. class” to complete expressionline 139: syntax error on token “<“, ( expectedline 139: syntax error on token “{“ invalid AssignmentOperatorline 152: i cannot be resolved to a variableline 152: i cannot be resolved to a variableline 154: i cannot be resolved to a variable here is my code: package zoo; public abstract class Animal { private String name; private double weight; private int age; public Animal() { name=""; weight=0; age=0; } public Animal(String name, double weight, int age) { this.name = name; this.weight = weight;…For the following four classes, choose the correct relationship between each pair. public class Room ( private String m type; private double m area; // "Bedroom", "Dining room", etc. // in square feet public Room (String type, double area) m type type; m area = area; public class Person { private String m name; private int m age; public Person (String name, int age) m name = name; m age = age; public class LivingSSpace ( private String m address; private Room[] m rooms; private Person[] m occupants; private int m countRooms; private int m countoccupants; public LivingSpace (String address, int numRooms, int numoccupants) m address = address; new int [numRooms]; = new int [numOceupants]; m rooms %3D D occupants m countRooms = m countOccupants = 0; public void addRoom (String type, double area)A GradeBook Example : In this example ,GradeBook class has one attributeand some methods to access this attribute data:public class GradeBook { private String cname; public void setName(String name){ cname=name;}public String getName(){return cname;} public void showMessage(){System.out.printf("Welcome to the Grade Book of %s \n", getName());}} //End of ClassTest Class Example that uses GradeBook class:public class GradeBookTest {public static void main(String[] args) { GradeBook b1=new GradeBook();GradeBook b2=new GradeBook(); System.out.printf("Course Name %s \n",b1.getName());System.out.printf("Course Name %s \n",b2.getName()); b1.setName("Object Oriented Programming");b2.setName("Data Structure using Java"); System.out.printf("Course Name %s \n",b1.getName());System.out.printf("Course Name %s \n",b2.getName()); b1.showMessage();b2.showMessage();}}//End class Exercise:You need to include another two attribute with name“marks” and “totalstudents” in GradeBook Class, Usefunctions to…
- is a construct that defines objects of the same type. A class An object A method A data fieldpublic class Secret private int x; private static int y; public static int count; public int z; public Secret () } X ?t = 2 { public Secret (int a) } { public Secret (int a, int b) } { public String toString() return ("x = " count = " + count); { public static void incrementY () { { 54. How many constructors are present in the class definition above? C. 2 d. 3 b. 1 55. What does the default constructor do in the class definition above? a. Sets the value of x to 0 c. Sets the value of x to 0 and the value of z to 1 d. There is no default constructor. b. Sets the value of z to 1 56. Based on the class definition above, which of the following statements is illegal? Secret.incrementY (); b. Secret.count++3B a. c. Secret. 2++; d. None of these 13Incorrect Question 1 Consider: class Bike { } private String make; public public Bike() } // ... public Bike(String newMake) { // ... } public public Bike (Bike bike) } // ... Bike(Bike bike) is the no-arg constructor Bike() is the no-arg constructor Bike(String newMake) is the no-arg constructor This is not valid class declaration
- Given the following class definition: class employee{public: employee(); employee(string, int, double); employee(int, double); employee(string); void setData(string, int, double); void print() const; void updatePay(double); int getNumOfServiceYears() const; double getPay() const;private: string name; int numOfServiceYears; double pay;}; Create a class parttime derived from the above class that includes private members payRate and hoursWorked of type double along with a constructor and the definition of a print function that prints out all information from the base and derived class. Provide a test program that would demonstrate the working parttime class. Note: You can assume all code is stored in a single file.Class Phone{ bool wired() string ageOfInnovation() } Class CellPhone extends Phone{ bool wired(){ return false; } string ageOfInnovation(){ return "1970's" } int thickness(){ return 0; } } Class SmartPhone extends CellPhone{ bool wired(){ return false; } string ageOfInnovation(){ return "1990's" } string popularlyCalled(){ return "mobile" } string mainFeature(){ return "Internet Capability"; } }public class Stadium extends baseStadium{ public int typeTicket; int floors; int seating; String type; public float ticketPrice; public String leagueName=""; public void SetTecketName(String val) { leagueName=val; } public void setType() { if (typeTicket == 1) { type = "VIP"; } else { type = "Regular"; } } public String getType() { return type; } public void setPrice() { if (typeTicket == 1) { ticketPrice = 250; } else { ticketPrice = 100; } } public void setFloors(int floors) { this.floors = floors; } public int getFloors() { return floors; } public void setSeating(int seating) { this.seating = seating; } public int getSeating() { return seating; } public void printDetails() { System.out.println("Ticket Details:"); System.out.println("Ticket Type:…
- Question 6 Consider: class Bike { } private String color; public Bike() { } public Bike(String newColor) { color = newColor; } public Bike (Bike bike) { color = } bike.color; public String getColor() { } } return color; public void setColor(String newColor) { color = newColor; Bike bike1= new Bike(); = Bike bike2 new Bike("blue"); Bike bike3 = new Bike(bike2); bike2.setColor("green"); Bike bike4 = new Bike(bike2); Which of the following are correct? bike4.getColor() returns null bike4.getColor() return "blue" bike3.getColor() return "green" bike2.getColor() returns "blue" bike4.getColor() return "green" bike1.getColor() returns bike3.getColor() return null bike3.getColor() returns "blue" bike2.getColor() returns "green" bike1.getColor() returns nullPoint out errors in the following codes and correct them publicclass CheckingAccount { // Create attributes account Num, Balance privateint accountNum; // Account Number privatedouble balance; // Account balance // Constructor public void CheckingAccount(int aNum, double balance) { // Call setters to initialize attribute values setAccountNumber (aNum); setBalance; } // Setters public void setAccountNumber(int aNum) { if (accountNum >= 100) { accountNum = aNum; } else {System.out.println("This account number is invalid (Account number must be at least 3 digits)!"); this.accountNum = 100; // assign a default value } } public void setBalance(double aBalance) { // make sure the value is positive if (aBalance > 0) { aBalance = balance; } else { System.out.println("This balance value is invalid (input must be positive)!"); aBalance = 0; // assign a default value } } // Getters publicvoid getAccountNumber() { return accountNum; } public void getBalance() { return balance; }…Incorrect Question 4 Consider public class Species { } // fields private String name; private int population; private double growthRate; // constructor public Species () { } name = "No Name Yet"; population = 0; growthRate = 33.3; Which of the following is the best setter method for the population instance variable? public boolean setPopulation(int newPopulation) { } if (newPopulation>= 0) { } population = newPopulation; return false; } return true; public public void setPopulation (int newPopulation) if (newPopulation>= 0) { } population newPopulation; public void setPopulation (int newPopulation) { population } = newPopulation;