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, 21.06.2019 18:30
Which statement best explains how plant cells use photosynthesis to maintain homeostasis? they use glucose and water to make energy. they break down glucose into fat. they combine oxygen and water to make glucose. they make glucose from carbon dioxide and water.
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
Michael has written an e-mail to his employees that describes a new product special that will be introduced to the customers next week. by taking time to make sure the e-mail is well written, logical, and organized, michael has made sure his message has the characteristics of a) effective communicationb) ineffective communicationc) barriers to communicationd) workplace communication
Answers: 2
question
Computers and Technology, 24.06.2019 09:30
What is the definition of digital literacy?
Answers: 1
question
Computers and Technology, 24.06.2019 17:00
Following are uses of spreadsheets. for each use, choose whether the use is a business use, consumer use, or student use. family budget: sales data: recording research data for science class:
Answers: 2
You know the right answer?
Within the the Assignment05.java file, you must define the following static methods. In the main met...
Questions
question
Mathematics, 28.01.2021 08:40
question
English, 28.01.2021 08:40
question
Mathematics, 28.01.2021 08:40
question
Mathematics, 28.01.2021 08:40