Answer:
Read the file and save it to a variable as a string, split the string variable and cast it to a set object using the set function to get the unique words in the file. Then use the max function with the key attribute to use regular expression module "re" to compare the first letter of each item to return in a list comprehension or append to a list.
Explanation:
The open function is used to import a file in python, the split string method splits the string to a list of items and the set function removes any duplicates of a word or item.
Using the for loop statement, iterate over the items and compare and return the items in alphabetical order with the 're' search method getting the item with uppercase letters with higher precedence than lowercase.
Answer:
Written in C++
#include<iostream>
using namespace std;
int main()
{
const float SALES_TAX = 0.06625;
int total = 1000;
cout<<"Total: ";
cin>>total;
float grand_total = 0;
grand_total = total + total * SALES_TAX;
if (grand_total <= 1000)
{
cout<<"Grand total is less than or equal to 1000 it is $";
printf("%.2f", grand_total);
}
else if (grand_total > 1000 && grand_total <= 2000 )
{
cout<<"Grand total is more than 1000 less than or equal to 2000 it is $";
printf("%.2f", grand_total);
}
else
{
cout<<"Grand total is greater than 2000 it is $";
printf("%.2f", grand_total);
}
cout<<"\nProgram finished!";
return 0;
}
Explanation:
<em>I've added the full source code as an attachment where I use comments to explain difficult lines</em>
The answer is you are responsible for paying all the
interest that accumulates on your loan. <span>For unsubsidized loans, the interest
accumulates while you are in school, and 6 months after you graduate (or drop
out) you will start paying on your loans. </span>
Answer:
Test B.
Explanation:
Test A - 95% effective with 10% false positive rate.
Test B -90% effective with 5% false positive rate.
Test A and B are independent methods.
One of the tests is carried out on a person and turns out to be positive.
To calculate the effectiveness of the test,
Test A = Effectiveness in percentage divided by the false positive rate.
95/10 = 9.5
Test B = Effectiveness in percentage divided by the false positive rate.
90/5 = 18.
Test B has a higher effective rate than Test A.
Therefore Test B is more indicative of a positive result than Test A.