Answer:
ok done we will try
BTW have a nice day enjoy your day Stay blessed stay happy stay strong
Answer:
import java.util.Scanner;
public class num6{
static int getTestScores(){
System.out.println("Enter the Score");
Scanner in = new Scanner(System.in);
int score = in.nextInt();
return score;
}
static double calcAverage(int score1, int score2, int score3){
return (score1+score2+score3)/3;
}
static void displayAverage(double ave){
System.out.println("The Average is "+ave);
}
public static void main(String[] args) {
int num1 = getTestScores();
int num2 = getTestScores();
int num3 = getTestScores();
//Calling Calculate Average
double average = calcAverage(num1,num2,num3);
//Calling displayAverage
displayAverage(average);
}
}
Explanation:
- Using Java programming Language
- Create the four methods
- getTestScores() Uses the Scanner Class to receive an in variable and return it
- calcAverage() accepts three ints as parameter calculates their average and return it
- displayAverage() Accepts a double and prints it out with a concatenated string as message
- In the Main Method, getTestScores is called three times to obtain three numbers from the user
- calAverage is called and handed the three numbers
- printAverage is called to output the calculated average
Answer:
The answer to the following question is the option "B".
Explanation:
In computer science, the term Reliability is an attribute for any computer-related element like software or hardware. It consistently acts according to its terms. It has a lengthy process for considering one of three similar properties that must be analyzed when using a computer component. So the answer to this question is option B which is "0.684".
Answer:
The method written in Java is as follows:
public static String reverseString(String str){
String result = "";
int lentt = str.length();
char[] strArray = str.toCharArray();
for (int i = lentt - 1; i >= 0; i--)
result+=strArray[i];
return result;
}
Explanation:
This defines the method
public static String reverseString(String str){
This initializes the result of the reversed string to an empty string
String result = "";
This calculates the length of the string
int lentt = str.length();
This converts the string to a char array
char[] strArray = str.toCharArray();
This iterates through the char array
for (int i = lentt - 1; i >= 0; i--)
This gets the reversed string
result+=strArray[i];
This returns the reversed string
return result;
}
<em>See attachment for full program that includes the main method</em>