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
Why would a person who handles electronic components wear a grounded wrist strap
Otrada [13]
Normally, wrist straps like this are used to prevent static electric discharge, which can ruin electric components.<span />
5 0
3 years ago
How do take a picture on this to ask?
Galina-37 [17]
What computer are you on, To take a screenshot on a chromebook press control shift then the switch screens button

If any other computer use snipping tool. Or look up how to screenshot on (Your computer)

Then click that paperclick and go to the file of the screenshot and click it. Then type in a question and click ask.
3 0
3 years ago
Behave online in the same way as you wish to be treated true false​
Yuliya22 [10]

True; you have treat others the way you want to be treated. It is the golden rule for meeting anyone, whether it's online or in real life. If you were being mean to someone online, would you want someone to be mean to you the same way you were mean to that person? So, the answer is true.

5 0
3 years ago
In Florida no fault insurance is optional for owners of a vehicle
Elena-2011 [213]
It is false, Its obligatory. 
7 0
3 years ago
There u go i did thereeeeeeeeeeeeeeeeeeeeeee
Alika [10]
Awwww u cutie pie:)) thanks for showing me how to screenshot
3 0
3 years ago
Read 2 more answers
Other questions:
  • Write a loop that sets newScores to oldScores shifted once left, with element 0 copied to the end. Ex: If oldScores = {10, 20, 3
    15·1 answer
  • A must decode this code. I guess is not a Cesar. The last line is a email adress.
    15·1 answer
  • Where did the fd00::0:0:0:1 address that you supplied for the dns recursive name server ipv6 address list option come from?
    8·1 answer
  • You are assigned to modify an existing Webpage by adding several tables that contain precise wording. The Webpage has had severa
    14·1 answer
  • if image size and resolution are the same, which file format, .jpg, .gif, .or .tiff, will give you the smallest file size?
    8·2 answers
  • The following is the pseudocode for which type of algorithm? For start = each array subscript, from the first to the next-to-las
    6·1 answer
  • Cryptography has requirements include:
    8·1 answer
  • What are the missing letters _A_TO_ ( 6 letters) a type of computer.
    13·2 answers
  • Question 2:
    7·1 answer
  • Your friend Cameron’s little sister is visually impaired. Cameron is worried that his sister will not be able to use technology
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!