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
Your driver license will be _____ if you race another driver on a public road, commit a felony using a motor vehicle, or are fou
ser-zykov [4K]

Answer:

Revoked

Explanation:

Your driver license will be revoked if you race another driver on a public road, commit a felony using a motor vehicle, or are found guilty of reckless driving three times in one year.

4 0
2 years ago
Air flows at 45m/s through a right angle pipe bend with a constant diameter of 2cm. What is the overall force required to keep t
HACTEHA [7]

Answer:

b)1.08 N

Explanation:

Given that

velocity of air V= 45 m/s

Diameter of pipe = 2 cm

Force exerted by fluid  F

F=\rho AV^2

So force exerted in x-direction

F_x=\rho AV^2

F_x=1.2\times \dfrac{\pi}{4}\times 0.02^2\times 45^2

F=0.763 N

So force exerted in y-direction

F_y=\rho AV^2

F_y=1.2\times \dfrac{\pi}{4}\times 0.02^2\times 45^2

F=0.763 N

So the resultant force R

R=\sqrt{F_x^2+F_y^2}

R=\sqrt{0.763^2+0.763^2}

R=1.079

So the force required to hold the pipe is 1.08 N.

3 0
3 years ago
MATLAB can solve a variety of engineering problems including those requiring simulating differential equations and iterative num
frez [133]

Answer:

A. True

Explanation:

MATLAB may be defined as a programming platform that is designed specifically for the engineers as well as the scientists to carry out different analysis and researches.

MATLAB makes use of a desktop environment which is tuned for certain iterative analysis and the design processes with a programming language which expresses matrix as well as array mathematics directly.

Thus the answer is true.

3 0
3 years ago
A thin-film gold conductor for an integrated circuit in a satellite application is deposited from a vapor, and the deposited gol
ahrayia [7]

Answer:

Explanation:

Considering the relation of the equilibrium vacancy concentration ;

nv/N = exp (-ΔHv/KT)

Where T is the temperature at which the vacancy sites are formed

K = Boltzmaan constant

ΔHv = enthalpy of vacancy formation

Rearranging the equation and expressing in term of the temperature and plugging the values given to get the temperature. The detailed steps is as shown in the attached file

5 0
3 years ago
Why dont some vehicles have power steering
daser333 [38]

Answer:

Because older cars didn't really have much power steering, and parking or even turning at low speeds could require a lot of strength to move the steering wheel on a big, heavy car. This moves the rack to the right or left, which turns the vehicle's wheels. Without power assist, you'd need grunt force to turn the pinion and move the rack.

Explanation:

4 0
4 years ago
Other questions:
  • How is an electric generator like an electric motor in reverse?
    13·1 answer
  • find magnitude of the resultant force, if 30N,40N,50N and 60N forces are acting along the line joining the centr of a square to
    6·1 answer
  • Kim is assigned to write an important company report with Philip and Tara, her coworkers. Because Kim prefers to work alone, she
    13·1 answer
  • A particle of given mass m 1kg, and charge q1 Couloumb, is placed in a magnetic field B 1k Tesla and thus is subjected to the ef
    11·1 answer
  • An exclusive 20-year right to manufacture a product or use a process is a: Franchise. Trademark. Patent. Copyright.
    6·1 answer
  • 49. A solenoid coil with a resistance of 30 ohms and an inductance of 200 milli-henrys, is connected to a 230VAC, 50Hz supply. D
    8·1 answer
  • The cars of a roller-coaster ride have a speed of 19.0 km/h as they pass over the top of the circular track. Neglect any frictio
    10·1 answer
  • A square plate of titanium is 12cm along the top, 12cm on the right side, and 5mm thick. A normal tensile force of 15kN is appli
    10·1 answer
  • Ahmed records the number of questions he has answered on DFM per day over 14 days, and puts the data in the table below.
    11·2 answers
  • A traffic flow has density 61 veh/km when the speed is 59 veh/hr. If a flow has a jam density of 122 veh/km, what is the maximum
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!