TutorMe homepage
Subjects
PRICING
COURSES
SIGN IN
Start Free Trial
Eshna D.
B.Tech Undergraduate in Computer Engineering at NIT Kurukshetra
Tutor Satisfaction Guarantee
Java Programming
TutorMe
Question:

What is the concept of passing an object as a parameter?

Eshna D.
Answer:

import java.io.*; class [roduct { int a; int b; product(int l, int h) { a = l; b = h; } void area(product r1) { int pro = r1.a * r1.b; System.out.println("product is : " + pro); } public static void main(String args[]) { product r1 = new product(10, 20); //creating object and passing values in constructor r1.area(r1); //passing objects as arguments } } In the above java code we have used objects as parameter to a function input to compute the product of to numbers. Here we have made an object of class product and called the function in the main function and have passed an object of the class as input. This does the similar work as structures in C, just much simpler. Benefits : Multiple properties of a class can be worked on using jut one object and makes things easier.

Computer Science (General)
TutorMe
Question:

What is the difference between the direct, register and register indirect addressing modes of a processor?

Eshna D.
Answer:

--> Now addressing modes can be specified in the 'mode field' of an instruction format. It is used to tell how the operands are to be accessed using the address defined in 'address field' of the instruction format. --> Differences are listed below : 1. Direct addressing mode- eg. MOV AX, [5000H] Here, the location 5000H is offset address and the final effective address(EA) is found out by multiplying Data Segment Register DS content with 10 and adding 5000H, i.e., EA=10*DS+5000H 2. In Register Addressing Mode- eg. MOV AX, BX There is NO reference to memory as just the registers of the CPU are used to transfer the data of one to another, i.e., data of BX(source) is overwritten on the data of AX(destination). 3. In Register Indirect Mode - eg.- MOV AX, [BX] Here effective offset address is the content of BX register, thus final effective address is EA= DS*10+[BX] NOTE : In the MOV instruction the both source an destinations can never be memory locations or immediate data.

Algebra
TutorMe
Question:

If x^2 -3x +1 =0, then the value of x^3 + 1/(x^3) is:

Eshna D.
Answer:

Now, we first focus on what the question is asking about. Here it's asking the value of x^3. Now an important thing to consider is, x*(1/x) is 1. So, we use this and also the formula of (x+y)^3= x^3+y^3+3yx^3+3xy^2. ....eq 1 From the given question, x^2+1=3x => (x^2+1)/x=3 => x+1/x= 3 .....eq 2 Now, from eq 1 if x=x and y=1/x x^3+(1/x^3) = (x+1/x)^3 - 3*x*1/x (x+ 1/x) Substituting value from eq 2 x^3+ (1/x^3) = 3*3*3 - 3*3 = 27-9 = 18 Ans= 18 Now this is how we can apply different formulas that we already know and apply it for evaluation of required expressions.

Send a message explaining your
needs and Eshna will reply soon.
Contact Eshna
Ready now? Request a lesson.
Start Session
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 Session" 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.