Question: Create a package called Q 3 . Create a java class called AdditionOverload which will use the header and footer with your information that you

Create a package called Q3.
Create a java class called AdditionOverload which will use the header and footer with
your information that you created in Q1.
Define three overloaded methods for addition.
o The first of which will accept two strings as argument and return the added strings
when called. The method must have the following header:
public static dataType addVals(dataType str1, dataType str2);
o The second one will accept two real numbers as argument and return the added
result when called. The method must have the following header:
public static dataType addVals(dataType num1, dataType num2);
o The third one will accept two characters as argument and return the resultant
character after adding those two when called. The method must have the following
header:
public static dataType addVals(dataType char1, dataType char2);
Define the main() method with the following specifications:
o Call your myHeader() method available in MyMethods class in package Q1, with
appropriate arguments, after following the same formalities as you did in Q2.
o Prompt the user to enter two real numbers (see the sample output). Call the
addVals() method to add these numbers, and print their sum in the main() using printf() method that should print the result with up to two decimal places (see the
sample output).
o Prompt the user to enter two characters. Call the addVals() method to add these
two characters, and print the resultant character along with the integer equivalent
value in the main() using printf() method as shown in the sample output. You can
cross-check your result from the Unicode table Prompts the user to input a full name. Watch out: as discussed in the class with
examples (Unit 2.4), here you need to clear the buffer before accepting the input
using nextLine() method.
o Call the addVals() method to add the strings My name is (or I am ; your call)and
the user-entered full name from above, and print the added strings in the main()
using printf() method.
o Call myFooter() method with appropriate argument.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!