private int gear; protected int speed; int id; public static final int wheels static int number0fBicycles - 0; 2; public Bicycle(int startCadence, int star startGear; gear
Q: propriate stc ation, which e and reliabi
A: The method used here is not appropriate as the establishment of the session here is is done for the ...
Q: Find the total number of binary strings of n length in which we don't have two consecutive zero's. I...
A: import java.io.*; import java.util.*; public class Main{ public static void main(String[] args) thro...
Q: how to use break and continuous in conversion of string into a list in python for example "aababba"...
A: Python Code for the given question def _print(string): print(string[0], end = "") for i in range(1,...
Q: Is there a variety of processing techniques? Which are parallel and which are serial?
A: Introduction: Serial processing is a CPU processing approach in which only one process is run at a t...
Q: I have to search a word in a file and count how many words in and how long takes to find it. My code...
A: A logic which can be implemented is that the empty line is also counted as word so since empty line ...
Q: What does the phrase "interdependence" mean in terms of system concepts, and how does it vary from o...
A: Introduction: Interdependence is the situation of being mutually reliant or simply dependent on one ...
Q: Enter the radius: The radius: 5.0 Enter the radius: The radius: 5.0 The circle circumference: 31.415...
A: According to the information given:- We have to fix the sphere volume value...
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: Construct a PDA that accepts the language generated by the grammar: S → aSb | AB | ε A → Ba | ccc ...
A: Here is the detailed explanation of the solution
Q: What component of hardware enables a device's physical network connection?
A: Network Interface Cards. A network interface card (NIC) establishes a physical connection between a ...
Q: An Interface class for Stack Operations in a package named myPack. (b) A Class that implements the ...
A: Importing packages Creating interface class stack operations Declaring operation functions in interf...
Q: There are different stages in the instruction cycle.
A: Different cycles based on different instruction sets can be found in each computer's CPU, but they w...
Q: What is the ARM statement which correspond to the each following statement and find the value of RO?
A: The answer is
Q: Use the database diamonds under the package "tidyverse" for this question. Using R Studio, Write...
A: I downloaded the said file in csv format. I extracted the cases from 20001 to 30000 (total 10000 cas...
Q: Requirements engineering is a discipline that involves establishing and documenting requirements. Va...
A: Requirements engineering is a discipline that involves establishing and documenting requirements. Va...
Q: How language shapes the way we think
A: Intro language shapes the way we think
Q: What is your opinion between fake and factual information in the internet?
A: The internet is a fantastic tool. It enables us to communicate with individuals from all over the wo...
Q: not upload already uploaded answer.... Otherwise I'll downvote multiple times
A: Introduction: When developing software, TDD is a procedure in which software requirements are transl...
Q: Implement an immutable class MyBigInteger using String Provide methods toString, add and subtract, m...
A: Below i have answered:
Q: Reversing a queue can be simply done by dequeuing the queue until it's empty and then enqueuing the ...
A: the answer is given below:-
Q: Consider the following code snippet which uses heap for address and owner data members. Design, decl...
A: int implies that it is actually the variable which has the datatype as integer. sizeof(int) this imp...
Q: public class Bicycle { public int cadence; private int gear; protected int speed; int id; public sta...
A: Consider the following Class: public class Bicycle { private int cadence; private int gear; privat...
Q: You are required to model a vehicle parking lot system.
A: Program Explanation: Import the util and text classes Define a class for implementing the parking...
Q: 5. Convert the following E/R diagrams to a relational database using the straight-E/R method.
A: a)
Q: Given four propositions A, B, C, and D, how many models are there for the sentence “(C or D) and ...
A: Given four propositions A, B, C, and D, how many models are there for the sentence “(C or D) and n...
Q: What's the difference between Stored Procedures and Scripts? What is the purpose of each? How does e...
A: Introduction: A stored procedure (also known as a proc, storp, sproc, StoPro, StoredProc, StoreProc,...
Q: cleAndSphere.java // Step 1: Import the Scanner class for input import java.util.Scanner; /** * A Ja...
A: CORRECTED PROGRAM CODE: // Step 1: Import the Scanner class for inputimport java.util.Scanner;/* * A...
Q: What is the difference between a device drive and a network interface card?
A: Defined the the difference between a device drive and a network interface card
Q: Assume that the circuit in Figure 5.3 indicates an invalid code for binary 1000 and 1001 in addition...
A: The circuit contains three NAND gates, one OR and one NOT gate. two inputs are provided at the initi...
Q: What are the three types of things that can be stored in computer memory?
A: The three types of things that can be stored in computer memory
Q: Question 2: Prove An (BU C) = (An B) U (An C).
A: Step by step explanation is in given below.
Q: 2. Write a JAVA program to find the sum of all elements greater than 50 in the array given belo int ...
A: code
Q: Class CPI % of instructions 1 20% 50% C 30% 3. A B.
A: The answer is
Q: Problem: Create a C program that will use a function, that will perform and display the sum, differe...
A: 1)Display menu for the user 2)Read choice from the user 3)Read first and second number from the u...
Q: Payroll is a good example of when it makes sense to do a lot of work at once, using magnetic tape. P...
A: Introduction Storage Device: A storage device is a device that stores, extracts, and transfers data...
Q: Internet investigation is being used. the deeds of Mafiaboy In what time period and via what means d...
A: Mafiaboy is nicknamed the "bratty-kid" who brought the internet down. Michael Calce (Mafiaboy) was b...
Q: (b). What method is included in the client code?
A: Following methods are included in client code:- getSecurityManager()getOutputStream()readLine()
Q: Question 2: A student will not be allowed to sit in exam if his/her attendance is less than 75%. Tak...
A: Java program to find the percentage of attendance
Q: Father of COMPUTER?
A: We need to find who is the Father of computer.
Q: A special static method named_is used to provide a starting point for the execution of a program usi...
A: special static method method named is
Q: Which data structure to use? Suppose you need to store a list of elements, if the number of elements...
A: Which data structure to use? Suppose you need to store a list of elements, if the number of elements...
Q: Problem: Our task will be to design a VHDL component that provides basic stop watch functionality. Y...
A: This is an universal code for Digital stop watch and the code is library IEEE; use IEEE.STD_L...
Q: If you enqueue five elements into an empty queue and push the same elements in exactly the same orde...
A: Here in this question we have given a queue and stack..and we have asked to enqueue all in queue.and...
Q: Write a C++ program to demonstrate the use of the scope resolution :: operator in the case of global...
A: Write a C++ program to demonstrate the use of the scope resolution :: operator in the case of global...
Q: The code class ClassName(): is creating an object. True or False?
A: given, class ClassName(): We have to tell it is creating an object or not. let's discuss below:
Q: JAVA: You are required to model a vehicle parking lot system. The parking lot has a facility to par...
A: #vehicle parking system: // superclasspublic class Vehicle { private String model;private String col...
Q: Suppose the implementation of an instruction set architecture uses three classes of instructions, wh...
A: The answer is
Q: (c++)write a program to insert node at specified number in single linked list? (c++)write a program...
A: “Since you have asked multiple questions, we will solve the first question for you. If you wa...
Q: Ql: Select all possible correct answer(s): Based on Play fair algorithm, how many lette the cipher t...
A:
Q: If you have previous experience troubleshooting wireless LAN's, give an example of a scenario you ha...
A: NOTE :- Below i explain the answer in my own words by which you understand it well. Wireless ne...
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 valid statements that instantiate an object from the Bicycle class shown below.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- public class LabProgram { public static void main(String args[]) { Course course = new Course(); String first; // first name String last; // last name double gpa; // grade point average first = "Henry"; last = "Cabot"; gpa = 3.5; course.addStudent(new Student(first, last, gpa)); // Add 1st student first = "Brenda"; last = "Stern"; gpa = 2.0; course.addStudent(new Student(first, last, gpa)); // Add 2nd student first = "Jane"; last = "Flynn"; gpa = 3.9; course.addStudent(new Student(first, last, gpa)); // Add 3rd student first = "Lynda"; last = "Robison"; gpa = 3.2; course.addStudent(new Student(first, last, gpa)); // Add 4th student course.printRoster(); } } // Class representing a student public class Student { private String first; // first name private String last; // last name private double gpa; // grade point average…Public classTestMain { public static void main(String [ ] args) { Car myCar1, myCar2; Electric Car myElec1, myElec2; myCar1 = new Car( ); myCar2 = new Car("Ford", 1200, "Green"); myElec1 = new ElectricCar( ); myElec2 = new ElectricCar(15); } }Public Class SavingsAccount { float interest; float FixedDeposit; SeniorAccount(float interest, float FixedDeposit) { this. interest = interest; this.fixedDeposit= FixedDeposit; } float calculateInterest(); { System.out.println(“Calculating Savings Account Interest”); return(FixedDeposit*interest/100); } } Public Class SeniorAccount extends SavingAccount { float seniorInterest; SeniorAccount(float interest, float FixedDeposit) { this.seniorInterest=interest; super(interest, FixedDeposit) } float calculateInterest() { System.out.println(“Calculating Savings Account Interest”); return(FixedDeposit*seniorinterest/10); } } Public static void main(String args[]) { SavingsAccount saving = new SavingsAccount(6,100000); System.out.println(saving.calculateinterest()); SeniorAccount senior=new seniorAccount(10,100000); System.out.println(Senior.calculateInterest()); } Rubric: Correct the syntax and logical errors Proper working code
- Public Class SavingsAccount { float interest; float FixedDeposit; SeniorAccount(float interest, float FixedDeposit) { this. interest = interest; this.fixedDeposit= FixedDeposit; } float calculateInterest(); { System.out.println(“Calculating Savings Account Interest”); return(FixedDeposit*interest/100); } } Public Class SeniorAccount extends SavingAccount { float seniorInterest; SeniorAccount(float interest, float FixedDeposit) { this.seniorInterest=interest; super(interest, FixedDeposit) } float calculateInterest() { System.out.println(“Calculating Savings Account Interest”); return(FixedDeposit*seniorinterest/10); } } Public static void main(String args[]) { SavingsAccount saving = new SavingsAccount(6,100000); System.out.println(saving.calculateinterest()); SeniorAccount senior=new seniorAccount(10,100000); System.out.println(Senior.calculateInterest()); } Correct the syntax and logical errorBased on Figure 3, create a class named Child that inherits the Father class. Declare an instance name location (String) for class Child. [3 marks]Incorrect Question 6 public class Shape { Color fillColor; } public Shape() { fill Color = Color. RED; } } public Shape(Color fillColor) { this.fill Color = fillColor; } public class Circle extends Shape { int radius; public Circle() { radius = 1; } public Circle(int radius) { this.radius = radius; } public Circle(int radius, Color fillColor) { } super(fillColor); this.radius = radius; Circle c1= new Circle(); Circle c2= new Circle(5); Circle c3 = new Circle(10, Color.BLUE); Which of the following are correct? c2 has radius 5 c1 is red c2 is red c3 has radius 10 c3 has radius 1 c3 is red c1 is blue ✔c2 has radius 10 c3 is blue c1 has radius 5 c1 has radius 1 c2 has radius 1 c2 is blue
- Class Quiz public Quiz (int quesList, int quesMissed) {quesList = this.quesList;quesMissed = this.quesMissed;} private void calculate(){// get the point worth of each question and calculate final scorepointsPerQues = (100/quesList);scoreQuiz = quesList - quesMissed;} Class PassFailQuiz public PassFailQuiz (int quesList, int quesMissed, int scoreQuiz) { super(quesList, quesMissed);} How do I move scoreQuiz from private void calculate() to equal the third constructor value in PassFailQuiz?public class Person { private String personID; private String firstName; private String lastName; private String birthDate; private String address; public Person(){ personID = ""; firstName = ""; lastName = ""; birthDate = ""; address = ""; } public Person(String id, String first, String last, String birth, String add){ setPerson(id,first,last,birth,add); } public void setPerson(String id, String first, String last, String birth, String add){ personID = id; firstName = first; lastName = last; birthDate = birth; address = add; } public String getFirstName(){ return firstName; } public String getLastName(){ return lastName; } public String getBirthdate(){ return birthDate; } public String getAddress(){ return address; } public void print(){ System.out.print("\nPerson ID = " + personID); System.out.print("\nFirst Name = " +firstName); System.out.print("\nLast Name = " +lastName); System.out.print("\nBirth Date = " +birthDate); System.out.print("\nAddress = " +address); } public String…public class Person { private String personID; private String firstName; private String lastName; private String birthDate; private String address; public Person(){ personID = ""; firstName = ""; lastName = ""; birthDate = ""; address = ""; } public Person(String id, String first, String last, String birth, String add){ setPerson(id,first,last,birth,add); } public void setPerson(String id, String first, String last, String birth, String add){ personID = id; firstName = first; lastName = last; birthDate = birth; address = add; } public String getFirstName(){ return firstName; } public String getLastName(){ return lastName; } public String getBirthdate(){ return birthDate; } public String getAddress(){ return address; } public void print(){ System.out.print("\nPerson ID = " + personID); System.out.print("\nFirst Name = " +firstName); System.out.print("\nLast Name = " +lastName); System.out.print("\nBirth Date = " +birthDate); System.out.print("\nAddress = " +address); } public String…
- UML for the following Code: public class ProductOrder { private int numBook = 0; private int numCD = 0; private int numDVD = 0; public ProductOrder(int numBook, int numCD, int numDVD){ this.numBook = numBook; this.numCD = numCD; this.numDVD = numDVD; } public int getBook(){ return numBook; } public void setBook(int numBook){ this.numBook = numBook; } public int getCD(){ return numCD; } public void setCD(int numCD){ this.numCD = numCD; } public int getDVD(){ return numDVD; } public void setDVD(int numDVD){ this.numDVD = numDVD; } public int getProductTotal(){ return getBook() + getCD() + getDVD(); } }3 public class ShippingCalculator { public static void main(StringO args) { new Scanner(System.in); 1 st passed 5 Scanner scnr int shipWeightPounds; int shipCostCents = 0; final int FLAT_FEE_CENTS = 75; 7 Altasts passed 8 10 final int CENTS_PER_POUND = 25; System.out.print("Enter shipping weight: "); shipWeightPounds = scnr.nextInt(); shipCostCents = FLAT_FEE_CENTS + shipWeightPounds * CENTS_PER_POUND; 11 12 13 14 15 16 17 System.out.println("Weight(lb): " + shipWeightPounds); 19 Suctom Aut nnin+1nr"Elnt foofconte): ELAT CCE CETS): Run X Testing shipWeightPounds = 10 Output differs. See highlights below. Special character legend Enter shipping weight: Weight (lb) : 10 Flat fee (cents): 75 Your output Cents per pound: 25 Shipping cost (cents) : 325 Weight (1b) : 10 Flat fee (cents): 75 Expected output Cents per pound: 25 Shipping cost (cents): 325 X Testing shipWeightPounds = 2public class Player { private int jerseyNumber; private int rating; public Player(int jerseyNumber, int rating) { this.jerseyNumber = jerseyNumber; this.rating = rating; } public int getJerseyNumber() { return jerseyNumber; } public void setJerseyNumber(int jerseyNumber) { this.jerseyNumber = jerseyNumber; } public int getRating() { return rating; } public void setRating(int rating) { this.rating = rating; } @Override public String toString() { return "Jersey number: " + jerseyNumber + ", Rating: " + rating; }}public class RosterManager { private ArrayList<Player> roster; public RosterManager() { roster = new ArrayList<>(); } public void addPlayer(Player player) { roster.add(player); } public void updatePlayerRating(int jerseyNumber, int newRating) { for (Player player : roster) { if (player.getJerseyNumber() ==…