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
Dvinal [7]
2 years ago
12

Plz help me in this example

Computers and Technology
1 answer:
Gekata [30.6K]2 years ago
4 0

Answer:

import java.util.*;

public class calcarms

{

public static void main(String [] args)

{

 Scanner input = new Scanner(System.in);

 //Declare Variable

 int num;

 //Initialize num to 0

 num = 0;

 //Print heading

 System.out.println("Armstrong Numbers\t\tDifference between Successive Armstrong Numbers");

 //Call Armstrong method

 boolean result = Armstrong(num);  

}

public static boolean Armstrong(int num)

{

 int nums;

 //Initialize old_Arms and new_Arms to 0

 int old_Arms =0; int new_Arms = 0;

 for(int i = 0;i<=500;i++) //Iterate from 0 to 500

 {

  nums = i;

 int temp,calc = 0;

 temp = nums;  

  //Check individual digit of each number

 while(nums > 0)

 {

  int a=nums%10;  

  nums/=10;

  calc+=(a*a*a);//Find cube of number

 }

 if(temp == calc) //Check if number is armstrong

 {

  new_Arms = calc;

  old_Arms = new_Arms - old_Arms;

  System.out.println(calc+"\t\t\t"+old_Arms);//Print

  old_Arms = calc;      

 }

 }

 return true;  

};

}

Explanation:

Comments are used to explain difficult lines

You might be interested in
In a spreadsheet, there are many features that help you edit quickly. True False
9966 [12]

Answer:

True

Explanation:

There are many form a quick editing

i hoped this helped

;)

7 0
3 years ago
You are finally at the stage of the software life cycle where you begin programming. What is this stage called?
nataly862011 [7]
You are finally at the stage of the software life cycle where you begin programming. What is this stage called?

development

5 0
2 years ago
2. Create 4 riddleson keywords which is related to fire wall.​
Alona [7]

Answer:

It's been so good to have you as a friend:

2. As sweet and rich as honey-colored sun

3. Slanting steep across a summer lawn,

4. Gilding life with all that love can lend.

5. And now that you yourself have griefs to tend,

6. I want to be the strong and caring one

7. To count to you the lovely things you've done

8. Until these troubles pass and sorrows end.

9. You are so beautiful in form and soul

10. That you bring happiness to all you're near:

11. Just as a sea rose, flowering in mist,

12. Makes a paradise of some bleak shoal,

13. Turning truth to something far more clear,

14. No pain unsoothed or rain-swept cheek unkissed.

good~0~as_a_friend . good_to_have~Slanting~lawn .

It's_been~so_good~as_a_friend .

to_have~griefs_to~form_and_soul

Explanation:

7 0
3 years ago
2. Write a simple program in C++ to investigate the safety of its enumeration types. Include at least 10 different operations on
erastovalidia [21]

Answer:

Check the explanation

Explanation:

To solve the question above, we will be doing some arithmetic and bit wise operations on enum values. in addition to that, we are asserting the array with INTCOUNT  and also printing the size of array i.e 12 and we are adding BIG_COUNT enum value to 5 and the result is 25.

#include<stdio.h>

enum EnumBits

{

ONE = 1,

TWO = 2,

FOUR = 4,

EIGHT = 8

};

enum Randoms

{

BIG_COUNT = 20,

INTCOUNT = 3

};

int main()

{

// Basic Mathimatical operations

printf("%d\n",(ONE + TWO)); //addition

printf("%d\n",(FOUR - TWO)); //subtraction

printf("%d\n",(TWO * EIGHT)); //multiplication

printf("%d\n",(EIGHT / TWO)); //division

// Some bitwise operations

printf("%d\n",(ONE | TWO)); //bitwise OR

printf("%d\n",(TWO & FOUR)); //bitwise AND

printf("%d\n",(TWO ^ EIGHT)); //bitwise XOR

printf("%d\n",(EIGHT << 1)); //left shift operator

printf("%d\n",(EIGHT >> 1)); //right shift operator

// Initialize an array based upon an enum value

int intArray[INTCOUNT]; // declaring array

// Have a value initialized be initialized to a static value plus

int someVal = 5 + BIG_COUNT; //adding constant and BIG_COUNT variable

printf("%d\n",someVal); //value will be 25

printf("%d",sizeof(intArray)); //value will be 12

return 0;

}

Kindly check the attached image below for the Code and Output Screenshots:

6 0
2 years ago
Digital Subscriber Line (DSL) is the only Internet connection option available for a small office in the middle of nowhere. Whic
andrey2020 [161]

What's up!!! :D A Tech-Savvy here:

Answer:

Symmetric Digital Subscriber Line (SDSL)

Cheers,

Feel free to ask me anything regarding ICT/Tech.

7 0
3 years ago
Other questions:
  • What runs a network, steering information between computers and managing security and users?
    11·1 answer
  • Which type of security threat installs to a computer without the user's knowledge and then monitors all computer activity?
    12·2 answers
  • The Apple II is an IBM-compatible PC "clone".<br> True?<br> False?
    10·1 answer
  • The ____ cell on the worksheet is the one into which you can enter data.â
    15·2 answers
  • This term describes two or more arrays that hold related data, and the related elements in each array are accessed with a common
    15·1 answer
  • Which method do software testers use to isolate new code from the rest of the network during the test stage of the software deve
    15·1 answer
  • What is the definition of Overflow Error?
    5·1 answer
  • Every single device can be connected to every other device on network, making the network mesh. This statement is True or False?
    8·1 answer
  • HELP!!!
    15·2 answers
  • Calculate The Average of Grades Instructions:
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!