1 / 3

Open Powerpoint 1.4 Also open the assignment Middle

Open Powerpoint 1.4 Also open the assignment Middle. Java’s Math class. Allows you to do basic math functions Not necessary to import it 3 methods you must know: Math.abs ( num ) // find the absolute value of num Math.pow (base, exp ) // raises base to the exp power

ling
Download Presentation

Open Powerpoint 1.4 Also open the assignment Middle

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Open Powerpoint 1.4 • Also open the assignment Middle

  2. Java’s Math class • Allows you to do basic math functions • Not necessary to import it • 3 methods you must know: • Math.abs(num) // find the absolute value of num • Math.pow(base, exp) // raises base to the exp power • Math.sqrt(num) // finds the square root of num • Demo: MathDemo

  3. Assignments • Review powerpoint 1.4, especially the substring example. • (Lettahs) Prompt the user to enter their full name (on one line, not separately). Then…. • If the user forgot to enter a space, make them try again until they get it right. • Display the number of characters in the name (not including the space). • Display the 1st letter, the 3rd letter, and the last letter (of the full name). • Display the name in all caps. • If the letters A and Z are both in the name, display “both.” • Display the characters from index #4 to (and including) index #6 • Display the characters from index #2 to the end of the name • Display the person’s initials only. • (QBrating) Click here for the NFL QB Rating Formula. (Take note of the line “a, b, c, and d can not…) Also, look up any NFL QB’s 2013 stats (completions, attempts, yards, TDs, and INTs). Then, write a program that asks the user for those 5 stats, and displays the correct QB rating.

More Related