
Concept explainers
Create a java program using user defined function.
Create a function/method void:
-showinfo with parameter student number, first name, last name, middle initial, and age.
Create a function/method return:
-getSchoolName() that return the school name Far Eastern University
-subtractit with parameter num1 and num2 that return the subraction result of 120-20
-divideit with parameter num1 and num2 that return the division result of 50/2
No scanner method will be used, all outputs are defined and called using "user-defined" fuctions.
Parameter specification:
variable names
student number = A1
first name = FN
last name = LN
middle initial = MI
age = A2
num1 = num1
num2 = num2
Sample Output:
Student Number: 1
First Name: Anna
Last Name: Perez
Middle Initial: A.
Age: 15
Full Name: Anna A. Perez (Concatenation of first name, middle initial and last name)
-----------------------------
Student Number: 2
First Name: Troy
Last Name: S.
Middle Initial: Medina
Age: 16
Full Name: Troy S. Medina
-----------------------------
Student Number: 3
First Name: Franz
Last Name: P.
Middle Initial: Lacson
Age: 16
Full Name: Franz P. Lacson
-----------------------------
School Name: Far Eastern University
Subtraction Result: 100.0
Division Result: 25.0

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

- Complete the uncompleted java program. The sample run is attached below.arrow_forwardDon't give me AI generated answer or plagiarised answer. If I see these things I'll give you multiple downvotes and will report immediately.arrow_forwardWrite in Java a procedure or function that will have four different effects, depending on whether arguments are passed by value, by reference, by value/result, or by name.arrow_forward
- In the following code: def foo(value): value = value + 1 def main(): x = 10 foo(x) Ox is a formal parameter and value is an actual parameter. O Both value and x are actual parameters. value is a formal parameter and x is an actual parameter. O There are no parameters.arrow_forwardJava - Data Visualization (this is not graded)arrow_forwardWrite a python code for both 1 and 2 use random inputs for each variablearrow_forward
- Python**arrow_forwardPython Programming: Write a program using unittest.TestCase methods to confirm that the addition and subtraction of date and timedelta objects produce correct results. Important notes: Use the unittest module to create a TestCase to test that the addition and subtraction of date and timedelta objects produce correct results... For example I could create a TestCase with a function that tests the addition of date and timedelta objects; a function that tests the subtraction of date and timedelta and then call unittest's main method at the end. When you run this program, it should tell us whether the text was successful or not. See attached image for what the output should look like.arrow_forwardUsing import sys : Create a python program called classname.py. The program should define a classcalled person that has one method called hello, and one attribute called name,which represents the name of the person.arrow_forward
- light } What is the output of this Java program? } class Driver { public static void main(String[] args) { int a = 6: int b = 6; int c = 5; int x = 1; if (a > 2) { } } if x = x + 600; (b> 3) { x = x + 60; } if (c < 9) { X = x + 5; System.out.print(x);arrow_forwardpublic static class Lab2{public static void Main(){int idNum;double payRate, hours, grossPay;string firstName, lastName;// prompt the user to enter employee's first nameConsole.Write("Enter employee's first name => ");firstName = Console.ReadLine();// prompt the user to enter employee's last nameConsole.Write("Enter employee's last name => ");lastName = Console.ReadLine()// prompt the user to enter a six digit employee numberConsole.Write("Enter a six digit employee's ID => ");idNum = Convert.ToInt32(Console.ReadLine());// prompt the user to enter the number of hours employeeworkedConsole.Write("Enter the number of hours employee worked =>");// prompt the user to enter the employee's hourly pay rateconsole.Write("Enter employee's hourly pay rate: ");payRate = Convert.ToDouble(Console.ReadLine());// calculate gross paygrossPay = hours * payRate;// output resultsConsole.WriteLine("Employee {0} {1}, (ID: {2}) earned {3}",firstName, lastName, idNum,…arrow_forwardComputational Methodsarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





