1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Licemer1 [7]
3 years ago
12

Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards

, then backwards. End each loop with a newline. Ex: If courseGrades = {7, 9, 11, 10}, print:7 9 11 10 10 11 9 7 Hint: Use two for loops. Second loop starts with i = NUM_VALS - 1.#include int main(void) {const int NUM_VALS = 4;int courseGrades[NUM_VALS];int i = 0;courseGrades[0] = 7;courseGrades[1] = 9;courseGrades[2] = 11;courseGrades[3] = 10;/* Your solution goes here */return 0;}
Engineering
1 answer:
user100 [1]3 years ago
4 0

Answer:

The first step is to;

a. import Scanner class present in java.util package for take input in arrays.

b. When final variable is initialized it can not be changed so fix the size to 4.

c. create array to hold 4 integer elements in array.

d. Now ensure users enter integer values separated by space in single line & assign elements at each index of array starting from index 0.

e. Next is to print the array elements in forward directions first.

reset i to 0 to print all elements of array from index 0.

f. Then ensure to traverse array and display each element one by one separated by space in same line using for loop.

g. Therefore to move to next line .

reset i to array.length -1. loop will go from last elements index till index 0.

h. Finally print elements in array backwards from last elements of array.

The second step is given here,

import java.util.Scanner;

public class CourseGradePrinter {

public static void main(String args) {

//using scanner to take input from user..

Scanner scnr = new Scanner(System.in);

//fix the array size to 4.

final int NUM_VALS = 4;

//array created of size 4 to hold int data

int[] courseGrades = new int[NUM_VALS];

//declare i for user input and traversing array

int i;

for (i = 0; i < courseGrades.length; ++i) {

//user enters integer values

courseGrades[i] = scnr.nextInt();

}

/* Your solution goes here */

//display the array elements forwards now

i=0;

Ensure to print elements in array.

You might be interested in
Which of the following conditions were present in over 80% of paddling fatalities from 1995-2000?
Minchanka [31]

Answer:

80% of the people that were killed weren't wearing a safety flotation device ( in correct terminology Personal Flotation Device, or PFD )

Explanation:

Hence they drowned due to the lack of safety.

3 0
3 years ago
A cylindrical drill with radius 4 is used to bore a hole through the center of a sphere of radius 5. Find the volume of the ring
ANTONII [103]

Answer:

The volume of the ring shaped solid that remains is 21 unit^3.

Explanation:

The total volume of the sphere is given as:

Volume of Sphere = (4/3)πr^3

where, r = radius of sphere

Volume of Sphere = (4/3)(π)(5)^3

Volume of Sphere = 523.6 unit^3

Now, we find the volume of sphere removed by the drill:

Volume removed = (Cross-sectional Area of drill)(Diameter of Sphere)

Volume removed = (πr²)(D)

where, r = radius of drill = 4

D = diameter of sphere = 2*5 = 10

Therefore,

Volume removed = (π)(4)²(10)

Volume removed = 502.6 unit^3

Therefore, the volume of ring shaped solid that remains will be the difference between the total volume of sphere, and the volume removed.

Volume of Ring = Volume of Sphere - Volume removed

Volume of Ring = 523.6 - 502.6

<u>Volume of Ring = 21 unit^3</u>

5 0
3 years ago
Gtjffs
grandymaker [24]

the required documents is 3000

4 0
3 years ago
is released from under a vertical gate into a 2-mwide lined rectangular channel. The gate opening is 50 cm, and the flow rate in
SVEN [57.7K]

Answer:

hello your question is incomplete attached below is the complete question

answer: There is a hydraulic jump

Explanation:

First we have to calculate the depth of flow downstream of the gate

y1 = C_{c} y_{g} ----------- ( 1 )

Cc ( concentration coefficient ) = 0.61  ( assumed )

Yg ( depth of gate opening ) = 0.5

hence equation 1 becomes

y1 = 0.61 * 0.5 = 0.305 m

calculate the flow per unit width q

q = Q / b ----------- ( 2 )

Q = 10 m^3 /s

 b = 2 m

hence equation 2 becomes

q = 10 / 2 = 5 m^2/s

next calculate the depth before hydraulic jump y2 by using the hydraulic equation

answer : where  y1 < y2 hence a hydraulic jump occurs in the lined channel

attached below is the remaining part of the solution

4 0
3 years ago
4. A banking system provides users with several services:
VLD [36.1K]

A diagram showing a use case diagrams for these requirements is given in the image attached.

<h3>What is system Case diagram?</h3>

A use case diagram is known to be a kind of graphical illustration of a users in terms of their various possible association or interactions within any given system.

A use case diagram in banking can be used to prepare, depict and also to know all the functional requirements of the banking system.

Therefore, Give the use case specification for the banking system services and paying a bill online is given in the image attached.

Learn  more about Case diagram from

brainly.com/question/12975184

#SPJ1

4 0
2 years ago
Other questions:
  • Mike is involved in developing the model building codes that various states and local authorities in the United States adopt. He
    6·1 answer
  • Please what is the name of this tool​
    9·2 answers
  • An automobile engine consumes fuel at a rate of 22 L/h and delivers 85 kW of power to the wheels. If the fuel has a heating valu
    8·2 answers
  • Which of the following are made up of electrical probes and connectors?
    8·1 answer
  • 7. The binary addition 1 + 1 + 1 gives ​
    12·2 answers
  • Water at 70 kPa and 1008C is compressed isentropically in a closed system to 4 MPa. Determine the final temperature of the water
    6·1 answer
  • For some transformation having kinetics that obey the Avrami equation, the parameter n is known to have a value of 2. If, after
    14·1 answer
  • Why might many general contractors begin their careers as construction workers?
    9·1 answer
  • A new approval process is being adapted by Ursa Major Solar. After an opportunity has been approved, the contract is sent to the
    9·1 answer
  • Technician A says the compressor is the dividing line of the refrigeration system, low- to high-side. Technician B says the expa
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!