Question

Define the magnitude of a number as the location of the decimal point from the left...

Define the magnitude of a number as the location of the decimal point from the left of the number (that is, if a number has 4 digits followed by the decimal point, it will have a magnitude of 4). 100 would then have a magnitude of 3 and 88,888.888 would have a magnitude of 5. A partial recursive method is given below to compute a positive int parameter's magnitude. Which answer below is needed to complete the method?

magnitude(x - 1) + 10;

magnitude(x / 10) * 2;

magnitude(x / 10) + 1;

magnitude(x - 10) + 1;

magnitude(x / 10) + 10;

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The idea to understand this is the following: Consider a number which has magnitude . Then if is considered, then there will be an additional position before the decimal. Hence, the magnitude will increase by 1.

In other words, the magnitude of will be smaller by 1, hence it will be .

Hence, .

Hence, the third option is the correct answer.

Comment in case of any doubts.

Add a comment
Know the answer?
Add Answer to:
Define the magnitude of a number as the location of the decimal point from the left...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • If the number is a decimal please include 4 digits past the decimal point if available....

    If the number is a decimal please include 4 digits past the decimal point if available. 4. 2 points PSE6 4.P049 My Notes A ball on the end of a string is whirled around in a horizontal circle of radius 0.340 m. The plane of the circle is 1.00 m above the ground. The string breaks and the ball lands 1.60 m (horizontally) away from the point on the ground directly beneath the ball's location when the string breaks. Find...

  • Consider the physical situation shown below. Point R is to the left. There is some location...

    Consider the physical situation shown below. Point R is to the left. There is some location on the x-axis, called point P, at which the electric field is zero. Determine, using a theory-based calculation, the location of point P. You know, that at some point away, the electric field of the negative charges will cancel out with the electric field of the positive charge.

  • If the number is a decimal please include 4 digits past the decimal point if available....

    If the number is a decimal please include 4 digits past the decimal point if available. 2. -12 points PSE6 4.P.007 My Notes A fish swimming in a horizontal plane has velocity vi = (4.00 İ + 5.00 j) m/s at a point in the ocean where the position relative to a certain rock is ri = (-10.01-4.00 j) m. After the fish swims with constant acceleration for 24.0 s, its velocity is v-(21.0-5.00) m/s. (a) What are the components...

  • 1a. convert the following decimal number to 32 bit single precision Floating point binary number and...

    1a. convert the following decimal number to 32 bit single precision Floating point binary number and convert that binary number to hexadecimal NUMBER = -134.5 in decimal b. convert the following 32-bit single precision floating point number to decimal: 01000111111100000000000000000000 2. Using Booth's algorithm, multiply the decimal numbers -12 and +13. 3. you have two improvement alternatives, which is better and why? The first one improves 15% of the instructions, and it improves that speed by a factor of 6....

  • (3 pts) Consider an unsigned fixed point decimal (Base10) representation with 8 digits, 5 to the...

    (3 pts) Consider an unsigned fixed point decimal (Base10) representation with 8 digits, 5 to the left of the decimal point and 3 to the right. a.      What is the range of the expressible numbers?    b.      What is the precision?    c.       What is the error?    ______________________________________________________________________________   (3 pts) Convert this unsigned base 2 number, 1001 10112, to each base given below   (Note: the space in the binary string is purely for visual convenience) Show your work. Using...

  • Find the electric field magnitude and direction) at the location of qa in the figure below,...

    Find the electric field magnitude and direction) at the location of qa in the figure below, given that qb-9.30 μС and qc triangle 25.0 cm on a side -4 30 μC Point charges located at the corners of an equilateral la qc Magnitude IEI direction (wrt +x-axis)- Submit Answer Tries 0/10 what is the force (magnitude and direction) on ga, given that qa = 1.50 nC. Magnitude |FI direction (wrt +x-axis) Submit Answer Tries 0/10

  • If the number is a decimal please include 4 digits past the decimal point if available....

    If the number is a decimal please include 4 digits past the decimal point if available. 4. -12 points PSE6 4.P.017 My Notes A ball is tossed from an upper-story window of a building. The ball is given an initial velocity of 7.60 m/s at an angle of 23.0° below the horizontal. It strikes the ground 3.00 s later (a) How far horizontally from the base of the building does the ball strike the ground? (b) Find the height from...

  • Number per student per 4 students per 2 students MATERIALS: Location Rin Item Metric Ruler Meter Stck Laminated pap...

    Number per student per 4 students per 2 students MATERIALS: Location Rin Item Metric Ruler Meter Stck Laminated paper with ines labeled A B. and C 10 mL graduated cylinder Lab tabie Bin 1 per 2 students students 1 per students inder Rir 1 pen lin students 1 pen 1 per 2 students 1 per 2 students per 2 students per 2 students per 2 students per 2 students Lper 2 students- per 2 students per 2 students per 4...

  • Define a test method testfindMax that exercises Calculation.findMax() in Calculation class Define a tearDown() method Given...

    Define a test method testfindMax that exercises Calculation.findMax() in Calculation class Define a tearDown() method Given the following code below: 6. 7. 1. public class Calculation { 2. //method that returns cube of the given number 3. public int findMax(int ac[]}{ 4. int max=0; 5. for(int į=1;i<acr.length;i++){ if(max<arc[i]). max=acc[i]; } 8. return max: 10. } 11. //method that returns cube of the given number 12. public static int cube(int n){ 13. return n*n*n; 14. 15. } } 9. }

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT