Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

mb707/2022-Fall-CIS-12-JavaCourse-Java-Lab-004

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java-Lab-004

Part 1: SimpleMethod.java

  • Add a method square() to SimpleMethod.java that takes a single argument and prints the result of squaring its integer parameter.

Part 2: SimpleMethod2.java

  • In SimpleMethod2.java, expand the square function to return the result of the square as type int
  • In the main class use System.out and Scanner to request the integer argument you'll pass to the square method.
  • Store the result from square in an integer variable in main and print the result.

Part 3: SimpleMethod3.java

  • Modify SimpleMethod3's square methods to use Math.pow instead of simple multiplying the numbers yourself.
  • Complete both the integer and the double square functions, this is called method overloading!

Part 4: Radians.java

  • Write a method called toRadians that converts degrees to radians without using the Java Math library.
    • HINT: degrees = radians * 180 / PI
  • Write a method called toDegrees that converts radians to degrees without using the Java Math library.
    • HINT: radians = degrees * PI / 180
  • In the main function, compare your method's results to the Math.toRadians and Math.toDegrees methods by printing to the console.

Part 5 - Submission

  • Commit your working code
  • Push it to your Remote/origin branch (i.e. GitHub)
  • Then issue a Pull request to the instructor branch
    • Make sure to save the Pull request URL and submit it for the lab.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.