<h2>Hey mate </h2><h2>Here is ur answer..! ⬇️⬇️</h2>
Explanation:
<u>The characteristics of computers that have made them so powerful and universally useful are speed, accuracy, diligence, versatility and storage capacity. Let us discuss them briefly. Computers work at an incredible speed.</u>
<em><u>Hope</u></em><em><u> </u></em><em><u>it helps</u></em><em><u> </u></em><em><u>u plzz</u></em><em><u> </u></em><em><u>mark it</u></em><em><u> </u></em><em><u>as brainalist</u></em><em><u> </u></em><em><u>and thnk</u></em><em><u> </u></em><em><u>my answers</u></em><em><u> </u></em>
Answer:
- import java.util.Arrays;
- import java.util.Scanner;
-
- public class Main {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- double distances [] = new double[7];
-
- for(int i=0; i < distances.length; i++){
- System.out.print("Input running distance for day " + (i+1) + ": ");
- distances[i] = input.nextDouble();
- }
-
- System.out.println(Arrays.toString(distances));
- }
- }
Explanation:
The solution code is written in Java.
Firstly, create a Scanner object to get user input for running distance (Line 6). Next, declare a distances array and set the array size to 7 because we intend to use this array to hold running distance for 7 days per week.
Next, use the for loop that run for 7 times to repeatedly prompt user to input running distance for each day and store each value to the array distances (Line 9 -12).
At last, display the array to console terminal (Line 14).
Answer:
12. for (i = 0 ; i < testGrades.length ; i+=1 ){
13. if (testGrades[i] > 100){
14. sumExtra = sumExtra + testGrades[i] - 100;}
15. }
Explanation:
We first iterate through the entire testGrades array. For each test score that is in testGrades ( that is testGrades[i] ), we see whether or not the test grade is above 100 (See line 12) . If test grade is greater than 100, this means we have extra credit. We simply subtract 100 from the test grade, add it with the previous value of sumExtra and store the value back in sumExtra(see line 14). Once i is greater than the length of the test grades, the loop is exited. We can now print sumExtra to obtain the result.