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
uysha [10]
2 years ago
15

Write a program that fills a list with 100 random numbers between 0 and 200, inclusive. Traverse through the list and only print

out the numbers that are less than 99. You can develop this code in App Lab if you like and copy your final program to the answer area below. Keep the code neat and use curly braces where necessary. This question is worth 4 points. *
Computers and Technology
1 answer:
svet-max [94.6K]2 years ago
7 0

Answer:

Follows are the code to this question:

import random as ra#import package  

r=[ra.randint(0, 200) for x in range(100)]#defining a variable r that use rand method to add value in list  

j= [i for i in r if i < 99]#defining j variable that checks list value is less than 99

print (j)#print list value

Output:

[20, 23, 66, 47, 89, 7, 18, 13, 92, 31, 23, 60, 3, 52, 18, 20, 85, 64, 55, 98, 14, 80, 80, 14, 57, 92, 76, 14, 91, 83, 87, 80, 16, 50, 7, 88, 19, 4, 72, 23, 27, 79, 23]

Explanation:

In this code, package random is imported, in the next step, the r variable is declared, that uses the randit method, and use for loop that adds value in the list. In the next step, the j variable is declared, which uses a for loop and a conditional statement to check its value is less than 99, add print its value.

You might be interested in
Selective colleges choose to have in-person meetings to learn more about the applicants. These meetings are called:
lubasha [3.4K]
The meeting is called collage interviews
4 0
3 years ago
Read 2 more answers
Write a loop that reads c-strings from standard input where the c-string is either "land", "air", or "water". The loop terminate
Anvisha [2.4K]

Answer:

I am writing a C++ code.        

#include <iostream> // for input output functions

using namespace std; // identifies objects like cin cout

int main() { //start of main() function body

string c_string; // stores the string entered by user from land water or air

int land=0; // contains the number of times land string is read in

int air=0; //contains the number of times air string is read in

int water = 0; //contains the number of times water string is read in

cin>>c_string; //reads the string entered by user from air water or land

/*while loop continues to execute until user enters xxxxx or maximum length of a string exceeds 8 */

while(c_string!= "xxxxx" && c_string.length()<=8) {

if(c_string=="land"){ // if string entered by user is land

land = land + 1;} //counts and increments each occurrence of land string by 1

else if(c_string=="air"){// if string entered by user is air

air = air + 1;}// counts and increments each occurrence of string air by 1

else if(c_string=="water"){// if string entered by user is water

water = water + 1;}//counts and increments each occurrence of air by 1

cin>>c_string;}

/* keeps reading the string entered by user from land air or water, until the loop breaks after the user enters xxxxx or user enters a string whose length is greater than 8 */

//prints the number of times land, air and water are read in

cout << "land:"<<land;

cout << endl<<"air:"<<air;

cout << endl<< "water:"<<water; }                      

                                                                                     

Explanation:

Everything is well explained in the comments above.

The program prompts the user to input strings. These strings are either land air or water. The while loop continues to read the input strings until user enters xxxxx or the string entered by user exceeds the length 8. Both these terminating conditions are added in the while loop. After the loop terminates, the number of times land, air and water strings are read is displayed on the output screen. Any other string entered by user other than these 3 is ignored. The program along with the output is attached.

3 0
3 years ago
In the web form you are creating, you want a multiple-option select list to appear with five options. which line of html code wi
suter [353]
You will use a <select> for this. For example:

<select name="choice">
  <option>First</option>
  <option>Second</option>
  <option>Third</option>
  <option>Fourth</option>
  <option>Fifth</option>
</select>
5 0
3 years ago
TVBCA has just occupied an old historic building in downtown Pittsburgh in which 15 employees will work.
7nadin3 [17]

Answer:

A. The proposed solution delivers the required result and both optional desired results.

Explanation:

The IEEE 802.11a is the standard code of the wireless communication technology known as WIFI, it is wireless as it requires no cable to connect to a network device. The data transmission rate of the IEEE 802.11a is 1.5 - 54Mbps (mega bit per second). So, the employees in the TVBCA building can wireless connect to the network, which allows them to be mobile and they can also send large CAD files among themselves.

6 0
3 years ago
Using the ____ browsing mode offered by some browsers can prevent personal information from being left on a public computer.
seraphim [82]
The answer is incognito browsing
4 0
3 years ago
Other questions:
  • 1. How does inertia affect a person who is not wearing a seatbelt during a collision? 
    14·2 answers
  • You have been asked to delete some data from medisoft but find that there is no delete button. what is another method you can us
    10·1 answer
  • What is the output of the second println statement in the main method, public class foo { int i ; static int s ; public sttic vo
    15·1 answer
  • What can provides access to the only menu in office 2007​
    13·1 answer
  • Difrent between computer and computer system​
    9·1 answer
  • when working with smart which tab would provide the ability to change the shape or size of the smart art shapes
    15·2 answers
  • Help Me<br><br> What are the four types of graphic models?
    10·1 answer
  • What is a closed system?​
    7·1 answer
  • How to tell if your phone is being monitored
    12·1 answer
  • What feature preserves your open apps and data, but allows another user to log in to his or her own session of the same computer
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!