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
kondor19780726 [428]
3 years ago
12

imagine that you wanted to write a program that asks the user to enter in 5 grade values. the user may or may not enter valid gr

ades, and you want to ensure that you obtain 5 valid values from the user. which nested loop structure would you use?
Computers and Technology
1 answer:
Aloiza [94]3 years ago
7 0

In a computer program, loops are used to perform repetitive operations until a condition is met.

The nested loop structure to use in this case is: <em>A "while" loop inside of a "for" loop</em>

<u>The outer loop</u>

First, you must iterate through each student.

This can be done using a for loop or a while loop.

However, it is faster to implement this kind of iteration on a for loop, than a while loop

So, the algorithm of the outer loop would look like the following:

<em>for student = 1 to 5 step 1</em>

<em />

<u />

<u>The inner loop</u>

Next, you must get input for the 5 grades for each student

After getting input for the grade of each student, a loop would be used to test if the input is valid.

The loop would be repeated until the user enters a valid input.

This can only be done using a while loop.

So, the algorithm of the inner loop would look like the following:

<em>input grade</em>

<em>while grade is invalid:</em>

<em>     input grade</em>

<em />

<em />

<em />

Hence, the nested loop structure to use is:

<em>A "while" loop inside of a "for" loop</em>

<em />

<em />

Read more about loops at:

brainly.com/question/11608024

You might be interested in
Define a class in Java to accept and store the list of 10 names in an array. Print the
dem82 [27]

Answer:

public class Main

{

public static void main(String[] args) {

String[] strs = new String[10];

java.util.Scanner sc = new java.util.Scanner(System.in);

    for(int i = 0; i < 10; i++){

        System.out.print("Enter string " + (i+1) + ":");

        strs[i] = sc.nextLine();

    }

    System.out.println("The strigs with even number of characters is");

    for(int i = 0; i < strs.length;i++){

        if(strs[i].length() % 2 == 0){

            System.out.println(strs[i]);

        }

    }

}

}

Explanation:

8 0
2 years ago
A married man gets a new job in a company. After three months, he meets a younger woman in the finance department and they begin
pav-90 [236]

Answer:

False ( B )

Explanation:

Of  the seven IT  infrastructure domains The USER domain was not at risk because the User Domain is not task with handling the sharing of data or Mutual communication between users in a Typical IT infrastructure.

The domain charged with such responsibility is The LAN domain because the LAN domain is charged with the sharing of information between the USERS and maintaining good mutual communication, and since the relationship has become sour, the sharing of information between the users will suffer the most and it will be at a high risk

5 0
3 years ago
Which are two common methods a laptop uses to get an Internet connection over a cellular network?
Vikentia [17]
Wi-Fi or Tethering.
8 0
3 years ago
Which network type allows a vnic to access a network directly using the host machine's nic?
siniylev [52]
The answer is <span>​Bridge mode.  It is the </span>network type that allows a vnic to access a network directly using the host machine's nic.  <span>In Wi-Fi networking, </span>bridge mode<span> allows two or more wireless access points to communicate and join their respective local networks. </span>
3 0
3 years ago
Software referd to the physical parts of the computer True or False
ikadub [295]

Answer:

False

Explanation:

Software refers to the programs that run on the computer. Hardware refers to the physical part making up the computer.

8 0
4 years ago
Read 2 more answers
Other questions:
  • What type of selection can be used in leu of switch/case?
    13·2 answers
  • For this lab, youhave to write a programnamedseriesFunction.cthat prompts user to enter two values, x and n. Then it would use a
    11·1 answer
  • In which of the following situations will a macro make your work more efficient?
    7·1 answer
  • How much memory will be occupied by black and white image​
    8·2 answers
  • Signals that can travel in only one direction on a medium are referred to as what type of signal?
    12·1 answer
  • How long does it take to go 80 miles if you are going 80 mph?
    8·2 answers
  • What key do I use to start my presentation
    9·1 answer
  • An organization is conducting a study to see if hazardous waste sites pose health risks for cancer or other conditions, such as
    12·1 answer
  • What happens to the files and folders on the desktop when the computer is turn off
    7·1 answer
  • When network traffic is encrypted, it is invisible and its content and purpose are masked.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!