Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
11th Edition
ISBN: 9780134670942
Author: Y. Daniel Liang
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 4.2, Problem 4.2.1CP

Evalute the following method calls:

  1. (a) Math.sqrt(4)
  2. (b) Math.sin(2 * Math.PI)
  3. (c) Math.cos(2 * Math.PI)
  4. (d) Math.pow(2, 2)
  5. (e) Math.log(Math.E)
  6. (f) Math.exp(1)
  7. (g) Math.max(2,Math.min(3, 4))
  8. (h) Math.rint(−2.5)
  9. (i) Math.ceil (−2.5)
  10. (j) Math.floor(−2.5)
  11. (k) Math.round(−2.5f)
  12. (l) Math.round(-2.5)
  13. (m) Math.rint(2.5)
  14. (n) Math.ceil (2.5)
  15. (o) Math.floor(2.5)
  16. (p) Math.round(2.5f)
  17. (q) Math.round(2.5)
  18. (r) Math.round (Math, abs (-2.5))
Blurred answer
Students have asked these similar questions
Solve the following problem by writing methods/functions A)  Write a method int sum (int, int) with takes 2 parameter as an input to the function and return the sum of these numbers(negative or positive) , to the calling function by using recursion g.   sum (6, 5 ) return 11 sum (-4, 3) return  -1 sum (-3, -4 ) return -7   B) Write a method age (i) which takes input age in numbers of days as a parameters print the age in years and month Age (3750) will print 10 years, 3 months Solve with C#
What is the running time of the method question1( int n ) as a function of n? Justify your answer.   Appendix 1 has some summation formulas that you may (or may not) find useful.   void question1( int n ) {     for ( int k = 1; k <= n; k++ ) {         question2( k );     } }   void question2( int m ) {     if ( m == 0 ) {         return;     }     else {         question2( Math.floor( m/2 ) );     } }
Define a method maxNumber() to complete the following program. MethodmaxNumber() is to find the largest of the three numbers

Chapter 4 Solutions

Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)

Ch. 4.3 - Evaluate the following: Int i = '1'; int j ='1' +...Ch. 4.3 - Can the following conversions involving casting be...Ch. 4.3 - Show the output of the following program: public...Ch. 4.3 - Write the code that generates a random lowercase...Ch. 4.3 - Show the output of the following statements:...Ch. 4.4 - Suppose s1, s2, and s3 are three strings, given as...Ch. 4.4 - Prob. 4.4.2CPCh. 4.4 - Show the output of the following statements (write...Ch. 4.4 - Prob. 4.4.4CPCh. 4.4 - Let s1 be " Welcome " and s2 be " welcome ". Write...Ch. 4.4 - Write one statement to return the number of digits...Ch. 4.4 - Write one statement to return the number of digits...Ch. 4.5 - If you run Listing 4.3 GuessBirthday.java with...Ch. 4.5 - If you enter a lowercase letter such as b, the...Ch. 4.5 - What would be wrong if lines 6 and 7 are in...Ch. 4.6 - Prob. 4.6.1CPCh. 4.6 - Prob. 4.6.2CPCh. 4.6 - Show the output of the following statements: (a)...Ch. 4 - (Geometry: area of a pentagon) Write a program...Ch. 4 - (Geometry: great circle distance) The great circle...Ch. 4 - (Geography: estimate areas) Use the GPS locations...Ch. 4 - (Geometry: area of a hexagon) The area of a...Ch. 4 - (Geometry: area of a regular polygon) A regular...Ch. 4 - (Random points on a circle) Write a program that...Ch. 4 - (Corner point coordinates) Suppose a pentagon is...Ch. 4 - (Find the character of an ASCII code) Write a...Ch. 4 - (Find the Unicode of a character) Write a program...Ch. 4 - (Guess birthday) Rewrite Listing 4.3,...Ch. 4 - (Decimal to hex) Write a program that prompts the...Ch. 4 - (Hex to binary) Write a program that prompts the...Ch. 4 - (Vowel or consonant?) Write a program that prompts...Ch. 4 - (Convert Letter grade to number) Write a program...Ch. 4 - (Phone key pads) The international standard...Ch. 4 - (Random character) Write a program that displays a...Ch. 4 - (Days of a month) Write a program that prompts the...Ch. 4 - (Student major and status) Write a program that...Ch. 4 - (Business: check ISBN-10) Rewrite Programming...Ch. 4 - (Process a string) Write a program that prompts...Ch. 4 - (Check SSN) Write a program that prompts the user...Ch. 4 - (Check substring) Write a program that prompts the...Ch. 4 - 23 (Financial application: payroll) Write a...Ch. 4 - (Order three cities) Write a program that prompts...Ch. 4 - (Generate vehicle plate numbers) Assume that a...Ch. 4 - (Financial application: monetary units) Rewrite...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Introduction to Big O Notation and Time Complexity (Data Structures & Algorithms #7); Author: CS Dojo;https://www.youtube.com/watch?v=D6xkbGLQesk;License: Standard YouTube License, CC-BY