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
Allushta [10]
4 years ago
5

Suppose that the code below is the body of some loop. Given variables x and y write some code that reads a value into the variab

les, respectively, then prints out the value of x divided by y. Use a continue statement to make sure that nothing is written to court when y is 0.
Computers and Technology
1 answer:
ra1l [238]4 years ago
4 0

Answer:

I will code in JAVA.

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

     float x;

     float y;

     float result;

     Scanner input = new Scanner(System.in);

     while(true){ <em>//this is an infinite loop</em>

       x = input.nextFloat(); <em>//wait the input for x</em>

       y = input.nextFloat(); <em>//wait the input for y</em>

       if(y == 0) {

         continue; <em>//next iteration without print.</em>

       } else{

         result = x/y;

         System.out.print(result); <em>//print the result.</em>

       }

     }

 }

}

Explanation:

To get the numbers, you need to import Scanner class, and use the method nextFloat() to admit floats and integers.

If y is 0 then, executes the continue statement, if not prints the division between x and y.

You might be interested in
A(n) ____ is system software. Group of answer choices word processing program presentation graphics program operating system spr
Damm [24]

An operating system is a system software.

<h3>What is a System software?</h3>

A Systems software are programs that provide  resources to manage the computer  by providing a platform to run its  hardware and application programs.

Types of System software includes:

  • application programs
  • device drivers
  • operating systems.

An Operating system, (OS) is a system software that controls the  computer hardware and  software programs by  directing the processing of programs within a platform.

Learn more on Operating systems:brainly.com/question/4926335

8 0
2 years ago
You are a network administrator for a company that has two buildings. You are setting up a wireless network so users can maintai
lukranit [14]

Answer:

123

Explanation:

123

7 0
3 years ago
What is the most popular type or method of guaranteed reservation where booking transactions will be charged automatically?
Rzqust [24]

Answer:

Credit cards.

Explanation:

When booking a reservation, the most popular type or method of making sure the reservation is guaranteed where booking transactions are charged automatics is the use of credit cards.

Why this is popular is because, the hotel, reserve or suite that is about to be booked will still receive their money even if the person that booked didn't show up.

4 0
3 years ago
What is the purpose of HTML?
Basile [38]
You can style and structure with it so it’s either one of those
3 0
3 years ago
Create a method called fixArray(int[][] array, int row, int col, int value) that sets the [row][column] to the correct value. Th
PolarNik [594]

Answer:

  1. public class Main {
  2.    public static void main (String [] args) {
  3.        int[][] myArray = {{1,5,6}, {7, 9, 2}};
  4.        fixArray(myArray, 1, 2, 12);
  5.        System.out.println(myArray[1][2]);
  6.    }
  7.    private static void fixArray(int[][] array, int row, int col, int value){
  8.        array[row][col] = value;
  9.    }
  10. }

Explanation:

The solution code is written in Java.

Firstly, create the method fixArray with that takes four inputs, array, row, col and value (Line 11). Within the method body, use row and col as index to address a particular element from array and set the input value to it (Line 12).

Next, we test the method in the main program using a sample array (Line 4) and we try to change the row-1 and col-2 element from 2 to 12 (Line 5).

The print statement in Line 7 will display 12 in console.

7 0
4 years ago
Other questions:
  • A process-based DO/S must synchronize actions across the network. When a process reaches a point at which it needs service from
    6·1 answer
  • Which computer device helps you input data in the form of text, numbers, and commands?
    9·1 answer
  • Having reviewed dod wireless stig (ver6, release 1), sarah learns she may only utilize secnet 54 and ______________ for transmit
    13·1 answer
  • Create a script that asks for the visitor's weight in pounds and his/her height in inches. The program should then calculate the
    13·1 answer
  • If you have a long title for a table and need it to span several cells, you can use A. Merge Cells. B. Split Cells. C. Insert Co
    5·1 answer
  • A user found that their personal data had been exfiltrated from their computer by a malicious program that they clicked on sever
    12·1 answer
  • How will you -
    9·1 answer
  • How do ACLs work on a router?
    14·1 answer
  • What is meant by astigmation​
    9·2 answers
  • +<br>ii) MnO4 + H2S + H+​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!