Answer:
import csv
fileIn = open("data/bags.txt","r")
countPurse = 0
textFile= csv.reader(fileIn)
for bag in textFile:
if bag[
1
] == 'purse':
countPurse = countPurse + int(bag[6])
fileIn.close()
print("Number of purses:",countPurse)
Explanation:
I hope this helps!
Answer:
Microsoft Excel is a spreadsheet program. It provides a grid interface to organize the various information. You can use Excel to create and format workbooks in order to analyse the data. Specifically, you can use Excel to track data, build models for analysing data, write formulas to perform calculations on that data, pivot the data in various ways, and present data in a variety of professional looking charts. Excel is used widely in financial activity. It has the ability to create new spreadsheets where users can define custom formulas for the calculation. Excel is also used widely for common information organization and tracking like a list of sales leads, project status reports, contact lists, and invoicing. Excel is also useful tool for scientific and statistical analysis with large data sets.
Answer:
Windows XP uses the Local Page Replacement algorithm. It is a type of FIFO.
In this, Pages are taken from processes using more than their minimum working set and Processes initialize with a default of 50 pages.
XP monitors page fault rate and adjusts working set size accordingly.
UNIX uses the Global replacement Algorithm through Modified second-chance clock algorithm. Here Pages are aged with each second and Pages that are not used for a long time will eventually have a value of zero.
Answer:
Explanation:
The following is written in Java. It creates the function that takes in two int values to calculate the gcd. It includes step by step comments and prints the gcd value to the console.
public static void calculateGCD(int x, int y) {
//x and y are the numbers to find the GCF which is needed first
x = 12;
y = 8;
int gcd = 1;
//loop through from 1 to the smallest of both numbers
for(int i = 1; i <= x && i <= y; i++)
{
//returns true if both conditions are satisfied
if(x%i==0 && y%i==0)
//once we have both values as true we store i as the greatest common denominator
gcd = i;
}
//prints the gcd
System.out.printf("GCD of " + x + " and " + y + " is: " + gcd);
}
Answer:
Data that adds up to 100%
Explanation: