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
To write on a cd-rw disc, users must have cd-rw software and a cd-rw ____.
Karo-lina-s [1.5K]
Hello there!

It would be A cd - rw Drive.

Hope This Helps You!
Good Luck :)
4 0
3 years ago
Write a program that: Takes the list lotsOfNumbers and uses a loop to find the sum of all of the odd numbers in the list (hint:
Alika [10]

Answer:

Following are the code to this question:

#include <iostream>//defining header file

using namespace std;

int main()//defining main method

{

int x[]={2,3,4,6,7,8,9,1,11,12};//defining 1-D array and assign value

int i,sum=0;//defining integer variable

for(i=0;i<10;i++)//defining loop for count value

{

   if(x[i]%2==1)//defining if block to check odd value

   {

       sum=sum+x[i];//add value in sum variable

   }

}

cout<<sum;//print sum

return 0;

}

Output:

31

Explanation:

In the above-given program, an integer array "x" is declared that holds some integer values, and in the next line two integer variable "i and sum" is defined which is used to calculate the value.

In the next line, a for loop is declared, that counts all array value, and it uses the if block to check the odd value and add all the value into the sum variable.

5 0
2 years ago
Create a SELECT statement that returns the count, average, max and min of the invoices submitted by each vendor, who has submitt
sveta [45]

Answer:

SELECT Count(order_invoice) as number_of_invoices, Max(order_invoice) as maximum_invoice, Min(order_invoice) as minimum_invoice, Avg(order_invoice) as average_invoice

FROM vendor JOIN invoice ON invoice.id = vendor.id

WHERE order_invoice > 1

ORDER BY number_of_invoices DESC

Explanation:

The select statement of the SQL or structured query language returns twelve rows of four columns from the inner join of the vendor and invoice table in a database where the order_invoice column in the invoice table is greater than one. The result of the query is ordered by the alias column "number_of_invoices" in descending order.

8 0
2 years ago
What are parts of the prewriting process
Rainbow [258]
The prewriting process should include brainstorming a topic, deciding on which topic on which to write, research of a topic, organizing the research into a comprehensive whole. Check out an APA style textbook, should be available at the library, and it should have more results in the prewriting process. Of course, the writing process itself depends on the individual and his or her cognitive process on writing.

6 0
3 years ago
Read 2 more answers
Consider the following methods.public void modParams(int[] x, int[] y, String[] s){x[1] = 5;y = x;s[1] = new String("five");s =
skad [1K]
I am not too happy to be a good man in my world but he is made me very very much and he is made me very very much and he is very much very good to him very much and he is very much very good to you very good and very much to be able for my kids with a little more money will not go back and you can do the greatest if he can be very much and you have no problem and then we do all the way that we are not the right answer but you have a question to do and you don’t have the right right answer the answer right back and he will not be very good I am very good and he is very very bad
5 0
3 years ago
Other questions:
  • The ______ identifies the path for the currently open folder
    8·2 answers
  • Which best describes what online reading tools aim to help readers do? *100 POINTS*
    9·2 answers
  • You have a web application hosted in AWS cloud where the application logs are sent to Amazon CloudWatch. Lately, the web applica
    7·1 answer
  • 16. Which of the following wire gage sizes is the thickest? A. 14 B. 8 C. 0 D. -33
    14·1 answer
  • The World Wide Web is full of unstructured data. Search engines like Google, Bing and Yahoo have been doing a good job of allowi
    5·1 answer
  • Where do you place the logical test argument in an JF function formula?
    5·2 answers
  • HELP AASAP BRAINLIEST JUST HELP
    13·1 answer
  • What is the best motivation that you can do/give to make your employees stay? ​
    6·1 answer
  • How do you give people a brianly i am knew as u can tell
    6·2 answers
  • Which element of the MakeCode Arcade interface represents an individual
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!