Answer:
books = []
fp = open("bookTitles.txt")
for line in fp.readlines():
title = line.strip()
if title not in books:
books.append(title)
fp.close()
fout = open("noDuplicates.txt", "w")
for title in books:
print(tile, file=fout)
fout.close()
except FileNotFoundError:
print("Unable to open bookTitles.txt")
Answer:
The minimum value of wall thickness t=3.63 mm.
Explanation:
Given:
D=200 mm
P=4 MPa
t= Wall thickness
maximum shear stress=27.5 MPa
We know that
hoop stress 
Longitudinal stress
So maximum shear tress in plane

Now by putting the value

So t=3.36 mm
The minimum value of wall thickness t=3.63 mm.
Answer:
The solution code is written in Java.
- public class Main {
-
- public static void main(String[] args) {
-
- Scanner inNum = new Scanner(System.in);
- System.out.print("Enter number of toss: ");
- int num = inNum.nextInt();
-
- for(int i=0; i < num; i++){
- System.out.println(toss());
- }
- }
-
- public static String toss(){
- String option[] = {"heads", "tails"};
- Random rand = new Random();
- return option[rand.nextInt(2)];
- }
- }
Explanation:
Firstly, we create a function <em>toss()</em> with no parameter but will return a string (Line 14). Within the function body, create an option array with two elements, "heads" and "tails" (Line 15). Next create a Random object (Line 16) and use <em>nextInt()</em> method to get random value either 0 or 1. Please note we need to pass the value of 2 into <em>nextInx() </em>method to ensure the random value generated is either 0 or 1. We use this generate random value as an index of <em>option </em>array and return either "heads" or "tails" as output (Line 17).
In the main program, we create Scanner object and use it to prompt user to input an number for how many times to toss the coin (Line 6 - 7). Next, we use the input num to control how many times a for loop should run (Line 9). In each round of the loop, call the function <em>toss() </em>and print the output to terminal (Line 10).
Answer:
Explanation:
First, we find the mass of the air originally in the tank.
Density is given as mass divided by volume. It is given as:

Therefore, mass is:

Density of air =
; Volume of the tank = 

The mass of the air initially in the tank is 7 kg.
After air is allowed to enter, the mass changes.
New density = 
The new mass will be:

We can now find the mass of air that has entered the tank:
Mass of air that entered tank = New mass of air - Original mass of air
M = 22.75 - 7.0 = 15.75 kg
The mass of air that entered the tank is 15.75 kg.
Answer:
(A) Maximum voltage will be equal to 333.194 volt
(B) Current will be leading by an angle 54.70
Explanation:
We have given maximum current in the circuit 
Inductance of the inductor 
Capacitance 
Frequency is given f = 44 Hz
Resistance R = 500 ohm
Inductive reactance will be 
Capacitive reactance will be equal to 
Impedance of the circuit will be 
So maximum voltage will be 
(B) Phase difference will be given as 
So current will be leading by an angle 54.70