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
Genrish500 [490]
4 years ago
7

Write a program that reads in a list of numbers, and for each number, determines and prints out whether or not that number is ab

undant.
Computers and Technology
1 answer:
adelina 88 [10]4 years ago
7 0
int IsAbundant(int n)
{
int divisorSum = 0;
for (int i = 1; i < n; i++) {
 if ((n % i) == 0) {
  divisorSum += i;
 }
}
return divisorSum > n;
}


int main()
{
int number = 0;
do {
 printf("Enter a number (0 to quit): ");
 scanf_s("%d", &number);
 if (IsAbundant(number)) {
  printf("%d is abundant!\n", number);
   } else
   {
    printf("%d is not abundant.\n", number); }
   } while (number > 0);

   return 0;
}

You might be interested in
Which button would you use to quickly add addresses to a mail merge envelope?
Jet001 [13]

The answer to your question is,

C. Address Block

-Mabel <3

5 0
4 years ago
In Java please:
topjm [15]

Answer:

import java.util.Scanner;

public class Supermarket

{

public static void main (String[] args)

{  

String item;

double pounds, ounces, price,

total, unit;

Scanner scn = new Scanner(System.in);

System.out.print("Please enter the name of item ");

item = scn.nextLine();

System.out.print("Please enter the price of "  + "the item per pound : ");

price = scn.nextDouble();

System.out.print("Enter the weight of "  + "the item in pounds and "  + "ounces respectively : ");

pounds = scn.nextDouble();

ounces = scn.nextDouble();

unit = price/16;

total = price * (pounds + ounces/16);

System.out.print("The unit price of "  + "the products sold is : "  + unit);

System.out.print("\nThe total cost of the "  + "amount purchased is : "  + total);

}

}

Explanation:

  • Ask the user to enter the price of  the item and the weight.
  • Calculate the unit and the total price.
  • Display the unit and the total price.

6 0
3 years ago
Read 2 more answers
Java uses ____ to implement method lookup.A) a jump tableB) an inheritance treeC) restricted accessD) polymorphism
sashaice [31]

Answer:

D) polymorphism

7 0
4 years ago
Give me your 3ds friend code :)
Karolina [17]

You can friend me mine is- 3024-6635-0458

4 0
4 years ago
Consider a network of 8 routers connected together to provide more than one path of connectivity between host A and host B at tw
ser-zykov [4K]

Answer:

Option C is the correct option to the following question

Explanation:

Because there are not any limits is required of sending data and packets between host A and host B by the routers and the router permit more than one paths between the hosts for the establishment of the connectivity st two distinct locations in the routing protocol. The router transmits the packets between the hosts that is produced by link-state protocol.

5 0
3 years ago
Other questions:
  • If you could make any blog, what would it be about and why?
    9·1 answer
  • Explain the purpose of the frame check sequence (fcs) field in a data link frame trailer.
    7·1 answer
  • Which wildcard character replaces a single character in the command-line interface?
    11·1 answer
  • What is the inflation rate if the price of a soda was $10 last year, but only $5 this year?
    5·1 answer
  • What are some specific ways that businesses use the internet?
    6·2 answers
  • the id selector uses the id attribute of an html element to select a specific element give Example ?​
    11·1 answer
  • Question 11
    9·1 answer
  • What type of multimedia are live news feeds? Live news feeds are examples of ________ multimedia. 20 POINTS PLZ HELP
    5·2 answers
  • If you can name this you get 15 points: ↑↑↓↓←→←→βα
    10·1 answer
  • No links it’s just a normal question about iPhones.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!