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
Ostrovityanka [42]
2 years ago
10

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?
A. A "for" loop inside of a "while" loop
B. A "while" loop inside of a "for" loop
C. None of the above
D. Either a or b would work
Computers and Technology
1 answer:
OLEGan [10]2 years ago
5 0

Answer:

B. A "while" loop inside of a "for" loop

Explanation:

To enter 5 grade values, a for loop can be used to specify the number of grade values to be entered by the user, in other to ensure the validity of the grade values entered by the user, the while loop will be used inside the for loop such that the inputted values will only be accepted when the user enters a valid grade.

Code structure :

For a in range(0, 5) :

grade = input()

while grade (enter condition)

This is just the code structure and this will work for the problem stated.

You might be interested in
Why will the standard replacement algorithms (LRU, FIFO, clock) not be effective in handling this workload for a page allocation
dusya [7]

Answer:

These algorithm keeps an eye on which page was used when. LRU assumes that the page that was recently used has more probability  

of being used or requested by the user. Thus, it keeps the pages that were recently used, when a new page is requested. If page  

fault occurs, the requested page is fetched and it replaces the page in cache which was last referenced earlier than any other page  

in the cache (or frame).The LRU associates a time with each page in the memory and the ones with the greatest value are replaced.  

It does not suffer from Belady’s anomaly. The page fault will be referred when 512 page frame are reached. This is the total length of the complete sequence.

FIFO replaces pages that come in cache firstly. FIFO stands for First in first out.  

(b) The FIFO replacement algorithm replaces the page which was first brought into the memory followed by the next and soon.  

This algorithm suffers from Belady’s anomaly. In First In First out (FIFO) page replacement scheme of page replacement, the requests  

are executed as they are received. When a new request is made of a page which is not available in the existing frames, then the requested  

page is acquired from the memory. The page in the first frame is replaced by the requested page. If again a request is made of a page not  

yet available in the frames, it is fetched from the memory and it replaces the second frame's page, and so on.  

There are total 500 frames given. The alternative approach which is better than clock algorithm, FIFO, and LRU is that the pages  

from 0 to 498 are set to the fixed frames. Thus, 499 frames are fixed and only one frame can vary.

Explanation:

6 0
2 years ago
Plane eyes I don't know
FrozenT [24]
IFLY is probably what it was.
3 0
3 years ago
While troubleshooting a network connection problem for a coworker, you discover the computer is querying a nonexistent DNS serve
tatuchka [14]

Answer:

nslookup ifconfig.

Explanation:

The nslookup is used a number of times by network admins to troubleshoot DNS related problems. In addition, this command finds IP addresses and name servers of hosts. This utility command queries the DNS database tables from every host in a network. It then determines the host name and issues an IP. It sort of converts your domain name into an IP addresses. This command combined with ifconfig finds the correct DNS servers and assigns the correct DNS server IP.

6 0
3 years ago
The Brinley website will not let me search for questions anymore. It says “Search all you want in-app” and then covers the quest
ira [324]

Answer: U can answer a few questions of other people’s questions then the question that was covered it unlocks after answering some questions and u will be able to see it or u could get the app too and it doesn’t block at all

Explanation:

4 0
2 years ago
Plz..... Add the following Binary numbers 1. 111000 + 1100 + 111111​
Korvikt [17]

Answer:

11000011

Explanation:

This is because of the rules of bas 2

3 0
2 years ago
Other questions:
  • Respond to the following in a paragraph of no less than 125 words. What is the purpose of netiquette guidelines?
    10·1 answer
  • The last 64 bits of an ipv6 address are the interface identifier. what is frequently used to specify the interface identifier?
    14·1 answer
  • Write an expression that evaluates to true if and only if the value of the integer variable workedOvertime is true.
    7·1 answer
  • How can you tell that a website is valid and reliable
    7·2 answers
  • Print a countdown from n to 1 The function below takes one parameter: an integer (begin). Complete the function so that it print
    8·1 answer
  • What is the importance of eliminating marks that classify a master key
    7·1 answer
  • Write an algorithm to show whether a given number is even or odd.
    14·1 answer
  • What is Data rate?<br> What is BAUD RATE?<br> What is bandwidth?
    8·1 answer
  • 6. kinukuha nito ang kabuuang bilang ng mga numerical na datos sa mga piniling cells
    12·1 answer
  • When an EC2 instance is being modified to have more RAM, is this considered Scaling Up or Scaling Out?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!