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
Y_Kistochka [10]
3 years ago
5

I gave 15 min to finish this java program

Engineering
1 answer:
lisov135 [29]3 years ago
4 0

Answer:

class TriangleNumbers

{

public static void main (String[] args)

{

 for (int number = 1; number <= 10; ++number) {

  int sum = 1;

  System.out.print("1");

  for (int summed = 2; summed <= number; ++summed) {

   sum += summed;

   System.out.print(" + " + Integer.toString(summed));

  }

  System.out.print(" = " + Integer.toString(sum) + '\n');

 }

}

}

Explanation:

We need to run the code for each of the 10 lines. Each time we sum  numbers from 1 to n. We start with 1, then add numbers from 2 to n (and print the operation). At the end, we always print the equals sign, the sum and a newline character.

You might be interested in
g a heat engine is located between thermal reservoirs at 400k and 1600k. the heat engine operates with an efficiency that is 70%
Bond [772]

Answer:

<em>Heat rejected to cold body = 3.81 kJ</em>

Explanation:

Temperature of hot thermal reservoir Th = 1600 K

Temperature of cold thermal reservoir Tc = 400 K

<em>efficiency of the Carnot's engine = 1 - </em>\frac{Tc}{Th}<em> </em>

eff. of the Carnot's engine = 1 - \frac{400}{600}

eff = 1 - 0.25 = 0.75

<em>efficiency of the heat engine = 70% of 0.75 = 0.525</em>

work done by heat engine = 2 kJ

<em>eff. of heat engine is gotten as = W/Q</em>

where W = work done by heat engine

Q = heat rejected by heat engine to lower temperature reservoir

from the equation, we can derive that

heat rejected Q = W/eff = 2/0.525 = <em>3.81 kJ</em>

6 0
3 years ago
Consider an open loop 1-degree-of-freedom mass-spring damper system. The system has mass 4.2 kg, and spring stiffness of 85.9 N/
Marat540 [252]

Answer:

Damping ratio  \zeta =0.0342

Explanation:

Given that

m=4.2 kg,K=85.9 N/m,C=1.3 N.s/m

We need to find damping ratio

We know that critical damping co-efficient

 C_c=2\sqrt {mk}

 C_c=2\sqrt {4.2\times 85.9}

 C_c=37.98 N.s/m

Damping ratio(\zeta) is the ratio of damping co-efficient to the critical damping co-efficient

So \zeta =\dfrac{C}{C_c}

\zeta =\dfrac{1.3}{37.98}

\zeta =0.0342

So damping ratio  \zeta =0.0342

 

3 0
4 years ago
Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output tho
Likurg_2 [28]

Answer:

See explanation

Explanation:

//Include the

//required header files.

#include <stdio.h>

//Define the

//main() function.

int main(void) {

//Declare the

//required variables.

char input_char;

int input_int;

double input_double;

char input_string[100];

//Prompt the user

//to enter an integer.

printf("Enter integer: ");

//Read and store

//the integer.

scanf("%d", &input_int);

//Prompt the user

//to enter a double value.

printf("Enter double: ");

//Read and store

//the double value.

scanf("%lf", &input_double);

//Prompt the user

//to enter a character.

printf("Enter character: ");

//Read and store

//the character.

scanf(" %c", &input_char);

//Prompt user to

//enter the string

printf("Enter string: ");

//Read and

//store the string.

scanf("%s", input_string);

//(1)

//Display the values.

printf("%d %lf %c %s\n",

input_int, input_double,

input_char, input_string);

//(2)

//Display the values

//in reverse order.

printf("%s %c %lf %d\n",

input_string, input_char,

input_double, input_int);

//(3)

//Cast the double to

//an integer and display it.

printf("%lf cast to an integer is %d",

input_double, (int)(input_double));

//Return from the

//main() function.

return 0;

}

4 0
3 years ago
A stainless steel ball (rho = 8055 kg/m3, cp = 480 J/kg·K) of diameter D = 0.21 m is removed from the oven at a uniform temperat
Nataliya [291]

Answer:

Explanation:

The complete detailed  explanation which answer the question efficiently is shown in the attached files below.

I hope it helps a lot !

5 0
3 years ago
Read 2 more answers
The blade tension is correct when you can hear a<br>O Thunk<br>O Twang<br>O Neither​
Anastaziya [24]

Answer:

maybe it's twang because of the blade tension

3 0
3 years ago
Other questions:
  • The legend that Benjamin Franklin flew a kite as a storm approached is only a legend—he was neither stupid nor suicidal. Suppose
    5·1 answer
  • During an expansion process, the pressure of a gas changes from 15 to 140 psia according to the relation P = aV + b, where a = 5
    12·1 answer
  • Bob and Alice are solving practice problems for CSE 2320. They look at this code: for(i = 1; i &lt;= N; i = (i*2)+17 ) for(k = i
    6·2 answers
  • How much heat (Btu) is prod uced by a 150-W light bulb that is on for 20-hours?
    14·1 answer
  • All sized companies are required to have a written fire prevention plan true or false
    14·2 answers
  • An eddy current separator is to separate aluminum product from an input streamshredded MSW. The feed rate to the separator is 2,
    7·1 answer
  • The part dimension for an injection-molded part made of polycarbonate is specified as 4.00 in. Compute the corresponding dimensi
    15·1 answer
  • 19/32 reduced to its lowest form
    7·2 answers
  • Grapes, sour<br> Red, elbow
    12·2 answers
  • Safety measures to be taken during technical drawing<br>​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!