NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

1. Create an application named TestMethods whose main() method holds two integer variables. Assign values to the variables. In turn, pass each value to methods named displayIt(), displayItTimesTwo(), and displayItPlusOneHundred(). Create each method to perform the task its name implies. Save the application as TestMethods.java.

2. Create an application named Numbers whose main() method holds two integer variables. Assign values to the variables. Pass both variables to methods named sum () and difference(). Create the methods sum() and difference(); they compute the sum of and difference between the values of two arguments, respectively. Each method should perform the appropriate computation and display the results. Save the application as Numbers.java. Add a method named product() to the Numbers class. The product() method should compute the multiplication product of two integers, but not display the answer. Instead, it should return the answer to the calling method, which displays the answer. Save the application as Numbers2.java.

3. Create a class named Eggs. Its main() method holds an integer variable named numberOfEggs to which you will assign a value entered by a user at the keyboard. Create a method to which you pass numberOfEggs. The method displays the eggs In dozens; for example, 50 eggs is 4 full dozen (with 2 eggs remaining). Save the application as Eggs.java.

4. Create a class named Exponent. Its main() method accepts an integer value from a user at the keyboard, and in turn passes the value to a method that squares the number (multiplies it by itself) and to a method that cubes the number (multiplies it by itself twice). The main() method displays the results. Create the two methods that respectively square and cube an integer that is passed to them, returning the calculated value. Save the application as Exponent.java.

5. Write an application that calculates and displays the weekly salary for an employee. The main() method prompts the user for an hourly pay rate, regular hours, and overtime hours. Create a separate method to calculate overtime pay, which is regular hours times the pay rate plus overtime hours times 1.5 times the pay rate; return the result to the main() method to be displayed. Save the program as Salary.java.

     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.