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
pashok25 [27]
3 years ago
12

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:
Alex73 [517]3 years ago
4 0

Answer:

Written in Java

import javax.swing.JOptionPane;

public class Decision{

public static void main(String[] args) {

    int i = 1;

    while(i<=5){

    String score = JOptionPane.showInputDialog("Input <score>");

    int mark = Integer.parseInt(firstNumber);

    if(mark >= 50 && mark <= 100) {

        JOptionPane.showMessageDialog(null, mark, " is a pass", JOptionPane.PLAIN_MESSAGE);

    }

    else{

        JOptionPane.showMessageDialog(null, mark, " is a fail", JOptionPane.PLAIN_MESSAGE);

    }

    i++;

    }

}

}

Explanation:

This initializes the a counter variable i to 1

    int i = 1;

The following iteration is repeated as long as i is less than or equal to 5

    while(i<=5){

This prompts user for input

    String score = JOptionPane.showInputDialog("Input <score>");

This converts user input to integer

    int mark = Integer.parseInt(firstNumber);

This checks if input is within 50 and 100 (inclusive)

    if(mark >= 50 && mark <= 100) {

This prints pass

        JOptionPane.showMessageDialog(null, mark, " is a pass", JOptionPane.PLAIN_MESSAGE);

    }

If otherwise

    else{

This prints fail

        JOptionPane.showMessageDialog(null, mark, " is a fail", JOptionPane.PLAIN_MESSAGE);

    }

This increments the counter variable by 1

    i++;

    }

You might be interested in
In which situation is coauthoring of presentations primarily utilized?
fenix001 [56]

Answer:

C) Multiple reviewers have to be able to view one another's changes after they are made.

Explanation:

5 0
3 years ago
Google Docs, MS Word, Google Slides, MS PowerPoint, Google Sheets, MS Excel In your opinion which software in each category is e
podryga [215]

Answer:

I my opinion Google software is easier to use.

Explanation:

It is more upgraded and it's basically like kind of the latest version of Microsoft Software

This is just my opinion, I use Google Applications for every single thing in  my life

7 0
3 years ago
Read 2 more answers
दूलह श्री रघुनाथ बने दुलही सिय सुंदर मंदिर माहीं।
svetlana [45]

Answer:

The bridegroom Shri Raghunath, Gavati Geet Sabai Mili Sundar Bed Juwa Jury Vipra Padhahin, Janaki, and Kankan.

Explanation:

8 0
3 years ago
In the digital signature technique when the whole message is signed using an asymmetric key, the sender of the message uses ____
rodikova [14]

In the digital signature technique when the whole message is signed using an asymmetric key, the sender of the message uses his or her own private key to sign the message.

8 0
2 years ago
________ takes place when a firm contracts custom software development or maintenance of existing legacy programs to outside fir
inessss [21]

Answer:

outsourcing

Explanation:

<u>outsourcing</u> takes place when a firm contracts custom software development or maintenance of existing legacy programs to outside firms. Utility computing Computerization of IT Cloud computing Outsourcing On-demand computing

6 0
3 years ago
Other questions:
  • You are a network technician for a small corporate network. Today you moved an unused workstation to the IT Administration offic
    12·1 answer
  • What is the full meaning of ICT
    14·2 answers
  • Inherent flaws in system software code are called:
    7·1 answer
  • An ARP broadcast is sent to the special MAC address _______.
    9·1 answer
  • Which steps can you use to open the Reveal Formatting pane?
    5·2 answers
  • It is advised to always have discretion with leaders. Explain in general terms what information security policies can and cannot
    12·1 answer
  • A printer is displaying no images on its LED panel. What can a technician do to troubleshoot the situation? Choose two answers.
    6·1 answer
  • The part of the computer that contains the brain, or central processing unit, is also known as
    5·1 answer
  • Select all steps in the list below that should be completed when using the problem-solving process discussed in this chapter.
    14·1 answer
  • To use Aggregate functions on subgroups within the total result set, place the Aggregate function in the Select clause and add t
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!