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
/ Air enters a 20-cm-diameter 12-m-long underwater duct at 50°C and 1 atm at a
Digiron [165]

Answer:

A) EXIT TEMPERATURE = 14⁰C

b) rate of heat transfer of air = - 13475.78 = - 13.5 kw

Explanation:

Given data :

diameter of duct = 20-cm = 0.2 m

length of duct = 12-m

temperature of air at inlet= 50⁰c

pressure = 1 atm

mean velocity = 7 m/s

average heat transfer coefficient = 85 w/m^2⁰c

water temperature = 5⁰c

surface temperature ( Ts) = 5⁰c

properties of air at 50⁰c and at 1 atm

= 1.092 kg/m^3

Cp = 1007 j/kg⁰c

k = 0.02735 W/m⁰c

Pr = 0.7228

v  = 1.798 * 10^-5 m^2/s

determine the exit temperature of air and the rate of heat transfer

attached below is the detailed solution

Calculate the mass flow rate

= p*Ac*Vmean

= 1.092 * 0.0314 *  7 = 0.24 kg/s

4 0
3 years ago
1. Asbestos can be dangerous but is not a known carcinogen.<br> A) O True<br> B) O False
Leya [2.2K]
I believe it’s A. True
4 0
3 years ago
I need help with the question
Nataliya [291]

Answer:

in my opinion, it's TRUE statement .

Explanation:

plz mark me brainliest

8 0
3 years ago
Air exits a compressor operating at steady-state, steady-flow conditions at 150 oC, 825 kPa, with a velocity of 10 m/s through a
ioda

Answer:

a) Qe = 0.01963 m^3 / s , mass flow rate m^ = 0.1334 kg/s

b) Inlet cross sectional area = Ai = 0.11217 m^2 , Qi = 0.11217 m^3 / s    

Explanation:

Given:-

- The compressor exit conditions are given as follows:

                  Pressure ( Pe ) = 825 KPa

                  Temperature ( Te ) = 150°C

                  Velocity ( Ve ) = 10 m/s

                  Diameter ( de ) = 5.0 cm

Solution:-

- Define inlet parameters:

                  Pressure = Pi = 100 KPa

                  Temperature = Ti = 20.0

                  Velocity = Vi = 1.0 m/s

                  Area = Ai

- From definition the volumetric flow rate at outlet ( Qe ) is determined by the following equation:

                   Qe = Ae*Ve

Where,

           Ae: The exit cross sectional area

                   Ae = π*de^2 / 4

Therefore,

                  Qe = Ve*π*de^2 / 4

                  Qe = 10*π*0.05^2 / 4

                  Qe = 0.01963 m^3 / s

 

- To determine the mass flow rate ( m^ ) through the compressor we need to determine the density of air at exit using exit conditions.

- We will assume air to be an ideal gas. Thus using the ideal gas state equation we have:

                   Pe / ρe = R*Te  

Where,

           Te: The absolute temperature at exit

           ρe: The density of air at exit

           R: the specific gas constant for air = 0.287 KJ /kg.K

             

                ρe = Pe / (R*Te)

                ρe = 825 / (0.287*( 273 + 150 ) )

                ρe = 6.79566 kg/m^3

- The mass flow rate ( m^ ) is given:

               m^ = ρe*Qe

                     = ( 6.79566 )*( 0.01963 )

                     = 0.1334 kg/s

- We will use the "continuity equation " for steady state flow inside the compressor i.e mass flow rate remains constant:

              m^ = ρe*Ae*Ve = ρi*Ai*Vi

- Density of air at inlet using inlet conditions. Again, using the ideal gas state equation:

               Pi / ρi = R*Ti  

Where,

           Ti: The absolute temperature at inlet

           ρi: The density of air at inlet

           R: the specific gas constant for air = 0.287 KJ /kg.K

             

                ρi = Pi / (R*Ti)

                ρi = 100 / (0.287*( 273 + 20 ) )

                ρi = 1.18918 kg/m^3

Using continuity expression:

               Ai = m^ / ρi*Vi

               Ai = 0.1334 / 1.18918*1

               Ai = 0.11217 m^2          

- From definition the volumetric flow rate at inlet ( Qi ) is determined by the following equation:

                   Qi = Ai*Vi

Where,

           Ai: The inlet cross sectional area

                  Qi = 0.11217*1

                  Qi = 0.11217 m^3 / s    

- The equations that will help us with required plots are:

Inlet cross section area ( Ai )

                Ai = m^ / ρi*Vi  

                Ai = 0.1334 / 1.18918*Vi

                Ai ( V ) = 0.11217 / Vi   .... Eq 1

Inlet flow rate ( Qi ):

                Qi = 0.11217 m^3 / s ... constant  Eq 2

               

6 0
3 years ago
When preparing a foundation for a heavy duty machine tool, discuss any four (4) statics machine characteristics to be considered
kozerog [31]

Answer:

1 ) Accuracy of the Machine Tool

2) Load bearing capacity

3) Linearity in the product line

4) Torque of the machine

Explanation:

we know that machine tool is the permanent essential in manufacturing industries

it is a machine use for different form like cutting , grinding and boring etc

so 1st is

1 ) Accuracy of the Machine Tool

we know it is very important Characteristic of the machine tool because when we use it in manufacturing unit Accuracy of the Machine Tool should be higher concern

2) Load bearing capacity

we should very careful about Load bearing capacity because how much amount of load tool will bear check by some parameter like creep , shear stress and strength etc

3) Linearity in the product line

Linearity in the product line mean that it should be group of related product produced by the any one of the manufacturer otherwise it will take time or it may be intermixing

4) Torque of the machine

we know that Torque is a rotational force or a turning force so amount of force multiplied by the distance of the operation

and we know torque per second give the power rating of machine tool

5 0
4 years ago
Other questions:
  • The 150-lb man sits in the center of the boat, which has a uniform width and a weight per linear foot of 3 lb&gt;ft. Determine t
    9·1 answer
  • The coupling is used to connect the two shafts together. Assuming that the shear stress in the bolts is uniform, determine the n
    13·1 answer
  • A three-phase, 318.75kVA, 2300-Volt, alternator has an armature resistance of 0.35/phase and a synchronous reactance of 1.2/phas
    10·1 answer
  • What is the function of the work clamp during shielded metal arc welding?
    7·1 answer
  • Please help me with this. Picture
    10·1 answer
  • Why is sssniperwolf so fine
    9·2 answers
  • A transformer is to be used to provide power for a computer disk drive that needs 6.4 V (rms) instead of the 120 V (rms) from th
    10·1 answer
  • How do I replace the aromatic filter?
    6·2 answers
  • May you tell me the meaning of "Tolerance is a bitter tree, but its fruit is sweet "by Aristotle
    6·1 answer
  • 3 mA are flowing through an 18 V circuit, how much resistance (in kΩ) is in that circuit?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!