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
olganol [36]
1 year ago
3

Write a Java program called Decision that includes a while loop to prompt the user to enter 5 marks using the

Computers and Technology
1 answer:
OLga [1]1 year ago
7 0

Following is the decision program for a while loop

import java.util.Scanner;

class DecisionLoop {

public static void main(String[] args) {

  int n;

  Scanner input = new Scanner(System.in);

  System.out.println("Input an integer");

  while ((n = input.nextInt()) >= 50 && <=100) {

    System.out.println("You have entered " + n);

    System.out.println("You are passed");

  }

  System.out.println("its a fail");

}

}

What is a loop?

A "While" Loop is used to repeat a specific block of code an unknown number of times until a condition is met. For example, if we want to ask a user for a number between 1 and 10, we don't know how many times the user may enter a larger number, so we keep asking "while the number is not between 1 and 10."

A while loop is a loop that iterates through the code specified in its body, also known as a while statement until a predetermined condition is met. The loop ends if or when the condition is no longer met.

Hence to conclude the while loop is the one which is used with along the for

To know more on loops follow this link

brainly.com/question/15086216

#SPJ1

Explore all similar ans

You might be interested in
A .jpg file is an example of which of the following file types
egoroff_w [7]
A .jpg file is going to be a picture. =)
5 0
3 years ago
Read 2 more answers
A(n application system is the master controller for all the activities that take place within a computer system. _______________
Elenna [48]
The answer is b.false
3 0
3 years ago
A soft news story and a feature story are the same thing.<br> O True<br> O False<br> HELLPP ASSAAAP
bogdanovich [222]
The answer would be False!
5 0
3 years ago
Read 2 more answers
A structure is private by default, but can be declared to be friend or private.
posledela
Structures can be accessed from anywhere within the module or class in which they are declared. A structure is Friend by default. To specify the accessibility in more detail, include Public, Protected, Friend, Protected Friend, or Private in the Structure statement. You must declare every data member of a structure.
4 0
3 years ago
Why does dns use udp instead of tcp? if a dns packet is lost, there is no automatic recovery. what are the consequences?
inysia [295]
<span>If a DNS packet using UDP is lost this problem must be handled at the application layer. If an answer is not received after some period of time the specific application may choose to resend the DNS query. I can go much more into detail but this should answer your question. If you need more detail just ask.</span>
6 0
3 years ago
Other questions:
  • What will be displayed after the following statements have been executed? int x = 15, y = 26, z = 32; x = x + 12; y = y/6; z -=
    15·1 answer
  • What operating system uses Fastboot?
    10·2 answers
  • Question: when using a line graph, why is it important to only graph 1-3 series of data?
    8·1 answer
  • Write the proghrams for the following:
    13·1 answer
  • The declaration of variables begins with a command a. dim b. rem c. const​
    8·1 answer
  • Find the smallest value of n such that LCM of n is 15 is 45​
    5·1 answer
  • What menu and grouping commands is the "SORT" tool? ( please answering meeeee)
    9·1 answer
  • 1 #include 2 3 int max2(int x, int y) { 4 int result = y; 5 if (x &gt; y) { 6 result = x; 7 } 8 return result; 9 } 10 11 int max
    12·1 answer
  • Which of the following processes demonstrates that matter is made up of minute particles? (A) Difussion (B) Capillarity (C) Dist
    15·1 answer
  • 2. Define a function squareArea that computes the area of a square given side length
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!