subject

Within the the Assignment05.java file, you must define the following static methods. In the main method, you may program any code that wish to test the methods you have been asked to define. 1) Write (define) a static method named displayGreeting, that takes no arguments and returns no value. When this function is called, it should print the text "Hello, and welcome!".
Example:
displayGreeting() will print Hello, and welcome!
2) Write (define) a static method named displayText, that takes a single String argument and returns no value. When this function is called, it should print the value of the argument that was passed to it.
Examples:
displayText("Hello") will print Hello
displayText("123") will print 123
displayText("abc" + "123") will print abc123
3) Write (define) a static method named printTotal, that takes three int arguments. When this function is called, it should print the sum of the three arguments passed to it. This function should return no value.
Examples:
printTotal(0, 0, 0) will print 0
printTotal(0, 1, 3) will print 4
printTotal(100, 23, 2) will print 125
4) Write (define) a static method named getTotal, that takes three int arguments. When this function is called, it should return the sum of the three arguments passed to it as an int.
Examples:
getTotal(0, 0, 0) will return 0
getTotal(0, 1, 3) will return 4
getTotal(100, 23, 2) will return 125
5) Write (define) a static method named getAverage, that takes three int arguments. When this function is called, it should return the average of the three arguments passed to it as a double.
Examples:
getAverage(0, 0, 0) will return 0.0
getAverage(0, 1, 3) will return 1.33333...
getAverage(100, 13, 7) will return 40.0
6) Write (define) a static method named averageLength, that takes three String arguments. When this function is called, it should return the average length (number of characters) of the String arguments passed to it as a double.
Examples:
averageLength("a", "abc", "ab") will return 2.0
averageLength("hello", "goodbye", "monday") will return 6.0
averageLength("wednesday", "tuesday", "monday") will return 7.33
7) Write (define) a static method named lengthOfShortest, that takes two String arguments. When this function is called, it should return the length (number of characters) of the shortest String argument passed to it as an int.
Examples:
lengthOfShortest("abc", "ab") will return 2
lengthOfShortest("hello", "goodbye") will return 5
lengthOfShortest("thursday", "friday") will return 6
8) Write (define) a static method named stringOfStars, that takes one String argument. When this function is called, it should return a String of asterisks (*) that is the same length as the string argument passed to it.
Examples:
stringOfStars("abc") will return "***"
stringOfStars("Hello, world!") will return ""
stringOfStars("0123456789") will return ""
9) Write (define) a static method named maxStringOfStars, that takes two String arguments. When this function is called, it should return a String of asterisks (*) that is the same length as the longest string argument passed to it.
Examples:
maxStringOfStars("a", "abc") will return "***"
maxStringOfStars("hello", "goodbye") will return ""
maxStringOfStars("thursday", "friday") will return ""
10) Write (define) a static method named midStringOfStars, that takes three String arguments. When this function is called, it should return a String of asterisks (*) that is the same length as the string argument with the length that would be in the middle if the lengths of the arguments were arranged in ascending order.
Examples:
midStringOfStars("a", "abc", "ab") will return "**"
midStringOfStars("hello", "goodbye", "yes") will return ""
midStringOfStars("123456", "12", "1234") will return ""

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:30
1. before plugging in a new device to a computer you should unplug all other devices turn off the computer turn on the computer 2. many of the maintenance tools for a computer can be found in the control panel under administrative tools display personalization
Answers: 1
question
Computers and Technology, 22.06.2019 23:50
List a few alternative options and input and output over the standerd keyboard and monitor. explain their functioning in details.
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
If you're using an existing powerpoint presentation that will receive new slides based on a word outline, select the a. slide that will appear after the new slides. b. first slide in the presentation. c. slide that will appear before the new slides. d. last slide in the presentation.
Answers: 2
question
Computers and Technology, 23.06.2019 16:30
Monica and her team have implemented is successfully in an organization. what factor leads to successful is implementation? good between different departments in an organization leads to successful is implementation.
Answers: 1
You know the right answer?
Within the the Assignment05.java file, you must define the following static methods. In the main met...
Questions
question
History, 06.05.2021 16:30
question
Mathematics, 06.05.2021 16:30
question
History, 06.05.2021 16:30
question
Social Studies, 06.05.2021 16:30
question
Mathematics, 06.05.2021 16:30
question
Mathematics, 06.05.2021 16:30
question
Mathematics, 06.05.2021 16:30
question
English, 06.05.2021 16:30
Questions on the website: 13722367