Answer:
The solution code is written in Python 3
1. output = ""
2. with open("text1.txt") as file:
3. data = file.readlines()
4.
5. for r in data:
6. output += r.upper()
7.
8. with open("text2.txt", "w") as file:
9. file.write(output)
Explanation:
Firstly, let's ready a variable output to hold the read data from the first text file (Line 1).
Next, use open function to create a file stream object and use its readlines() method to read all rows of data from text1 (Line 2 -3)
Next create a for loop to traverse through every row of the read data and use upper() function to change all characters in the current row to uppercase and append it to output variable.
Once the entire output string is ready, use open function again to create a file stream object but add "w" as second parameter of the open function (Line 8).
Lastly, use write method to copy the uppercase text held by the output variable, to the new file, text2 (Line 9).
Answer:
A. flowcharts
Explanation:
Flowcharts are used to graphically describes a process or system. They can simulate the whole process step by step showing arrows between different steps.
Methods in Java are collections of program statements that are named, and executed when called/invoked
The printShortWords method in Java where comments are used to explain each line is as follows:
//This defines the static method
public static void printShortWords(String str, int maxLength){
//This iterates through each word in the string
for(String word: str.split(" ")){
//The compares the length of each word to maxLength
if(word.length()<=maxLength){
//If the length of the current word is atleast maxLength, the word is printed
System.out.print(word+" ");
}
}
}
Read more about static methods at:
brainly.com/question/19360941
Answer:
a) 10
b) 1
C) 10
D) 1
E) 20
F) 10
Explanation:
a) The largest number of records that could appear in one bin
= 10
B) The smallest number of records that could appear in one bin
= 1
C) The largest number of records that cab appear in one bin
= 10
d) smallest number
= 1
e) With frequency = 20. the largest number of records that could appear in one bin with equal width discretization (10 bins)
= 20
f ) with equal height discretization
= 10