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
Advocard [28]
3 years ago
9

This question is in C programming.Write a loop that sets newScores to oldScores shifted once left, with element 0 copied to the

end. Ex: If oldScores = {10, 20, 30, 40}, then newScores = {20, 30, 40, 10}.Here is the code#include int main(void) {const int SCORES_SIZE = 4;int lowerScores[SCORES_SIZE];int i;for (i = 0; i < SCORES_SIZE; ++i) {scanf("%d", &(lowerScores[i]));}/* Your solution goes here */for (i = 0; i < SCORES_SIZE; ++i) {printf("%d ", lowerScores[i]);}printf("\n");return 0;}
Engineering
1 answer:
andriy [413]3 years ago
7 0

Answer:

Replace

/* Your solution goes here */

with the following;

for (i = 0; i < SCORES_SIZE - 1; i++) {

newScores[i] = oldScores[i + 1];

}

newScores[SCORES_SIZE - 1] = oldScores[0];

The full program becomes

#include

int main(void) {

const int SCORES_SIZE = 4;

int lowerScores[SCORES_SIZE];

int i;

for (i = 0; i < SCORES_SIZE; ++i) {

scanf("%d", &(lowerScores[i]));

}

for (i = 0; i < SCORES_SIZE - 1; i++) {

newScores[i] = oldScores[i + 1];

}

newScores[SCORES_SIZE - 1] = oldScores[0];

for (i = 0; i < SCORES_SIZE; ++i) {

printf("%d ", lowerScores[i]);

}

printf("\n");return 0;

}

What the included code segment does it that;

for (i = 0; i < SCORES_SIZE - 1; i++) {

newScores[i] = oldScores[i + 1];

}

The above assigns the values of array oldScores to newScores starting with the second element of array oldScores till the last.

newScores[SCORES_SIZE - 1] = oldScores[0];

The above line then assigns the first element of oldScores to the first element of newScores array

You might be interested in
In a photonic material, signal transmission occurs by which of the following? a)- Electrons b)- Photons
fredd [130]

B. Photons.

In a photonic material, signal transmission occurs by photons which are light particles.

8 0
3 years ago
What is the objective of phasing out an INDUCTION MOTOR before putting the machine into commission?
enyata [817]

The main objective of phasing out an INDUCTION MOTOR is to identify the ends of the stator coils.

<h3>What is an induction motor?</h3>

An induction motor is a device based on alternate electricity (AC) which is composed of three different stator coils.

An induction motor is a device also known as an asynchronous motor due to its irregular velocity.

In conclusion, the objective of phasing out an INDUCTION MOTOR is to identify the ends of the stator coils.

Learn more on induction motors here:

brainly.com/question/15721280

#SPJ1

8 0
2 years ago
-Mn has a cubic structure with a0 = 0.8931 nm and a density of 7.47 g/cm3. -Mn has a different cubic structure, with a0 = 0.63
Fudgin [204]

Answer:

The percentage volume change is -3.0%

Explanation: We are to determine the percentage change that will occurs is alpha-Mn is transformed to beta-Mn

Value are defined as;

Cubic structure (a0) for alpha-Mn = 0.8931nm = 0.8931e-9m = 7.1236e-28cm3

Cubic structure (a0) for beta-Mn = 0.6326nm = 0.6326e-9m = 2.5316e-28cm3

Density of alpha-Mn = 7.47g/cm3

Density of beta-Mn = 7.26g/cm3

Atomic weight of Mn = 54.938g/mol

Atomic radius of Mn = 0.112nm

STEP1: CALCULATE THE ATOM NUMBER PER CELL IN THE ALPHA-Mn;

Atom per cell = (density × cubic structure × Avogadro's constant) ÷ (atomic weight ) × 100000

(7.47× 7.1236e-28 × 6.02e23) ÷ 54.938 = 58.31

Therefore the number of Atom in alpha-Mn is 58.31 atom per cell

STEP2: CALCULATE THE NUMBER OF ATOM PER CELL IN THE BETA-Mn

Atom per cell = (density × cubic structure × Avogadro's constant) ÷ (atomic weight) × 1000000

(7.26 × 2.5316e-28 × 6.02e23) ÷ 54.938 = 20.14

Therefore the number of Atom in beta-Mn is 20.14 atom per cell

STEP3: CALCULATE THE PERCENTAGE VOLUME OF ALPHA-Mn AND BETA-Mn

V% = [(volume of atom × number of atom per cell) ÷ volume of unit cell] × 1000

For Alpha-Mn:

[(1.4049e-30 × 58.31) ÷ 7.1236e-28] × 1000 = 114.998%

For Beta-Mn:

[(1.4049e-30 × 20.14) ÷ 2.5316e-28] × 1000 = 111.766%

STEP4: CALCULATE THE CHANGE IN PERCENTAGE VOLUME FOR ALPHA TO TRANSFORM TO BETA

change = final state - initial state

Therefore;

Change = 111.766 - 114.998 = -3.23%

Therefore for a transformation of Alpha-Mn to Beta-Mn they will be a decrease in volume

3 0
3 years ago
An engineer lives in Hawaii at a location where the annual rain fall is 300 inches. She decides to use the rain to generate elec
Alex777 [14]

Answer:

80.7lbft/hr

Explanation:

Flow rate of water in the system = 3.6x10^-6

The height h = 100

1s = 1/3600h

This implies that

Q = 3.6x10^-6/[1/3600]

Q = 0.0000036/0.000278

Q = 0.01295

Then the power is given as

P = rQh

The specific weight of water = 62.3 lb/ft³

P = 62.3 x 0.01295 x 100

P = 80.675lbft/h

When approximated

P = 80.7 lbft/h

This is the average power that could be generated in a year.

This answers the question and also corresponds with the answer in the question.

4 0
3 years ago
A coral reef is in danger of being destroyed by a seaside construction project. Which of the following best relates to how an en
Wewaii [24]

Answer:Bio team

Explanation:

4 0
3 years ago
Other questions:
  • Tech A says that a gear set that has a drive gear with 9 teeth and a driven gear with 27 teeth has a gear ratio of 3:1. Tech B s
    7·1 answer
  • A mass of 8000 kg of slightly enriched uranium (2% U-235, 98% U-238) is exposed for 30 days in a reactor operating at (6.18) hea
    5·1 answer
  • what is the expected life 1 inch diameter bar machined from AISI 1020 CD Steel is subjected to alternating bending stress betwee
    9·1 answer
  • An Otto cycle with air as the working fluid has a compression ratio of 8.2. Under cold air standard conditions, what is the ther
    14·1 answer
  • Yall pls help me out
    7·1 answer
  • In the situation shown below, what would the Moon look like from Earth? Sun, Earth and Moon Four Moon Views A. View A B. View B
    8·1 answer
  • Importance of tillage​
    7·1 answer
  • The ruler game, HELPPPP PLS
    11·2 answers
  • In what ways did electrical switches have to change to progress from the
    13·1 answer
  • As you push a toggle bolt into a wall, the
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!