public class Bicycle { public int cadence; private int gear; protected int speed; int id; public static final int wheels = 2; static int numberOfBicycles = 0; public Bicycle(int startCadence, int startSpeed, int startGear) { gear - startGear; cadence = startCadence; speed - startSpeed; id = ++number0fBicycles; protected int getID() { return id; public static int getNumber0fBicycles() { return numberOFBicycles; public int getCadence() { return cadence; public void setCadence(int newValue) {
Q: 2. LEGV8 coding (a) For the following C statement, write the corresponding LEGV8 assembly code. Assu...
A:
Q: Create a program that allows you to view and edit the sales amounts for each month of the current ye...
A: the answer is given below:-
Q: To put it another way: When you think of address space, what does it mean?
A: What is Address Space?
Q: dered linear or non-linear data structu
A: Are linked lists considered linear or non-linear data structures, depending on their structure
Q: Reversing a stack can be simply done by popping off the stack until it's empty and then pushing the ...
A: Introduction: Reversing of a stack.
Q: Describe how functional dependencies may be used to denote the following: • The entity sets student ...
A: Functional dependency is a relationship that exists between two attributes. It typically exists betw...
Q: at i
A: Buffers are memory storage spaces that temporarily store data while it travels from one point to ano...
Q: I have the code bellow. Now I'm ask to display the number of elements in the arrays read from files...
A: #include <iostream>#include <fstream>using namespace std; class Multiplicity { //Class p...
Q: O(n- 2) 0(1) ○ 이2) O(n)
A: Lets see the solution.
Q: Explain why the following series of steps is not an algorithm. Washing the dog 1. Rinse 2. Lather 3....
A: right step of the washing dog is in the series : stage : 1 (lather) stage : 2 (rinse) and next ...
Q: Suppose that L is a context-free language and that R is a regular language. Is L - R necessarily con...
A: Concepts: Operation that does not close context-free language: Set difference, intersection, and c...
Q: public class Bicycle { public int cadence; private int gear; protected int speed; int id; public sta...
A: Explanation: The reason for the below options are is that instance variables are those fields that ...
Q: If the input is 5. 0 2.5 1.5 the output is 55.90170 579.32402 5.00000 6.64787
A: here is Pseudo-Code of the :- (i) start (ii) input three floating number (iii) calc...
Q: x = 0 n = 3 j = n # outer loop with j while True: k = n # inner loop with ...
A:
Q: A simulation of Clinic Counter System will be carried out with the aim of improving customer waiting...
A: Type of data that are to be collected are:- Raw data or estimate of about how many total customers ...
Q: Write an algorithm and draw a flow chart to calculate the area of triangle and calculate the area of...
A: Algorithm: Start Read Length L and Breadth B Calculate triangleArea=0.5*L*B Calculate rectangleArea...
Q: Write a program that reads a four-digit number from user, then the program separates digits of the n...
A: code
Q: Suppose you wish to store utility bills for a large number of users, where each bill is identified b...
A: The range query is the basic operation of the database. It displays the quantity in the certain as l...
Q: A. Why do we want to use Numpy arrays instead of native Python arrays ? B. Explain the difference b...
A: As per bartlby guidelines, only 3 questions can be answered, I have answered the 3 questions. Please...
Q: Q1: Implement a class called Animal. a)A class named Animal b) Private data members: species and age...
A: “Since you have asked multiple questions, we will solve the first question for you. If you want any ...
Q: 6-IEEE 754-2008 contains a half precision that is only 16 bits wide. The leftmost bit is still the s...
A: Find the answer below of above question. I hope this will meet your requirement.
Q: Make a class 'StringMethods'. It contains a private instance String variable. Add these instance met...
A: Given :- Make a class 'StringMethods'.It contains a private instance String variable.Add these insta...
Q: Write overloaded function in java calculate() with following function definitions. void calculate(in...
A: We need to write a Java language program with method overloading of method calculate(). We need to c...
Q: A class in Java may inherit only from one superclass, but may, in turn, have any number of subclasse...
A: A class in Java may inherit only from one superclass, but may, in turn, haveany number of subclasses...
Q: The scientific method is based on certain basic postulates. Describe these postulates.
A: Scientific methods are the methods used by developers/scientists to find the solution to some proble...
Q: Compute Average Memory Access Time (AMAT) for a system that consists of a 2- level cache design. The...
A: I'm providing the answer to above question. I hope this will be helpful for you
Q: Write a Java Program to count the total number of characters in a string
A: import java.util.Scanner; public class Count_WordOfString{ public static void main(String args[]){ S...
Q: Who made the first flash drive?
A: These gadgets store data without external power and turn it on when a commuter connects through a ...
Q: Let’s analyze the game Tetris. That game had a lot of different pieces of various shapes and sizes....
A: If I have to program one game Tetris so there are lots of logical approach to deal with it . In thi...
Q: Alice and Bob use the ElGamal scheme with a common prime q= 131 and a primitive root a =6. Let Bob’s...
A: ANSWER:-
Q: Create a Scanner object to read input from the keyboard new Scanner(System in):
A: Given 11 public class CircleAndSphere 12 { 13 public static void main(String[] args) 14 1 15 // Step...
Q: What is the distinction between Stored Procedures and Scripts? What is the function of each? How d...
A: Introduction: A stored procedure (proc, storp, sproc, StoPro, StoredProc, StoreProc, sp, or SP) is a...
Q: 4. How Vector clock works? Illustrates with 3 processes, when the clock ticked for 2, 3, 4 times in ...
A: Computer Science Please I want a correct and clear solution for all the paragraphs, the solution m...
Q: Write a java program that reads in three strings and sorts them alphabetically. You can ask to enter...
A: In Java, we have s1.compareTo(s2) method which compares the given strings. and on the basis of com...
Q: what do understad by loop in programing?
A: Introduction: Here we are asked what do we mean by loop in programming.
Q: Create a UML class diagram for a credit union using these classes: - Branch - Bank Account - User...
A: UML Diagram of the given class
Q: What will be the value of x after the following code fragment is executed? int x = 3; if (x 2) x = 0...
A: Here in this question we have given a code segment and we have asked to execute this code and find ...
Q: alculate the time complexity for the following function in terms of Big O notation. Explain your ans...
A: we have to calculate the time complexity of the given code :- code given to us :- int fun(int n) { ...
Q: 8. Find the output. b1 = True b2 = False %3D b3 = False %3D if b1 or b2 and b3: print ("Hello!") els...
A: Find the output of the given Python code in which three boolean variables are declared and then if-e...
Q: Question 2 "To deal with a given risk, a network administrator chooses to mitigate it. What does thi...
A: When an administrator chooses to mitigate to deal with the given risk then it is referred to as Risk...
Q: Let f(n) and g(n) be asymptotically positive functions. Prove or disprove each of the following conj...
A:
Q: What model is used to assess the reliability of software?
A: Intro There are many models available to test the software, some of them are: Waterfall Model MUSA M...
Q: What is the difference between a device drive and a network interface card?
A: Introduction: A "network interface" is a piece of software. Typically, each network adapter has one ...
Q: Say you have a table called Exercise with two fields: Type_of_Exercise and Calories_Burned. How woul...
A: Answer: MySql Query: create table Exercise( Type_of_Exercise varchar(50) not null, Calories_Bu...
Q: To put it another way: When you think of address space, what does it mean?
A: Introduction: Only binary bits of '0' and '1' are used in the computer world to process information ...
Q: The set of all classes and their relationships (i.e., the set of all inheritance chains taken collec...
A: INTRODUCTION: A class is an expandable program-code-template for constructing objects in object-ori...
Q: why each device has more than one MAC address
A: A Devices may have more than one MAC address if the device has more than one network card. For examp...
Q: Define the characteristics that are required for test-driven development. In the event that you wish...
A: According to the question essential principles of check pushed improvement TDD and assuming that you...
Q: Homework 4 – Break the online on-line auction system onto microservices. Guidelines: The microservic...
A: Answer I am giving the example of creating the software so, you can easily understand. Auction Syste...
Q: C++ Programming Instructions Write a program that prompts the user for a sequence of characters (...
A: Use strlength () function to count the number of characters . Below is the code:
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:
SELECT ALL of the class methods from the class declaration below.
Step by step
Solved in 2 steps
- The Temperature class is an abstract class with two abstract methods. Create the Conversion class which inherits from Temperature. Use the formulas below to help with the temperature conversions. CODE: abstract class Temperature { public abstract double celsius(double temp); public abstract double fahrenheit(double temp);} //add class definitions below this line //add class definitions above this line public class Exercise3 { public static void main(String[] args) { //add code below this line Conversion c = new Conversion(); //add code above this line }}The BankAccount class described below is used to represent a personal savings account with a yearly interest rate, (represented as a percentage, e.g., a 7% rate is represented by .07). The interest is applied monthly, (i.e., at the end of each month 1/12 of the interest is deposited into the account). public class BankAccount { public BankAccount(double rate) public BankAccount(double initBal, double rate) public double getBalance() public double getIntRate() public void setIntRate(double rate) public void deposit(double amount) public void withdraw(double amount) public void addMonthsInterest() private double balance; private double intRate; } Suppose a bank offers to its special customers a new type of savings account, called a “Credit Account”, that allows the customer to withdraw extra money if needed, so that the account balance is allowed to be negative at some times. These accounts award interest at the end of every month, as long as the balance is positive. If the…class Time { private int hour; private int minute; private int second; public Time( ) { } public Time(int hr , int min, int sec) { } public void setTime(int hr , int min, int sec) { } public void printTime( ) { } public void tick( ) { // tick method defined } } The class Time defines a time object. It represents time (military time) in 2400 hours. 10 AM = 10 hours, 0 minutes and 0 seconds 4 PM = 16 hours, 0 minutes and 0 seconds 7:26PM = 19 hours, 26 miunutes and 0 seconds Assume 0 represents 00 in this case. 1) Implement the two constructor: Time(): will set the instance variables to zero. Time(int hr , int min, int sec): will set the time with parameters passed in. 2) Implement the setTime method to set the instance variables according to the values passed in. 3) Implement the printTime method to print time in hours:minutes:seconds e.g.…
- CLASS AND OBJECT WRITE! 1.) Write the main class of the given class Animal below that set the number of legs to “4” and display (get) the number of legs. class Animal { private int numberOfLegs; public void setNumberOfLegs(int numberOfLegs) { this.numberOfLegs = numberOfLegs; } public int getNumberOfLegs() { return numberOfLegs; } }Programming Language = Python 1. Employee and ProductionWorker Classes Write an Employee class that keeps data attributes for the following pieces of information: • Employee name • Employee number Next, write a class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should keep data attributes for the following information: • Shift number (an integer, such as 1, 2, or 3) • Hourly pay rate The workday is divided into two shifts: day and night. The shift attribute will hold an integer value representing the shift that the employee works. The day shift is shift 1 and the night shift is shift 2. Write the appropriate accessor and mutator methods for each class. Once you have written the classes, write a program that creates an object of the ProductionWorker class and prompts the user to enter data for each of the object’s data attributes. Store the data in the object and then use the object’s accessor methods to retrieve it and display it on the…Following is the class of Person: public class Person { private String Name; public int age; public void set(String Name, int age) { this.Name = Name; if(age > 0 && age <= 100) this.age = age; else this.age = 1; } public void display() { System.out.println("Name: " + this.Name +" ,Age: " + this.age); } public static void main(String[] args) { PersonManagement personManagement = new PersonManagement(); Person p1 = new Person(), p2 = new Person(), p3 = new Person(), p4 = new Person(), p5 = new Person(); p1.set("Asad", 103); p2.set("Ali", 17); p3.set("Usman", 16); p4.set("Raees", 18); p5.set("Mujeeb", 15); Person[] persons = new Person[]{p1,p2,p3,p4,p5};…
- Given the following code for a class named Employee, complete the following constructor public class Employee ( private int employeeID; private int SSN; public Emplyee(int employeeID, int SSN) {Vehicle is an abstract class. Create the Airplane class as a subclass of Vehicle. Extend and override Airplane as necessary to meet the criteria below. The travel method should return the distance traveled by the Airplane object. CODE: abstract class Vehicle { public abstract double travel(double time);} //add class definitions below this line //add class definitions above this line public class Exercise2 { public static void main(String[] args) { //add code below this line //add code above this line }}IN JAVA Look at the following class definition: public class Dog {private int age = 0; // age is given in years, the default value is 0private String name = "Fido"; // default name is FidoDog(String firstName, int firstAge) {name = firstName;age = firstAge;if (age < 0) {age = 0;}}public void setName(String newName) {name = newName;}public int getAge() {return age;}public String getName() {return name;}public void haveBirthdayParty() {age = age + 1;System.out.println("Happy birthday " + name + "! You are now " + age + " years old!");}public void printInfo() {System.out.println("This dog's name is " + name + " and he's " + age + " years old!");}} Make a post containing your answers to all of the questions below: Can you create a new dog without specifying its name? Why or why not? Which of the Dog class's methods are accessors? Which ones are mutators? Can you use the methods provided to make a dog younger? (In other words, can you set age to a lower value than it already was?)…
- Use Java Programming Language Loan Account Class: Create class LoanAccount. Use a static variable annualInterestRate to store the annual interest rate for all account holders. Each object of the class contains a private instance variable principal indicating the amount the person is borrowing. Provide method: public double calculateMonthlyPayment(int numberOfPayments) to calculate the monthly payment by using the following formula: double monthlyPayment = principal * ( monthlyInterest / (1 - Math.pow(1 + monthlyInterest, -numberOfPayments))); where monthly interest = annualInterestRate/12. Provide a static method setAnnualInterestRate that sets the annualInterestRate to a new value. Set the initial loan amount (Principal) for a new loan through the constructor. Write a program to test class LoanAccount. Instantiate two LoanAccount objects, loan1 and loan2, with principal loan amounts of $5000.00 and $31000.00, respectively. Set annualInterestRate to 1%, then calculate the monthly…IN JAVA PLEASE Child Class: Vegetable Write a child class called Vegetable. A vegetable is described by a name, the number of grams of sugar (as a whole number), the number of grams of sodium (as a whole number), and whether or not the vegetable is a starch. For the Vegetable class, write: the complete class header the instance data variables a constructor that sets the instance data variables based on parameters getters and setters; use instance data variables where appropriate a toString method that returns a text representation of a Vegetable object that includes all four characteristics of the vegetableDesign and implementation of Java (Draw UML) classes 1. Design a class named Bill to represent a square. 2. The class contains: • One data field called “Items” that defines the number of items. Another double data field called "price" defines the price. The default is 1.0. • no-arg constructor • constructor with parameters to create the invoice • method called getBill () that returns the item and price duplication. 3. Create a class and test a class (create three different objects and print the values of the variables and method)