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 number that divides into another without a remainder.

Answers

Answer 1
Answer:

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;

}

Answer 2
Answer:

In this exercise, using the knowledge of computational language in C++, we have that this code will be written as:

The code is in the attached image.

We can write the C++  as:

#include<bits/stdc++.h>

#include<iostream>

using namespace std;

int divSum(int num)

{

int result = 0;

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

{

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;

}

See more about C++ at brainly.com/question/19705654


Related Questions

A chemical process converts molten iron (III) oxide into molten iron and carbon dioxide by using a reducing agent of carbon monoxide. The process allows 10.08 kg of iron to be produced from every 16.00 kg of iron (III) oxide in an excess of carbon monoxide. Calculate the percentage yield of iron produced in this process.
A wall in a house contains a single window. The window consists of a single pane of glass whose area is 0.15 m2 and whose thickness is 5 mm. Treat the wall as a slab of the insulating material Styrofoam whose area and thickness are 10 m2 and 0.15 m, respectively. Heat is lost via conduction through the wall and the window. The temperature difference between the inside and outside is the same for the wall and the window. Of the total heat lost by the wall and the window, what is the percentage lost by the window
A 2-m3insulated rigid tank contains 3.2 kg of carbon dioxide at 120 kPa.Paddle-wheel work is done on the system until the pressure in the tank rises to 180kPa. Determine the entropy change in the carbon dioxide during this process. Assumeconstant specific heat and room temperature at 300 K
Make a python code.Write a function named max that accepts two integer values as arguments and returns the value that is the greater of the two. For example, if 7 and 12 are passed as arguments to the function, the function should return 12. Use the function in a program that prompts the user to enter two integer values. The program should display the value that is the greater of the two. Write the program as a loop that continues to prompt for two numbers, outputs the maximum, and then goes back and prompts againHere’s an example of program useInput the first number: 10Input the second number: 5The maximum value is 10Run again? yesInput the first number: -10Input the second number: -5The maximum value is -5Run again? noFunction max():Obtain two numbers as input parameters: max(num1, num2):if num1 > num2 max_val = num1, else max_val = num2return max_valMain Program:Initialize loop control variable (continue = ‘y’)While continue == ‘y’Prompt for first numberPrompt for second numberCall function "max," sending it the values of the two numbers, capture result in an assignment statement:max_value = max (n1, n2)Display the maximum value returned by the functionprint(‘Max =’, max_val)Ask user for if she/he wants to continue (continue = input(‘Go again? y if yes’)
1.19. A gas is confined in a 0.47 m diameter cylinder by a piston, on which rests a weight. The mass of the piston and weight together is 150 kg. The local acceleration of gravity is 9.813 m·s−2, and atmospheric pressure is 101.57 kPa. (a) What is the force in newtons exerted on the gas by the atmosphere, the piston, and the weight, assuming no friction between the piston and cylinder? (b) What is the pressure of the gas in kPa? (c) If the gas in the cylinder is heated, it expands, pushing the piston and weight upward. If the piston and weight are raised 0.83 m, what is the work done by the gas in kJ? What is the change in potential energy of the piston and weight?\

1. (5 pts) An adiabatic steam turbine operating reversibly in a powerplant receives 5 kg/s steam at 3000 kPa, 500 °C. Twenty percent of the flow is extracted at 1000 kPa to a feedwater heater and the remainder flows out at 200 kPa. Find the two exit temperatures and the turbine power output.

Answers

Answer:

temperature of first extraction 330.8°C

temperature of second extraction 140.8°C

power output=3168Kw

Explanation:

Hello!

To solve this problem we must use the following steps.

1. We will call 1 the water vapor inlet, 2 the first extraction at 100kPa and 3 the second extraction at 200kPa

2. We use the continuity equation that states that the mass flow that enters must equal the two mass flows that leave

m1=m2+m3

As the problem says, 20% of the flow represents the first extraction for which 5 * 20% = 1kg / s

solving

5=1+m3

m3=4kg/s

3.

we find the enthalpies and temeperatures in each of the states, using thermodynamic tables

Through laboratory tests, thermodynamic tables were developed, these allow to know all the thermodynamic properties of a substance (entropy, enthalpy, pressure, specific volume, internal energy etc ..)  

through prior knowledge of two other properties

4.we find the enthalpy and entropy of state 1 using pressure and temperature

h1=Enthalpy(Water;T=T1;P=P1)

h1=3457KJ/kg

s1=Entropy(Water;T=T1;P=P1)

s1=7.234KJ/kg

4.

remembering that it is a reversible process we find the enthalpy and the temperature in the first extraction with the pressure 1000 kPa and the entropy of state 1

h2=Enthalpy(Water;s=s1;P=P2)

h2=3116KJ/kg

T2=Temperature(Water;P=P2;s=s1)

T2=330.8°C

5.we find the enthalpy and the temperature in the second extraction with the pressure 200 kPav y the entropy of state 1

h3=Enthalpy(Water;s=s1;P=P3)

h3=2750KJ/kg

T3=Temperature(Water;P=P3;s=s1)

T3=140.8°C

6.

Finally, to find the power of the turbine, we must use the first law of thermodynamics that states that the energy that enters is the same that must come out.

For this case, the turbine uses a mass flow of 5kg / s until the first extraction, and then uses a mass flow of 4kg / s for the second extraction, taking into account the above we infer the following equation

W=m1(h1-h2)+m3(h2-h3)

W=5(3457-3116)+4(3116-2750)=3168Kw

The hot water needs of an office are met by heating tab water by a heat pump from 16 C to 50 C at an average rate of 0.2 kg/min. If the COP of this heat pump is 2.8, the required power input is: (a) 1.33 kW (d) 10.2 kW (b) 0.17 kW (c) 0.041 kW

Answers

Answer:

option B

Explanation:

given,

heating tap water from 16° C to 50° C

at the average rate of 0.2 kg/min

the COP of this heat pump is 2.8

power output = ?

COP = (Q_H)/(W_(in))\nW_(in) = (Q_H)/(COP)\nW_(in) = ((0.2)/(60)* 4.18* (50-16))/(2.8)\nW_(in) = 0.169

the required power input is 0.169 kW or 0.17 kW

hence, the correct answer is option B

An aquifer has three different formations. Formation A has a thickness of 8.0 m and hydraulic conductivity of 25.0 m/d. Formation B has a thickness of 2.0 m and a conductivity of 142 m/d. Formation C has a thickness of 34 m and a conductivity of 40 m/d. Assume that each formation is isotropic and homogeneous. Compute both the overall horizontal and vertical conductivities.

Answers

Answer:

The horizontal conductivity is 41.9 m/d.

The vertical conductivity is 37.2 m/d.

Explanation:

Given that,

Thickness of A = 8.0 m

Conductivity = 25.0 m/d

Thickness of B = 2.0 m

Conductivity = 142 m/d

Thickness of C = 34 m

Conductivity = 40 m/d

We need to calculate the horizontal conductivity

Using formula of horizontal conductivity

K_(H)=(H_(A)K_(A)+H_(A)K_(A)+H_(A)K_(A))/(H_(A)+H_(B)+H_(C))

Put the value into the formula

K_(H)=(8.0*25+2,0*142+34*40)/(8.0+2.0+34)

K_(H)=41.9\ m/d

We need to calculate the vertical conductivity

Using formula of vertical conductivity

K_(V)=(H_(A)+H_(B)+H_(C))/((H_(A))/(K_(A))+(H_(B))/(K_(B))+(H_(C))/(K_(C)))

Put the value into the formula

K_(V)=(8.0+2.0+34)/((8.0)/(25)+(2.0)/(142)+(34)/(40))

K_(V)=37.2\ m/d

Hence, The horizontal conductivity is 41.9 m/d.

The vertical conductivity is 37.2 m/d.

Consider a mixture of hydrocarbons that consists of 60 percent (by volume) methane, 30 percent ethane, and 10 percent propane. After passing through a separator, the mole fraction of the propane is reduced to 1 percent. the mixture pressure before and after the separation is 100 kPa. Determine the change in the partial pressures of all the constituents in the mixture.

Answers

Answer:

\Delta P_m=6\text{kPa}\n\Delta P_e=3\text{kPa}\n\Delta P_p=-9\text{kPa}

Explanation:

mole fraction of propane after passing through the separator is \beta_p

(\beta)/(0.6+0.3+\beta)=0.01

\beta =9.09* 10^-^3

mole fractions of ethane \beta _e and methane \beta_m after passing through separator are:

\beta_e =(0.3)/(0.3+0.6+0.00909)=0.66\n\beta_m=(0.6)/(0.3+0.6+0.00909)=0.33

Change in partial pressures then can be written as:

\Delta P=(y_2-y_1)\cdot P  where y_2 and y_1 are mole fractions after and before passing through the separator

Hence,

\Delta P_m=(0.66-0.6)\cdot 100\text{k}=6\text{kPa}\n\Delta P_e=(0.33-0.3)\cdot 100\text{k}=3\text{kPa}\n\Delta P_p=(0.01-0.1)\cdot 100\text{k}=-9\text{kPa}

Calculate the amount of power (in Watts) required to move an object weighing 762 N from point A to point B within 29 seconds. Distance between point A and point B is 5.0 meters and they are at the same level. (Ignore the frictional losses)

Answers

Answer:

0.556 Watts

Explanation:

w = Weight of object = 762 N

s = Distance = 5 m

t = Time taken = 29 seconds

a = Acceleration

g = Acceleration due to gravity = 9.81 m/s²

Equation of motion

s=ut+(1)/(2)at^2\n\Rightarrow a=(2* (s-ut))/(t^2)\n\Rightarrow a=(2* (5-0))/(29^2)=(10)/(481)

Mass of the body

m=(w)/(g)=(762)/(9.81)

Force required to move the body

F=ma\n\Righarrow F=(762)/(9.81)* (10)/(481)

Velocity of object

v=u+at\n\Rightarrow v=0+(10)/(481)* 29\n\Rightarrow v=(10)/(29)

Power

P=Fv\n\Rightarrow P=(762)/(9.81)* (10)/(481)* (10)/(29)=0.556\ W

∴ Amount of power required to move the object is 0.556 Watts

What does Enter key do? You cannot click Enter key to start a line if your current is blank?

This is spot to do today

Answers

Answer:

See below

Explanation:

Enter-key also called the "Return key," it is the keyboard key that is pressed to signal the computer to input the line of data or the command that has just been typed.It Was the Return KeyThe Enter key was originally the "Return key" on a typewriter, which caused the carriage to return to the beginning of the next line on the paper. In a word processing or text editing application, pressing Enter ends a paragraph. A character code for return/end-of-line, which is different in Windows than it is in the Mac, Linux or Unix, is inserted into the text at that point.

Answer:

True

Explanation:

Once there are two yellow lines having inner broken lines on the two sides of a center traffic lane, what this is trying to tell you is that you can use those lanes to start a left hand turn, or a U-turn from the both directions of traffic. However you cannot use it for passing. This is sometimes misunderstood by road users and drivers.