Enable contrast version

Tutor profile: Ummesalma G.

Inactive
Ummesalma G.
Tutor for 4+ years
Tutor Satisfaction Guarantee

Questions

Subject: Python Programming

TutorMe
Question:

Consider the following "Point" object in Python. Explain what will happen when this code is executed. point = Point(0,1) class Point: def __init__(self, x, y): self.x = x self.y = y

Inactive
Ummesalma G.
Answer:

The program results in a NameError exception at the 'point = Point(0,1)' line as the object Point is not defined. Python is an interpreted language. This means that lines of code are read and executed sequentially. When an exception is encountered, the program stops execution and displays the exception. On line 1, Python does not see the definition of object Point on line 3. Therefore, it raises an exception and stops.

Subject: Java Programming

TutorMe
Question:

Consider the snippet of Java code below. Explain what will be printed on screen when this snippet is run. String w = "abc"; String x = "abc"; int y = 1; int z = 1; System.out.println(w == x); // (1) System.out.println(y == z); // (2)

Inactive
Ummesalma G.
Answer:

Line 1 would print `false`, while Line 2 would print `true`. The `==` operator in Java compares the references of two objects on the heap. `==` answers the question, 'Do both objects point to the same memory reference on the heap?' and also checks if the object is null. The `w.equals(x)` would have compared the value of both objects. Furthermore, Line 2 prints true because y and z are both objects of primitive types (such as int, double, boolean, etc.) where as String is not a primitive type. When comparing using `==` for primitive types, Java checks their values. Primitive types also do not have a '.equals' method defined for them.

Subject: Databases

TutorMe
Question:

Describe the features of a primary key in a database table.

Inactive
Ummesalma G.
Answer:

- A primary key can be defined over a set of unique keys in a table. - While a unique key column can contain NULL values, a primary key cannot be NULL. - For a relational database table, a primary key must be defined. - A relational database table can have multiple unique keys defined, which can be used to enforce data integrity checks.

Contact tutor

Send a message explaining your
needs and UmmeSalma will reply soon.
Contact UmmeSalma

Request lesson

Ready now? Request a lesson.
Start Lesson

FAQs

What is a lesson?
A lesson is virtual lesson space on our platform where you and a tutor can communicate. You'll have the option to communicate using video/audio as well as text chat. You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.
How do I begin a lesson?
If the tutor is currently online, you can click the "Start Lesson" button above. If they are offline, you can always send them a message to schedule a lesson.
Who are TutorMe tutors?
Many of our tutors are current college students or recent graduates of top-tier universities like MIT, Harvard and USC. TutorMe has thousands of top-quality tutors available to work with you.