Create the following Functions. Then create a Test script that calls all of the
ID: 3773911 • Letter: C
Question
Create the following Functions. Then create a Test script that calls all of the function below and tests them. The test function should display the output from you're the function below. Multiply(a, b) Divide(a, b) Add(a, b) Subtract(a, b) Create a function that askes the user for a filename and continuously askes them what they would like to put into their file. If they enter 10 lines or enter "Nothing else" stop filling the file and close it. FillAFile(filename) Create a function that takes in a filename, reads and displays the first line and the last line. Then close the file. ReadLine(filename)Explanation / Answer
subtraction();
} else if (choice == 3){
division(); } else if (choice == 4){
multiplication(); }
System.out.println();
kb.close();
}
public static void addition(){
System.out.println(" Sum: " + nOne + " + " + nTwo + " = " + (nOne + nTwo));
}
public static void subtraction(){
System.out.println(" Sum: " + nOne + " - " + nTwo + " = " + (nOne - nTwo));
}
public static void division(){
System.out.println(" Sum: " + nOne + " / " + nTwo + " = " + (nOne / nTwo));
}
public static void multiplication(){
System.out.println(" Sum: " + nOne + " x " + nTwo + " = " + (nOne * nTwo));
}
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.