Answer:
The program to this question can be given as:
Program:
public class Main //define class.
{
public static void main(String[] as) //define main method.
{
int n=5; //define variable n and assign positive value.
int i,j; //define variable
for (i = 7; i>=1; i--) //outer loop.
{
for (j = 0; j< i; j++) //inner loop.
{
System.out.print("*"); //print asterisks.
}
System.out.println(); //line break.
}
}
}
Output:
*****
****
***
**
*
Explanation:
The description of the above code can be given as:
- In the above java programming code firstly we define a class that is "Main". In this class we define a main method in the main method we define a variables that is "n" in this variable we assign a positive value. The we define another integer variable that is i,j this variable is used in the loop.
- Then we define a loop. for prints asterisks values in reverse triangle, we nested looping concept. In nested looping, we use in loop in this loop we use the i and j variables that print the asterisks value.
Answer
the micmethod <-----made by myself
Explanation:
1. alphabetical order
2.put in empty folder
3.name folder after file put file in hard drive
4.a hard drive is also a usb
5.make hard drive into necklace and wear all the time
6. now u never lose it
Answer:
The code solution is written in Java.
- import java.util.Scanner;
-
- public class TestScore {
-
- public static void main(String[] args) {
-
- Scanner input = new Scanner(System.in);
-
- System.out.print("Please enter first score: ");
- double firstScore = input.nextDouble();
- System.out.println("Grade: " + determineGrade(firstScore));
-
- System.out.print("Please enter second score: ");
- double secondScore = input.nextDouble();
- System.out.println("Grade: " + determineGrade(secondScore));
-
- System.out.print("Please enter third score: ");
- double thirdScore = input.nextDouble();
- System.out.println("Grade: " + determineGrade(thirdScore));
-
- System.out.print("Please enter fourth score: ");
- double fourthScore = input.nextDouble();
- System.out.println("Grade: " + determineGrade(fourthScore));
-
- System.out.print("Please enter fifth score: ");
- double fifthScore = input.nextDouble();
- System.out.println("Grade: " + determineGrade(fifthScore));
-
- System.out.println("Average score: " + calcAverage(firstScore, secondScore, thirdScore, fourthScore, fifthScore));
-
- }
-
- public static double calcAverage(double score1, double score2, double score3, double score4, double score5){
- double average = (score1 + score2 + score3 + score4 + score5) / 5;
- return average;
- }
-
- public static String determineGrade(double score){
- if(score >= 90){
- return "A";
- }
- else if(score >= 80 ){
- return "B";
- }
- else if(score >=70){
- return "C";
- }
- else if(score >=60){
- return "D";
- }
- else{
- return "F";
- }
- }
- }
Explanation:
Firstly, create the method, <em>calcAverage()</em>, that takes five test scores. Within the method, calculate the average and return it as output. (Line 33 - 36)
Next, create another method, <em>determineGrade()</em>, which takes only one score and return the grade based on the range of the score. (Line 38 -54)
Once the two required methods are created, we are ready to prompt use for input five test scores using Java Scanner class. To use get user input, create a Scanner object (Line 7). Next, use getDouble() method to get an input score and assign it to variables firstScore, secondScore, thirdScore, fourthScore & fifthScore, respectively. Once a score input by user, call determineGrade() method by passing the input score as argument and immediately print out the return grade. (Line 9 - 27)
At last, call calcAverage() method by passing the first test score variables as argument and print out the returned average value. (Line 29).
jim can use bullet points.
- this
- is
- an
- example
- of
- bullet
- points!
! actually it means not, which reverses a boolean.