Which of the following statements is false? O a. Assigning an object to a variable binds (associates) that variable's name to the object. You can then use the variable in your code to access the object's value. O b. After the following snippet's assignment, the variable x refers to the integer object containing 7. x = 7 O c. The following statement changes x's value: x + 10 O d. The following statement changes x's value: X = x + 10
Q: QUESTION 12 Given a code snippet below. What is the content of variable wide? float final (int a) {…
A: We are given a code and we are going to find output of it. Please refer image for clear solution.
Q: What is the stored in the object obj in following lines of Java code?
A: Question. What is the stored in the object obj in following lines of Java code? box obj;
Q: Fyou expect to receive an "A+" in this course, which of the following declarations would be most…
A: According to the question below the solution.
Q: Given a certain temperature in Fahrenheit and a maximum wind velocity (speed) in Miles Per Hour,…
A: Actually, the code has given below:
Q: Consider the following code to answer below questions: public double calculatePerimeter(Shapes []…
A: Answer 1) In the above code violated, KISS Principle. KISS Stands for keep it simple and stupid…
Q: Declare each of the following variables as type int in JShell to determine which are valid and which…
A: Please find the answer below :
Q: Which of the following is not a valid variable name declaration? Select one: a. int __3under; b.…
A: Variables naming convention:- Must start with _ or letter. White spaces between words are not…
Q: Is there an error in the below code? Private _intSide As Integer Public Property Side As…
A: Question. Is there an error in the below code? Private _intSide As Integer Public Property…
Q: Which of the data types has the size that is variable? a) int b) struct c) float d) double
A: Question. Which of the data types has the size that is variable? int struct float double
Q: What is the error in the code below? my_struct_t *bar; /* ... do stuff, including setting bar to…
A: Question. What is the error in the code below? my_struct_t *bar; /* ... do stuff, including…
Q: What will be the value stored in the variable "s" after executing the following code segment? double…
A: Programming Approach: Defining the necessary header files. Defining the main function. Defining 2-D…
Q: Which of the following is correct declaration statement? Select one: O a. int num=new num[5]| O b.…
A: In Java, array is an object which contains elements of similar data type. Syntax for declaring an…
Q: Modify your working program from Assignment #19 so that when the user enters data into the Selling…
A: Description : Entry widgets are the basic widgets of Tkinter used to get input, for example text…
Q: Modify your working program from Assignment #19 so that when the user enters data into the Selling…
A: Note: Follow proper indentation to get output. Basic Methods used in Program: mainloop(): mainloop…
Q: The following declaration, program, and program segment has errors. Locate as many as you can. class…
A: Given: The following declaration, program, and program segment has errors. Locate as many as you…
Q: Which is the correct declaration for m= 123.50, e=”vb programming”, g = 1 and y = m? Select one:…
A: The answer 1)dim m as double, e as string, g as integer, y as double 2)Object.property.value…
Q: Learn C# beginner programming - Simple code - Im stuck on the Date format. Im creating a int for…
A: Literal is a numeral constant or string constant value set to the integer variable and string…
Q: In which of the following variable declarations does the declared variable have a value of null? COW…
A: Coded using Java.
Q: Which of the following is a valid declaration of an object of class Box? Select one: O a. new Box…
A: In Java, Correct object declaration is class_name object_name = new class_name ();
Q: What will be the value stored in the variable "s" after executing the following code segment?double…
A: The complete code segment according to c language is given by: #include<stdio.h>int…
Q: Which of the following is a wrong statement? Variable can have different types of values Variable is…
A: A constant is a value that cannot be altered by the program during normal execution, i.e., the value…
Q: EnterUppercaseLetters that asks the user to type an uppercase letter from the keyboard. If the…
A: C# is a popular programming language used to write different applications using the .NET framework.…
Q: Which of the following statements will compile without an error? O int myArray[] = {1,2,3,4,5}; int…
A: According to the Question below the Solution:
Q: What is the syntax, if we wanted to change the property of an object at run time? Select one: a.…
A: 1. The properties of an object can be set at design time by using the Properties window. Properties…
Q: What is the output of the following code? * System.out.println( 7.0 / (int) 2.0); D3.5…
A: The output of the expression "7.0/(int)2.0" is printed on the console using "System.out.println()"…
Q: .Which of the following is a valid declaration of an object of class Box? a) Box obj = new Box();…
A: Given, Choices: Box obj = new Box(); Box obj = new Box; obj = new Box(); new Box obj;…
Q: ecall the SpecificBox. When testing your class, what is the minimum number of test cases that should…
A: Test cases are used for testing the program that the program is evaluating all the test cases with…
Q: Suppose X is a variable of type char, which of the following statements checks whether X holds a…
A: Answer d) Character.isLetter(X); DescriptionThe method determines whether the specified char value…
Q: Q1. Which of the following is an example of Autoboxing? a) int avar = 10; Integer bvar = new…
A: Autoboxing is process of creating object of primitive data type and storing it in object of wrapper…
Q: Which of the following java statement(s) is/are correct to set the value of an index of the string…
A: As You metioned Not Explain SO I am Providing Answer Accordingly.
Q: Which of the following is an example of encapsulation? a. variable O b. class O c. constant O d.…
A: Question from basic concept of Object Oriented programming(OOP). We have to tell, which one is the…
Q: Which of the following instantiates an Animal object and assigns the object to the cat variable?a.…
A: Both statements “Dim cat As New Animal” and “Dim cat As Animal cat = New Animal” instantiates an…
Q: Consider the following code to answer below questions: public double calculatePerimeter(Shapes []…
A: Principle of method is violated in line 1 because when you write the method with parameters it…
Q: ould change if you see the above variable declar
A: var x = “blue”; is there anything that you would change if you see the above variable…
Q: What is the value of loc?
A: indexOf() in java The indexOf() method in java returns the index or location of the first occurrence…
Q: Which format specifier is used to read input for the following declaration? int price=20; a. %f…
A: Format specifiers They are utilized in C for enter and output. Using this idea the compiler can…
Q: How to use the try-catch statement in the driver program when instatiating a new paramerized…
A: To handle exception, you need to write try - catch block. In try statement, you can write block of…
Q: What will be the output of the following code if Radiolluttont is checked? Private Sub…
A: Please check your Question and find your Answer: if the Radiolutton1 button is Checked then It will…
Q: You are a manager of a Wally's Training Gym and you encourage your trainers to enroll new members.…
A: The code is given in the below step
Q: help me with this!! i need the output to be the same on what's on the photo here's my editable…
A:
Q: Fix the following line of code to change the visibility of the btnExitProgram Button object so that…
A: To make a property value as True in JavaScript or to enable a property, the boolean "True" is used.…
Q: Ask the user to enter 2 integers the second one being non-zero. Store these 2 values in int objects…
A: NOTE - Here I have used the Java programming language. In the code, I have taken input from the user…
Q: Which of the following variable declarations is illegal? Answers: Iv_junk NUMBER(3); а. Iv_junk…
A: Given data:- Which of the following variable declarations is illegal
Q: Which of the following is a correct parameter passing? O O O
A: Answer to the above question is in step2.
Q: Which of the following statements is the precise meaning for the statement n = 3?(a) n is a variable…
A: Which of the following statements is the precise meaning for the statement n = 3? (a) n is a…
Q: Q2:Assume that we have a Button object named btnPrint, and a method named print(). Write a statement…
A: Task :- write a statement for given object to trigger the specific method.
Q: what is the type of value returned by the following fumction ? carEstPlusPetit (char a, char b) int…
A: function
Q: Which of the following statements is true for the following code? class MyParent { … } class…
A: Here is the explanation about the access identifer.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Help me please: What is the output of the following statements? temporary object1; temporary object2("rectangle", 8.5, 5); temporary object3("circle", 6, 0); temporary object4("cylinder", 6, 3.5); cout << fixed << showpoint << setprecision(2); object1.print(); object2.print(); object3.print(); object4.print(); object1.set("sphere", 4.5, 0); object1.print();Please, I want to modify the code so that the user can add the employee's name, number and specialization, and use for loob He must add more than one employee. When he finishes adding the employee’s data, he asks the user: Do you want 1-Print the data 2-Add a new employee 3-Exit class Doctor:"""Represents a Doctor""" #initializer with specialization default to "general"def __init__(self, Id, name, specialization="general"):#attributesself.Id = Idself.name = nameself.specialization = specialization.lower() #initializing salary to 25000, basic salaryself.salary = 25000 #incrementing salary based on specialization#if specialization is pediatric, increasing salary by 10%if specialization == "pediatric":self.salary += self.salary*10/100 #if specialization is dental, increasing salary by 15%elif specialization == "dental":self.salary += self.salary*15/100 #str() functiondef __str__(self):return (f"Id: {self.Id} \n"f"Name: {self.name} \n"f"Specialization: {self.specialization} \n"f"Salary:…You are required to write a program that uses objects. Declare a class and create object(s) from the class in a main method, which can be in the same class or in a separate class. Identify the suitable data member(s) and method(s) for your object definition class. Upload your codes in one (1) PDF FILE. Please ensure that you submit your OWN work. Marks will be deducted if found guilty of copying/plagiarism. Given an airplane’s acceleration a and take-off speed v, you can compute the minimum runway length needed for an airplane to take off using the following formula: Write a program that prompts the user to enter v in meters/second (m/s) and the acceleration a in meters/second squared (m/s2), and displays the minimum runway length. Use Math.pow(a, b) to compute Throw exceptions if: non-numerical values entered (InputMismatchException type) division by zero occurred (a is zero) (ArithmeticException type) and display appropriate messages.
- Which of the below is a valid and correct constructor method for 'Movie' class? The attributes of the Movie objects are: name, director, year. The constructor will set all attributes. Lütfen birini seçin: a. def __init__(self, name, director, year): self.name = name self.director = director self.year = year b. def __init__(name, director, year): self.name = name self.director = director self.year = year c. None of the others d. def __init__(self, name, director, year): object.name = name object.director = director object.year = year e. def __init__(self, name, director, year, cast): object.name = name object.director = director object.year = year object.cast = castI need help based on the following question in the Screenshot 1)Given the following code snippet: Retraceable a = new ClassA();Retraceable b = new ClassB();a.retrace(); Whose method will be invoked in the function call a.foo()? Group of answer choices A)ClassB's implementation of retrace B)ClassA's implementation of retrace C)None - results in an error D)Retraceable's default implementation of retrace 2)Which of the following actions would be allowed? A)Creating an abstract class with implements Retraceable B)All of the given C)None of the given D)Adding additional methods to Class BCreate a new Python file in your project named FullName.py. In this module, create a class named FullName. When creating a FullName object, the client will pass a string for first name and a string for last name, which the constructor will assign to two attributes. Your class should have the following methods: __init__, __str__, and __gt__. __gt__ will compare two FullName objects using the following logic: If person A’s last name comes after person B’s last name alphabetically, person A is “greater than” person B. If their last names are equal, check their first names to see which is greater. Hint: The > and < operators are already overloaded for string objects, so your __gt__ method should be relatively simple. In your main.py file, demonstrate creating a few FullName objects and calling these methods on them.
- Hi there, I have attached the errors, the assignemnt is bleow and my code below that. PLease could you help fix these errors? Thank you so much in advance. Kind regards assignment: Make a class student (in student.py) that stores the following information for a student: Name (name) Student number (student_nr) Points per assignment (points_per_assignment) Exam grade (exam_grade) a) Behind each point of information is the name of the parameter to the initializer method. Store this information from the parameters in the object's attributes with the same name. b) Add a method course_points() which returns the number of course points the student has gotten. Example: mary = Student("Mary", 15789613, [10, 9, 8, 10, 9, 10], 9)print(mary.course_points()) > 121 The calculation of the course points is explained in the course overview, course setup slides (Links to an external site.) and the first lectureLinks to an external site.. c) Add a method grade() which returns a the final grade…I need help with this Java Problem as described in the image below: public class BaseItem { protected String lastName; public void setLastName(String providedName) { lastName = providedName; } // FIXME: Define printItem() method /* Your solution goes here */ }// ===== end ===== // ===== Code from file DerivedItem.java =====public class DerivedItem extends BaseItem { private String firstName; public void setFirstName(String providedName) { firstName = providedName; } @Override public void printItem() { System.out.print("First and last name: "); System.out.println(firstName + " " + lastName); }}// ===== end ===== // ===== Code from file ItemInventory.java =====import java.util.ArrayList; public class ItemInventory { public static void main(String[] args) { BaseItem baseItemPtr; DerivedItem derivedItemPtr; ArrayList<BaseItem> itemList = new ArrayList<BaseItem>(); int i; baseItemPtr = new BaseItem();…For the following prompt. I used 2 different codes but when start the program nothing shows up on the form. What am I doing wrong? Public Class frmMain Private mdlSample As Object Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'Display the Dormitory price in the list box ListBox1.Items.Add("Allen Hall - 2,500.00 ") ListBox1.Items.Add("Pike Hall - 2,200.00") ListBox1.Items.Add("Farthing Hall - 2,100.00") ListBox1.Items.Add("UniversitySuites - 2,800.00") End Sub Private Sub btnAddDormitory_Click(sender As Object, e As EventArgs) Handles btnAddDormitory.Click ' if user don't choose any price in list box Select Case ListBox1.SelectedIndex Case -1 MessageBox.Show("Select A Dormitory Please!") End Select 'Determine the value in Module and display the value of price to lblDormitory Select Case ListBox1.SelectedIndex Case 0…
- Which of the following statements are correct about the given code snippet? class A: def __init__(self, i = 0): self.i = i class B(A): def __init__(self, j = 0): self.j = j def main(): b = B() print(b.i) print(b.j) Group of answer choices Class B inherits A, but the attribute “i” in A is not inherited. Class B inherits A, thus automatically inherits all attributes in A. When you create an object of B, you have to pass an argument such as B(5). The attribute “j” cannot be accessed by object b. How many except statements can a try-except block have? Group of answer choices zero one more than one more than zeroThis is a debugging question I am struggling on - The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly. Code - public class DebugCustomer { protected int idNumber; protected String name; protected double creditLimit; public DebugCustomer(int id, name, double creditLimit) { idNumber = id; name = name; creditLimit = credit; } public void display() { System.out.println("Customer # + idNumber + Name: " + name, "\nCredit limit $" + creditLimit); } } ----- public class DebugCustomerMakingPurchase extends DebugCustomer { private double amountOfPurchase; private boolean overLimit; public DebugCustomerMakingPurchase(int id, String name, double credit, double purchAmount) { amountOfPurchase = purchAmount;…Suppose object1 and object2 are objects in the same class. When will the following if statement return true? if(object1 == object2)