answer.
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
MaRussiya [10]
1 year ago
14

A company is performing an analysis on the computers at its main office. The computers are spaced along a single row. The analys

is is performed in the following way: 1. Choose a contiguous segment of a certain number of computers, starting from the beginning of the row. 2. Analyze the available hard disk space on each of the computers. 3. Determine the minimum available disk space within this segment.
Computers and Technology
1 answer:
harina [27]1 year ago
5 0

Answer:

array = input("Enter the list of computer memory: ").split(',')

int_arr = [int(x) for x in array]

segment = int(input("Enter the length of segment to analyze: "))

list_len = len(int_arr)

segList = []

mini = []

for x,i in enumerate(int_arr):

   seg = int_arr[i-1:segment+i-1]

   if len(seg) == segment:

       segList.append(seg)

for x in segList:

   mini.append(min(x))

result = mini.index(min(mini))

print("Segment with the minimum memory is: ",segList[result])

Explanation:

The python program prints out the segment after analysis, with the smallest disk memory space. The code gets the array of computer rows from the user input and segments the array with the number of segment input, then the minimum is compared for all segments in the network.

You might be interested in
The flagging of an uncommon last name as a spelling error can be stopped by opening the shortcut menu on the first occurrence of
Mice21 [21]

Solution:

The flagging of an uncommon last name as a spelling error can be stopped by opening the shortcut menu on the first occurrence of the name and selecting of ignoring all.

Thus the required right answer is B.

8 0
2 years ago
In the middle of the iteration, how should a team handle requirement changes from the customer? (1 correct answer)
Rina8888 [55]

The answer is 1 because it is

5 0
2 years ago
Read 2 more answers
Program 4 - Pick color Class Create a class that randomly pick a color from an array of colors: string colors[7]; Have the color
xxMikexx [17]

Answer:

#include<cstdlib>

#include<bits/stdc++.h>

#include<time.h>

using namespace std;

class Colors{

string colors[7];

public:

void setElement(int,string);

void printAllColors();

void printRandomColor();

};

void Colors::setElement(int index,string color){

colors[index] = color;

}

void Colors::printAllColors(){

cout << "Printing all the colors:\n";

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

cout << colors[i] <<"\t";

}

}

void Colors::printRandomColor(){

srand (time(NULL));

int index = rand() % 7;

cout<< "\n\nThe random picked color:";

cout << colors[index] << endl;

}

int main(){

Colors color;

color.setElement(0,"red");

color.setElement(1,"orange");

color.setElement(2,"yellow");

color.setElement(3,"green");

color.setElement(4,"blue");

color.setElement(5,"indigo");

color.setElement(6,"violet");

color.printAllColors();

color.printRandomColor();

}

to get the random color we are using srand and rand function. we are using time as seed to srand() function,because every time the time is changed. And based on that we are using rand() function and doing mod with 7 with the random number to get the index between 0 to 6, as ut array size is 7(0 to 6).

In the setElement(int index,string color) method we are inserting the value of colors in the colors array based on index.

In the printAllColors() function we are printing all the colors in the array.

In the printRandomColor() er are printing any random color based on rand() function.

and in main() we are initializing the string array with colors and calling the functions.

7 0
1 year ago
Read 2 more answers
Create a class named Billing that includes four overloaded computeBill() methods for a photo book store. • When computeBill() re
Karo-lina-s [1.5K]

Answer:

The Java code is given below with appropriate comments

Explanation:

<u>Billing.java </u>

//This is a BIlling class

public class Billing {

//Default constructor

public Billing()

{

}

//computeBill() method of having one parameter

public double computeBill(double price)

{

  return price+0.85*price;

}

//computeBill() method of having two parameter

public double computeBill(double price,int quantity)

{

  return price*quantity+0.85*price*quantity;

}

//computeBill() method of having three parameter

public double computeBill(double price,int quantity,double couponValue)

{

  return price*quantity+0.85*price*quantity-couponValue;

}

//computeBill() method of having four parameter

public double computeBill(double price,int quantity,double couponValue,double weeklyDiscount)

{

  return price*quantity+0.85*price*quantity-(couponValue+weeklyDiscount);

}

  public static void main(String[] args) {

     

  //Creating Billing Class Object

  Billing b=new Billing();

 

  //Displaying the cost of one book

System.out.println("Price of one Photo Book : $"+b.computeBill(45));

 

//Displaying the cost of 20 books

System.out.println("Price of 20 Photo Books : $"+b.computeBill(45,20));

 

//Displaying the cost of 20 books and having 50$ coupon

System.out.println("Price of 20 Photo Books and if we are having coupon value 50$ : $"+b.computeBill(45,20,50));

 

//Displaying the cost of 20 books, having 50$ coupon and 10$ discount

System.out.println("Price of 20 Photo Books ,if we are having coupon value 50$ and weekly discount of 10$: $"+b.computeBill(45,20,50,10));

 

  }

}

4 0
1 year ago
Write a function called st_dev. St_dev should have one #parameter, a filename. The file will contain one integer on #each line.
kodGreya [7K]

Answer:

  1. import statistics
  2. def st_dev(file_name):
  3.    with open(file_name) as file:
  4.        data = file.readlines()
  5.        numList = []
  6.        for x in data:
  7.            numList.append(int(x))
  8.        
  9.        return statistics.pstdev(numList)
  10. print(st_dev("text1.txt"))

Explanation:

The solution code is written using Python.

To ease the calculation task, we can import Python statistics module to use the pstdev method to calculate the population standard deviation of a list of numbers (Line 1).

Next, create a st_dev function that take single argument file_name (Line 3). In the function, it will open the input file and read the data line by line (Line 4-5). Create a for loop to traverse through each line of the data which is an integer and append it to numList (Line 7-8). We can pass the numList to pstdev method (Line 10) and return the resulting standard deviation value as output.

We test the function by passing a file which hold a list of integer values in each line (Line 12).

8

9

12

11

21

15

16

10

7

13

And the output we shall get is 4.019950248448356

6 0
2 years ago
Other questions:
  • A two-dimensional array can have elements of ________ data type(s).
    7·1 answer
  • When you examine a computer chip under a microscope, what will you see?
    6·1 answer
  • Monica needs to work on a document where she has to highlight topics in bold and add emphasis to some words in a paragraph using
    9·1 answer
  • Interactive sites where users write about personal topics and comment to a threaded discussion are called 
    15·1 answer
  • Which of the following is an Internet supervisory protocol? O DNS IP O both A and B O neither A nor B
    12·1 answer
  • 4.2.3: Basic while loop expression. Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Fol
    6·2 answers
  • One subtask in the game is to roll the dice. explain why is roll the dice an abstraction.
    5·1 answer
  • You are consulting for a trucking company that does a large amount ofbusiness shipping packages between New York and Boston. The
    5·1 answer
  • Write a client program that writes a struct with a privateFIFO name (call it FIFO_XXXX, where XXXX is the pid that you got from
    11·1 answer
  • A bicycle sharing company is developing a multi-tier architecture to track the location of its bicycles during peak operating ho
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!