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
hram777 [196]
3 years ago
11

Create the setStyles() function using the commands listed in the steps below. Christine wants one of five fancy style sheets to

be randomly used when the page is opened. Declare the styleNum variable equal to the value returned by the randInt() function, using 5 as the parameter value.
Computers and Technology
1 answer:
jolli1 [7]3 years ago
3 0

Answer:

Hi there! This can be implemented in a simple Python function which uses the "random" module to generate the number.

Explanation:

Using Python as the languge, we can write a the below code in a file called styles.py. The first line imports the randint function from the "random" module. The setStyles() function declares an array or 5 elements (here I have just used numbers but these could be string names of the stylesheets as well). Next, styleNum is assigned the random number and the associated stylesheet is selected from the array of stylesheets.

styles.py

from random import randint

def setStyles():

   stylesheets = [1,2,3,4,5];

   styleNum = randint(1,5);

   stylesheet = stylesheets[styleNum];

   print(stylesheet);

setStyles();

You might be interested in
Which part of the ethernet address is assigned to vendors to identify the equipment?
Nitella [24]

First three bytes of the ethernet address exists assigned to vendors to identify the equipment.

<h3>What is Ethernet address?</h3>

A media access control address stands for a unique identifier allocated to a network interface controller for usage as a network address in communications within a network segment. This use exists as standard in most IEEE 802 networking technologies, including Ethernet, Wi-Fi, and Bluetooth.

This address exists as the identifying mark that allows a networked computer to communicate with the Internet. The ethernet address exists how we can associate an “IP address” to an individual computer — without this– number, there's no form to access any servers, websites, email, etc.

The first three bytes (pairs of hexadecimal characters) of any unicast address include that vendor address component of the MAC address. The staying three bytes carry the serial number of that vendor's interface card. Dell, Inc. Apple, Inc.

Hence, first three bytes of the ethernet address exists assigned to vendors to identify the equipment.

To learn more about Ethernet address refer to:

brainly.com/question/7284219

#SPJ4

4 0
1 year ago
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
The difference between the centerline of a vehicle and the line perpendicular to the rear wheels is called what?
snow_lady [41]
The thrust angle is an imaginary line drawn perpendicular to the rear axle's centerline. It compares the direction that the rear axle is aimed with the centerline of the vehicle. It also confirms if the rear axle is parallel to its front axle and that the wheelbase on both sides of the vehicle is the same.
7 0
3 years ago
You are designing an internet router that will need to save it's settings between reboots. Which type of memory should be used t
Phoenix [80]

Answer:

d. Flash

Explanation:

A flash memory can be defined as an electronic non-volatile memory chip (storage medium) that is typically used on computer systems and other digital devices such as routers, USB flash drives, switches, digital cameras, mp3 players etc. A flash memory is an electronically erasable programmable read only memory (EEPROM) and as such data saved (written) on it can be erased electronically. Also, a flash memory do not require a source of power (electricity) to save or retain data through the use of a floating gate MOSFET (FGMOS) or floating gate transistor.

In this scenario, you are designing an internet router that will need to save it's settings between reboots. The type of memory that should be used to save these settings is a flash memory because it does not require power to write or save data.

8 0
3 years ago
The second version of css, css2, was introduced in 1998, expanding the language to provide styles to _________.
Evgen [1.6K]

Answer:

Structured Documents

Explanation:

Structured Documents consist of hierarchy in the files. They may include data files. HTML (Hyper-text markup language) documents and XML (Extensible Markup Language) applications are the examples of Structured Documents.

6 0
3 years ago
Other questions:
  • According to the appendix what was the purpose of newspeak
    12·1 answer
  • A looping construct that continues to repeat until the expression becomes false is
    5·2 answers
  • A(n) monitoring vulnerability scanner is one that listens in on the network and determines vulnerable versions of both server an
    7·1 answer
  • The three tasks within data harmonization, namely: data consolidation, data cleansing, and data formatting use techniques called
    8·1 answer
  • PLEASE HELP !!!! WILL UPVOTE
    5·2 answers
  • Translate each statement into a logical expression. Then negate the expression by adding a negation operation to the beginning o
    15·1 answer
  • Steps in the systems development life cycle​
    15·2 answers
  • Only one person can receive the same email at the same time true or false
    10·1 answer
  • 8.
    9·1 answer
  • What is the name of the method generated when you double-click a button named btnprocess in the form designer?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!