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 500-km, 500-kV, 60-Hz, uncompensated three-phase line has a positivesequence series impedance. z = 5 0.03 1 + j 0.35 V/km and
Anni [7]

Answer:

A) 282.34 - j 12.08 Ω

B) 0.0266 + j 0.621 / unit

C)

A = 0.812 < 1.09° per unit

B =  164.6 < 85.42°Ω  

C =  2.061 * 10^-3 < 90.32° s

D =  0.812 < 1.09° per unit

Explanation:

Given data :

Z ( impedance ) = 0.03 i  + j 0.35 Ω/km

positive sequence shunt admittance ( Y ) = j4.4*10^-6 S/km

A) calculate Zc

Zc = \sqrt{\frac{z}{y} }  =  \sqrt{\frac{0.03 i  + j 0.35}{j4.4*10^-6 } }    

    = \sqrt{79837.128< 4.899^o}   =  282.6 < -2.45°

hence Zc = 282.34 - j 12.08 Ω

B) Calculate  gl

gl = \sqrt{zy} * d  

 d = 500

 z = 0.03 i  + j 0.35

 y = j4.4*10^-6 S/km

gl =  \sqrt{0.03 i  + j 0.35*  j4.4*10^-6}  * 500

   = \sqrt{1.5456*10^{-6} < 175.1^0} * 500

   = 0.622 < 87.55 °

gl = 0.0266 + j 0.621 / unit

C) exact ABCD parameters for this line

A = cos h (gl) . per unit  =  0.812 < 1.09° per unit ( as calculated )

B = Zc sin h (gl) Ω  = 164.6 < 85.42°Ω  ( as calculated )

C = 1/Zc  sin h (gl) s  =  2.061 * 10^-3 < 90.32° s ( as calculated )

D = cos h (gl) . per unit = 0.812 < 1.09° per unit ( as calculated )

where :  cos h (gl)  = \frac{e^{gl} + e^{-gl}  }{2}

             sin h (gl) = \frac{e^{gl}-e^{-gl}  }{2}

     

7 0
2 years ago
Solar energy stored in large bodies of water, called solar ponds, is being used to generate electricity. If such a solar power p
fgiga [73]

Answer: 1.137*10^7 Btu/h.

Explanation:

Given data:

Efficiency of the plant = 4.5percent

Net power output of the plant = 150kw

Solution:

The required collection rate

QH = W/n

= 150/0.045 * 0.94782/ 1 /60 */60 Btu/h.

= 3333.333 *3412.152Btu/h.

= 11373840 Btu/h

= 1.137*10^7 Btu/h.

3 0
3 years ago
Write a C program that will update a bank balance. A user cannot withdraw an amount ofmoney that is more than the current balanc
GarryVolchara [31]

Answer:

Explanation:

Sample output:

BANK ACCOUT PROGRAM!

----------------------------------

Enter the old balance: 1234.50

Enter the transactions now.

Enter an F for the transaction type when you are finished.

Transaction Type (D=deposit, W=withdrawal, F=finished): D

Amount: 568.34

Transaction Type (D=deposit, W=withdrawal, F=finished): W

Amount: 25.68

Transaction Type (D=deposit, W=withdrawal, F=finished): W

Amount: 167.40

Transaction Type (D=deposit, W=withdrawal, F=finished): F

Your ending balance is $1609.76

Program is ending

Code to copy:

// include the necessary header files.

#include<stdio.h>

// Definition of the function

float withdraw(float account_balance, float withdraw_amount)

{

// Calculate the balace amount.

float balance_amount = account_balance - withdraw_amount;

// Check whether the withdraw amount

// is greater than 0 or not.

if (withdraw_amount > 0 && balance_amount >= 0)

{

// Assign value.

account_balance = balance_amount;

}

// return account_balance

return account_balance;

}

// Definition of the function deposit.

float deposit(float account_balance, float deposit_amount)

{

// Check whether the deposit amount is greater than zero

if (deposit_amount > 0)

{

// Update account balance.

account_balance = account_balance + deposit_amount;

}

// return account balance.

return account_balance;

}

int main()

{

// Declare the variables.

float account_balance;

float deposit_amount;

float withdrawl_amount;

char input;

// display the statement on console.

printf("BANK ACCOUT PROGRAM!\n");

printf("----------------------------------\n");

// prompt the user to enter the old balance.

printf("Enter the old balance: ");

// Input balance

scanf("%f", &account_balance);

// Display the statement on console.

printf("Enter the transactions now.\n");

printf("Enter an F for the transaction type when you are finished.\n");

// Start the do while loop

do

{

// prompt the user to enter transaction type.

printf("Transaction Type (D=deposit, W=withdrawal, F=finished): ");

// Input type.

scanf(" %c", &input);

// Check if the input is D

if (input == 'D')

{

// Prompt the user to input amount.

printf("Amount: ");

// input amount.

scanf("%f", &deposit_amount);

// Call to the function.

account_balance=deposit(account_balance,deposit_amount);

}

// Check if the input is W

if (input == 'W')

{

printf("Amount: ");

scanf("%f", &withdrawl_amount);

// Call to the function.

account_balance = withdraw(account_balance,withdrawl_amount);

}

// Check if the input is F

if (input == 'F')

{

// Dispplay the amount.

printf("Your ending balance is $%.2f\n", account_balance);

printf("Program is ending\n");

}

// End the while loop

} while(input != 'F');

return 0;

}

the picture uploaded below shows the program screenshot.

cheers, i hope this helps.

5 0
3 years ago
An electric motor is to be supported by four identical mounts. Each mount can be treated as a linear prevent problems due requir
Artyom0805 [142]

GIVEN:

Amplitude, A = 0.1mm

Force, F =1 N

mass of motor, m = 120 kg

operating speed, N = 720 rpm

\frac{A}{F} =  \frac{0.1\times 10^{-3}}{1} = 0.1\times 10^{-3}

Formula Used:

A = \frac{F}{\sqrt{(K_{t} - m\omega ^{2}) +(\zeta \omega ^{2})}}

Solution:

Let Stiffness be denoted by 'K' for each mounting, then for 4 mountings it is 4K

We know that:

\omega = \frac{2 \pi\times N}{60}

so,

\omega = \frac{2 \pi\times 720}{60} = 75.39 rad/s

Using the given formula:

Damping is negligible, so, \zeta = 0

\frac{A}{F} will give the tranfer function

Therefore,

\frac{A}{F} = \frac{1}{\sqrt{(4K - 120\ ^{2})}}

0.1\times 10^{-3} =  \frac{1}{\sqrt{(4K - 120\ ^{2})}}

Required stiffness coefficient, K = 173009 N/m = 173.01 N/mm

8 0
3 years ago
What does this work for
Anastaziya [24]

Answer:

it allows your dash board to light up you MPH RPM and all the other numbers on the spadomter

Explanat

8 0
3 years ago
Other questions:
  • 7 Single-use earplugs require a professional fitting before they can be used.
    10·2 answers
  • A closed system undergoes a process in which work is done on the system and the heat transfer Q occurs only at temperature Tb. F
    8·1 answer
  • The viscosity of all liquids decreases as the temperature is a) Increased b) decreased c) maintained constant d) fluctuating e)
    12·1 answer
  • A 3-phase induction motor is being driven at a frequency of 80 Hz, and the motor speed is 1000 rpm. How many poles does the moto
    8·1 answer
  • Calculate the equivalent capacitance of the three series capacitors in Figure 12-1 A) 0.060 uF B) 0.8 uF C) 0.58 uF D) 0.01 uF
    12·1 answer
  • Hii I need help can someone help me
    15·1 answer
  • I NEED HELP ASAP WILL AWARD BRAINLIEST
    8·2 answers
  • The quantity of bricks required increases with the surface area of the wall, but the thickness of a masonry wall does not affect
    10·2 answers
  • Risks are Not Perceived Differently from What is Happening<br> False<br> True
    14·1 answer
  • when discussing valve train components, technician a says stamped rocker arms are very strong and may be used in high-horsepower
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!