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
Olenka [21]
3 years ago
10

Fill in the empty function so that it returns the sum of all the divisors of a number, without including it. A divisor is a numb

er that divides into another without a remainder.
Engineering
1 answer:
tekilochka [14]3 years ago
6 0

Answer:

// Program is written in C++

// Comments are used to explain some lines

// Only the required function is written. The main method is excluded.

#include<bits/stdc++.h>

#include<iostream>

using namespace std;

int divSum(int num)

{

// The next line declares the final result of summation of divisors. The variable declared is also

//initialised to 0

int result = 0;

// find all numbers which divide 'num'

for (int i=2; i<=(num/2); i++)

{

// if 'i' is divisor of 'num'

if (num%i==0)

{

if (i==(num/i))

result += i; //add divisor to result

else

result += (i + num/i); //add divisor to result

}

}

cout<<result+1;

}

You might be interested in
A horizontal, opaque surface at a steady-state temperature of 80°C is exposed to an airflow having a free stream temperature of
lesya692 [45]

Answer:

Check the explanation

Explanation:

Kindly check the attached images below to see the step by step explanation to the question above.

7 0
3 years ago
You guys are amazing :D
Sloan [31]
Ik i am thank you tho xoxo
3 0
3 years ago
Read 2 more answers
For this question you must write a java class called Rectangle and a client class called RectangleClient. The partial Rectangle
Alex Ar [27]

Answer:

Java program is given below. You can get .class after you execute java programs, You can attach those files along with .java classes given , Those .class files are generated ones.

Explanation:

//Rectangle.java class

public class Rectangle {

private int x;

private int y;

private int width;

private int height;

// constructs a new Rectangle with the given x,y, width, and height

public Rectangle(int x, int y, int w, int h)

{

this.x=x;

this.y=y;

this.width=w;

this.height=h;

}

// returns the fields' values

public int getX()

{

return x;

}

public int getY()

{

return y;

}

public int getWidth()

{

return width;

}

public int getHeight()

{

return height;

}

// returns a string such as “Coordinate is (5,12) and dimension is 4x8” where 4 is width and 8 is height. public String toString()

public String toString()

{

String str="";

//add x coordidate , y-coordinate , width, height and area to str and return

str+="Coordinate is ("+x+","+y+")";

str+=" and dimension is : "+width+"x"+height;

str+=" Area is "+(width*height);

return str;

}

public void changeSize(int w,int h)

{

width=w;

height=h;

}

}

======================

//main.java

class Main {

public static void main(String[] args) {

//System.out.println("Hello world!");

//create an object of class Rectangle

Rectangle rect=new Rectangle(5,12,4,8);

//print info of rect using toString method

System.out.println(rect.toString());

//chamge width and height

rect.changeSize(3,10);

//print info of rect using toString method

System.out.println(rect.toString());

}

}

==========================================================================================

//Output

Coordinate is (5,12) and dimension is : 4x8 Area is 32

Coordinate is (5,12) and dimension is : 3x10 Area is 30

========================================================================================

6 0
3 years ago
Steam enters a turbine at 8000 kPa, 440oC. At the exit, the pressure and quality are 150 kPa and 0.19, respectively.
levacccp [35]

Answer:

\dot W_{out} = 3863.98\,kW

Explanation:

The turbine at steady-state is modelled after the First Law of Thermodynamics:

-\dot Q_{out} -\dot W_{out} + \dot m \cdot (h_{in}-h_{out}) = 0

The specific enthalpies at inlet and outlet are, respectively:

Inlet (Superheated Steam)

h_{in} = 3353.1\,\frac{kJ}{kg}

Outlet (Liquid-Vapor Mixture)

h_{out} = 890.1\,\frac{kJ}{kg}

The power produced by the turbine is:

\dot W_{out}=-\dot Q_{out} + \dot m \cdot (h_{in}-h_{out})

\dot W_{out} = -2.93\,kW + (1.57\,\frac{kg}{s} )\cdot (3353.1\,\frac{kJ}{kg} - 890.1\,\frac{kJ}{kg} )

\dot W_{out} = 3863.98\,kW

8 0
3 years ago
In a manufacturing facility, 2-in-diameter brass balls (k = 64.1 Btu/h·ft·°F, rho = 532 lbm/ft^3, and cp = 0.092 Btu/lbm·°F) ini
bekas [8.4K]

Answer:

Explanation:

First we compute the characteristic length and the Biot number to see if the lumped parameter

analysis is applicable.

Since the Biot number is less than 0.1, we can use the lumped parameter analysis. In such an

analysis, the time to reach a certain temperature is given by the following

From the data in the problem we can compute the parameter, b, and then compute the time for

the ratio (T – T)/(Ti

– T)

4 0
4 years ago
Read 2 more answers
Other questions:
  • To find the reactance XLXLX_L of an inductor, imagine that a current I(t)=I0sin(ωt)I(t)=I0sin⁡(ωt) , is flowing through the indu
    9·1 answer
  • Determine displacement (in) of a 1.37 in diameter steel bar, which is 50 ft long under a force of 27,865 lb if elasticity modulu
    5·1 answer
  • A mass of 0.3 kg is suspended from a spring of stiffness 0.4 N/mm. The damping is 3.286335345 kg/s. What is the undamped natural
    5·1 answer
  • The smallest crystal lattice defects is a) cracks b) point defects c) planar defects d) dislocations.
    11·1 answer
  • Calculate the equivalent capacitance of the three series capacitors in Figure 12-1
    5·1 answer
  • A water reservoir contains 108 metric tons of water at an average elevation of 84 m. The maximum amount of electric energy that
    5·1 answer
  • When will the entropy value of the universe attained its maximum value?
    13·1 answer
  • Only respond if your the person im talkin to
    14·1 answer
  • An op-amp differential amplifier is built using four identical resistors, each having a tolerance of ±5%. Calculate the worst p
    14·1 answer
  • From the top of a vertical cliff 80m high, the angles of depression of 2 buoys lying due west of the cliff are 23° and 15° respe
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!