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
Phantasy [73]
3 years ago
15

A example of an "ITERATIVE STATMENT"

Computers and Technology
1 answer:
timama [110]3 years ago
7 0

Answer:

for(let i = 0: i <=5; i++) {

console.log(I)

}

Explanation:

An iterative statement repeats a body of code until the condition is not true. Here we declare an integer (i) and make it 0. Then the loop checks if the second part is true (i is less than or equal to 5), and if it is true, it executes the code inside the loop body, which logs i, and finally runs the last past, which increments i by one. When the second part becomes false, the loop exits.

You might be interested in
Give your own example of a nested conditional that can be modified to become a single conditional, and show the equivalent singl
victus00 [196]

Answer:

following are the program to the given question:

Program:

x = 0#defining an integer variable that holds a value

if x < 0:#defining if that checks x less than 0

   print("This number ",  x, " is negative.")#print value with the message

else:#defining else block

   if x > 0:#defining if that checks x value greater than 0

       print(x, " is positive")#print value with message

   else:#defining else block

       print(x, " is 0")#print value with message

if x < 0:#defining another if that checks x less than 0

   print("This number ",  x, " is negative.")

elif (x > 0):#defining elif block that check x value greater than 0

   print(x, " is positive")#print value with message

else:#defining else block

   print(x, " is 0")#print value with message

Output:

Please find the attachment file.

Explanation:

In this code, an x variable is defined which holds a value that is "0", in the next step nested conditional statement has used that checks the x variable value and uses the print method that compares the value and prints its value with the message.

In another conditional statement, it uses if that checks x value less than 0 and print value with the negative message.

In the elif block, it checks x value that is greater than 0 and prints the value with the positive message, and in the else block it will print the message that is 0.

3 0
3 years ago
A_________ formal access control methodology used to assign a level of confidentiality to an information asset and thus restrict
Illusion [34]

Answer:

1. Data classification scheme

Explanation:

<h2><u>Choose an answer from the options. </u></h2>

A<u> data classification scheme</u> formal access control methodology used to assign a level of confidentiality to an information asset and thus restrict the number of people who can access it

6 0
4 years ago
For the following questions, consider a paged memory system that has a physical main memory size of 32KB (215) and a page frame
dlinn [17]

Complete Question

For the following questions, consider a paged memory system that has a physical main memory size of 32KB (215) and a page frame size of 8KB (213). Consider a process P whose logical address space is 64KB (216). Important Note: If an answer requires an exponent, use the ^ character. For example: 216 would be entered as 2^16.

Question 1: How many physical page frames are there in the above paged memory system? ________(Your answer should be in exponential form)

How many bits are needed to represent a physical page frame number in the system? ____________

Question 2: How many logical pages are there for P? _____________(Your answer should be in exponential form. )

How many bits are needed to represent a logical page number for P? _____________

Answer:

1a) The number of physical page frames in the  paged memory system = 2⁵

1b) The number of bits that can be used to represent the physical page frame = 5 bits

2a) Number of logical pages = 2³

2b) Number of logical frame bits = 3 bits

Explanation:

Size of physical main memory = 32 kB = 2¹⁵

Space for Logical address = 64 KB = 2¹⁶

Page frame size = 8 KB = 2¹³

1a) The number of physical page frames in the  paged memory system

Number of page frames = physical main memory size / page frame size

 Number of page frames  = 2¹⁵ / 2¹³

Number of page frames = 2⁵

1b)The number of bits that can be used to represent the physical page frame

physical memory size = log2(2²⁰) = 20 bits.

Offset bits = log2(2¹⁵)  = 15 bits

Frame bits = physical memory size – offset bits

Frame bits = 20 – 15

Frame bits = 5 bits

2a)  Number of logical pages = logical address space / page frame size

Number of logical pages = 2¹⁶/2¹³

Number of logical pages = 2³

2b) Logical address space = log2(2¹⁶) = 16 bits

Offset bits = log2(2¹³)

Offset bits = 13 bits

Frame bits = logical address space bits – offset bits

Frame bits   = 16 – 13

Frame bits  = 3 bits

7 0
3 years ago
You have implemented a network where hosts are assigned specific roles, such as for file sharing and printing. Other hosts acces
yulyashka [42]

<u>Client-server</u> implemented a network where hosts are assigned specific roles, such as for file sharing and printing. Other hosts access those resources but do not host services of their own.

<u>Explanation:</u>

The client-server can be utilized on the web just as on a neighborhood (LAN). Instances of customer server frameworks on the web incorporate internet browsers and web servers, FTP customers and servers, and the DNS. Different hosts get to those assets yet don't have administrations of their own. Since it permits arrange permits numerous PCs/gadgets to interface with each other and offer assets.

5 0
4 years ago
Write a program with total change amount in pennies as an integer input, and output the change using the fewest coins, one coin
Serjik [45]

Answer:

Here is the Python program:

def FewestCoinVals():  # function to output change using fewest coins

 total_change = int(input('Enter change amount in pennies: '))

#prompts user to enter total change amount in pennies

 if total_change <= 0:  # if value of total_change is less or equal to 0

   print('no change')  # prints no change

 else:  # if value of total_change is greater than 0

   dollars = total_change // 100  

#calculate value of dollars by dividing total_change by 100

   total_change %= 100   #take mod of value of total_change with 100

#calculate value of quarters by dividing total_change by 100

   quarters = total_change // 25

   total_change %= 25  #take mod of value of total_change with 25

#calculate value of dimes by dividing total_change by 100

   dimes = total_change // 10  

   total_change %= 10  #take mod of value of total_change with 10

#calculate value of nickels by dividing total_change by 100

   nickels = total_change // 5

   total_change %= 5  #take mod of value of total_change with 5

   pennies = total_change  

#value of pennies is equal to value of total_change

#the if elif statement checks for the singular and plural coin names

   if dollars >1:

       print('dollars: ',dollars)

   elif dollars ==1:

       print('dollar: ',dollars)

   if quarters > 1:

       print('quarters: ',quarters)

   elif quarters ==1:

       print('quarter: ',quarters)

   if dimes >1:

       print('dimes: ',dimes)

   elif dimes ==1:

       print('dime: ',dimes)

   if nickels >1:

       print('nickels: ',nickels)

   elif nickels ==1:

       print('nickel: ',nickels)

   if pennies >1:

       print('pennies: ',pennies)

   elif pennies ==1:

       print('penny: ',pennies)

#calls the FewestCoinVals() function        

FewestCoinVals()

                     

Explanation:

The program prompts the user to enter change amount in pennies and has int() function to convert input value to integer.  If the value entered is less than or equal to 0 it displays message "no change", otherwise it converts the value using fewest coins. The formulas for converting to each type is given in the code. It uses if and elif statements to check if the final value of total_change has singular or plural coin names such as penny or pennies. The program along with output is attached as the screen shot.

3 0
3 years ago
Other questions:
  • Given positive integer numInsects, write a while loop that prints that number doubled without reaching 200. Follow each number w
    8·1 answer
  • What happens when a Boolean expression is evaluated?
    7·1 answer
  • The Boffo Balloon Company makes helium balloons. Large balloons cost $13.00 a dozen, medium-sized balloons cost $11.00 a dozen,
    13·1 answer
  • Cecelia would like to write an app to help manage a trip to the grocery store. The app will maintain a shopping list (a list of
    7·1 answer
  • What are MS Word's default tabs?
    5·2 answers
  • How do I upload a picture in python 3
    7·1 answer
  • 1st row has 3 possible answers software program, web page, and web browser
    8·1 answer
  • Because floating points have decimals, they're more precise and take up more memory than integers.
    6·1 answer
  • Any device that uses light to read and write information.
    9·2 answers
  • Write a C# program that prints the number of quarters, dimes, nickels, and pennies that a customer should get back as change. De
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!