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]
3 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]3 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
Piecewise functions are sometimes useful when the relationship between a dependent and an independent variable cannot be adequat
Andru [333]

Answer:

//Set a piecewise function v(t).

function v = vpiece(t)

//Set the condition first for t.

if ((0<=t)and(t<=8))  //Set if condition

// first equation of velocity.

   v = 10*t^2 - 5*t;

//Set the condition second for t.

elseif((8<=t)and(t<=16))  //Set elseif condition

//second equation of velocity.

v = 624 - 5*t;

//set the condition third for t.

elseif((16<=t)and (t<=26))  //Set elseif condition  

//third equation of velocity.

v = 36*t + 12*(t - 16)^2;

//Set the fourth condition for t.

elseif t>26

//fourth equation of velocity.

v = 2136*exp(-0.1*(t-26));

//Last condition.

else

//fifth equation of velocity.

v = 0;

//End of the function v.

end

//set a variable and initialize it to 0.

a=0;

//Starting the loop.

for j = -5: 0.5 : 70

//Increment the value of a by 1.

a = a + 1;

t(a) = j;

v(a) = vpiece(t(a));

//End of for loop.

end

//Plot the graph between t and v.

plot(t,v)

//Write the label for the x-axis.

xlabel('t')

//Write the label for the y-axis.

ylabel('velocity')

//Write the title of the plot.

title('Plot of velocity vs t')

Explanation:

Firstly, we set the piecewise method.

Then we set the first condition, after that we apply the condition of velocity.

Then we set the second condition, after that we apply the condition of velocity.

Then we set the third condition, after that we apply the condition of velocity.

Then we set the fourth condition, after that we apply the condition of velocity.

Then we set the last or fifth condition, after that we apply the condition of velocity.

Then we set the variable "a" to 0.

Then start the loop and increase the value by 1.

And after all, we write the title of the plot.

8 0
3 years ago
A department requires access to the database application from monday to friday, 9am to 5 pm. last thursday at 1 pm, the applicat
iragen [17]

Answer:

90%

Explanation:

90%

ELO 4.2 A department requires access to the database application from Monday to Friday, 9AM to 5 PM. Last Thursday at 1 PM, the application crashed, and it took six hours to fix the problem. What was the availability of the application during the week?

6 0
1 year ago
What are the characteristics of the Outlook Rules Wizard? Check all that apply.
Marina CMI [18]

Answer:It is useful for staying organized.

Users can edit the rule description.

Users can move messages to folders.

It is divided into three template choices.

Explanation:

7 0
2 years ago
What is the difference between a circuit board and a bread board
stepan [7]

Answer:

A bread board is prototyped (manufactured) in a way where it is less permanent than a pcb (printed circuit board) or an even more permanent pcba (printed circuit board assembly). Bread boards are typically the first step to creating a finished circuit because electronic components are easier to test and take apart when needed; design and investigation can be made effectively as no soldering connections are required. Whereas a circuit board is used for the further finished products because they don't have sockets like the bread board and so there is little room for error and mistakes.

8 0
2 years ago
Suppose that you have a multiplexer (mux) with 5 different inputs at the following bit-rates: (A) 20 Kbps, (B) 8 Kbps, (C) 12 Kb
sweet [91]
The answer is number:

C.- Kbps
7 0
3 years ago
Other questions:
  • The ____ shortcut keys remove character formatting. (points : 2) ctrl 0 (zero) ctrl i ctrl spacebar ctrl u
    8·2 answers
  • Generally speaking, manufacturing overhead is applied to production by means of a __________ __________ __________, which is com
    11·2 answers
  • Which of the following is an unintended consequence of pesticide use on crops?
    10·1 answer
  • What is the difference between ARM and INTEL Chip?
    6·1 answer
  • Which of the following examines the organizational resource of information and regulates its definitions, uses, value, and distr
    9·1 answer
  • Anyone got the edmentum computer programming post test answers?
    6·1 answer
  • In general, smartphones do NOT hold as much personal information as tablets.
    11·1 answer
  • Write a program that first reads in the name of an input file, followed by two strings representing the lower and upper bounds o
    8·1 answer
  • A derived class is a class that inherits data members and functions from a ____ class.
    6·1 answer
  • Which of the following is not a benefit of shaping data with the Power Query Editor?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!