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
liraira [26]
3 years ago
6

Code a program that will go through all the numbers from 1 to 100 and print them. However, if the number is evenly divisible by

3 then print the word "fizz" instead of the number. If the number is evenly divisible by 5 then print the word "buzz" instead of the number. And, if the number is evenly divisible by both 3 and 5, print the word "fizz buzz" instead of the number. Use a loop, and use modulus division. Only the driver class is needed, and in main just call 1 method called fizzBuzz().
In java.
Computers and Technology
1 answer:
worty [1.4K]3 years ago
8 0

Answer:

public class Main

{

   // required method

   public static void fizzBuzz(){

       // looping through 1 to 100

       for(int i = 1; i <= 100; i++){

           //if number is evenly divisible by both 3 and 5

           if(i%3 == 0 && i%5 == 0){

               System.out.println("fiz buzz");

           }

                   // if number is divisible by 3

           else if (i%3 == 0){

               System.out.println("fizz");

           }

                        // if number is divisible by 5

           else if (i%5 == 0){

               System.out.println("buzz");

           }

                       // if number is not divisible by both 3 and 5

           else {

               System.out.println(i);

           }

       }

   }

       // main method

       public static void main(String[] args) {

           //calling function

               fizzBuzz();

       }

}

Explanation:

You might be interested in
A Pool charges $4 each visit,or you can buy a membership. Write and solve an inequality to find how many times a person should u
MAXImum [283]
$4 x number of visits (V)> price of membership (M)
V > M/4
8 0
4 years ago
A(n) __________ port, also known as a monitoring port, is a specially configured connection on a network device that is capable
drek231 [11]

Answer:

The answer is "SPAN"

Explanation:

The full form of SPAN port is  "Switch Port Analyzer", which is used to designed specifically for the interface on a network device, that would be able to monitor all traffic passing across the entire device.

  • The use of this port will also call the mirror ports, that is a popular way of gathering data traffic for tracking purposes.
  • It is primarily used to access the bus switch and all interfaces, which is usually accessible from data transmission.
7 0
4 years ago
The factorial of n is equal to ______.
alexdok [17]

Answer:

n! = n*(n-1)*(n-2)*(n-3)* ... *2*1

Explanation:

The factorial operator is simply a mathematical expression of the product of a stated integer and all integers below that number down to 1.  Consider these following examples:

4! = 4 * 3 * 2 * 1

4! = 12 * 2 * 1

4! = 24

6! = 6 * 5 * 4 * 3 * 2 * 1

6! = 30 * 4 * 3 * 2 * 1

6! = 120 * 3 * 2 * 1

6! = 360 * 2 * 1

6! = 720

So, the factorial of n would follow the same as such:

n! = n * (n-1) * (n-2) * ... * 2 * 1

Cheers.

5 0
3 years ago
What is software infrastructure?
Setler79 [48]
Software-defined infrastructure (SDI) is the definition of technical computing infrastructure entirely under the control of software with no operator or human intervention. It operates independent of any hardware-specific dependencies and are programmatically extensible.
4 0
3 years ago
Matt Cooper of Soggy Bottom Canoe and Kayak Rental refers to concept testing as​ _____ testing.
andrezito [222]

Answer:

Beta

Explanation:

Beta testing is a Quality Assurance process, where Developers and testers evaluate the quality of application experience from the point of view of the users, who are the most important targets of any software product.

5 0
4 years ago
Other questions:
  • A person who wants to buy a compact disc (cd) has just enough money to buy one, and chooses cd a instead of cd
    10·2 answers
  • Help, please!! A file named "games.txt" exists and has 80 lines of data. You open the file with the following line of code. aFil
    6·1 answer
  • If a fire should break out in your building, which of the following actions is NOT recommended?
    9·2 answers
  • 1) In your own words, explain what a browser is. 2) Why is it important to keep your browser up to date?
    12·1 answer
  • Find two consecutive even integers such that twice the smaller is 16 more than the larger
    10·1 answer
  • 19. The power supply in your server has just been replaced because of power problems. Your server boots, but now there is a mess
    13·1 answer
  • Which technology will a business use to figure out who accessed confidential files on a company's computer system
    12·1 answer
  • Choose all stages of the information processing cycle.
    12·2 answers
  • What is the difference between autofocus and autocomplete
    8·1 answer
  • Which statement best explains the way that similar apps are used in different devices?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!