Have you ever been in a situation in which you forgot a password and had a difficult time retrieving it? If so, in just a few sentences, write about how it made you feel and what you would do differently next time. If this has never happened to you, write about what you would do to keep track of the many passwords you use.
In: Computer Science
In Java, write a program that solves the following problem.
An arena can seat 12,000 people for an event. If the arena was full and you were to poll everyone for which day of the year (between 1 and 365, inclusive) they were born, determine which days had the most birthdays and which days had the fewest birthdays.
Write a program that will generate 12,000 random birthdays (integer numbers) between 1 and 365 and count how many people have that same birthday. Output a listing of the days that have the most birthdays and the days that have the fewest birthdays. You do not need to convert a number like 32 to an actual date (February 1st).
Do NOT change your class name from "Main". Your filename should be "Main.java".
Your code will have two classes:
The two classes can be part of the same file. A naive example structure is shown below.
public class Main{
public static void main(String args[]){
Arena a = new Arena();
a.printArena();
}
}
class Arena{
void printArena() {
System.out.println("I am arena");
}
}
Sample Output
The following days have 75 people:
147
The following days have 35 people:
143 312
In: Computer Science
Windows Server 2012 Inside Out Chapter 10 pages 369 to 395
In: Computer Science
Write a function that plots a spline curve for arbitrary x values if a solution for Ci is provided in vector form. Name the function spline_group and illustrate results.
Matlab Program
In: Computer Science
First, create a class object named SequenceMap that has as private data members the following two:
string recognition_sequence_ ;
vector enzyme_acronyms_;
Other than the big-five (note that you can use the defaults for all of them), you have to add the following:
a) A constructor SequenceMap(const string &a_rec_seq, const string &an_enz_acro),that constructs a SequenceMap from two strings (note that now the vector enzyme_acronyms_ will contain just one element, the an_enz_acro).
b) bool operator<(const SequenceMap &rhs) const, that operates based on the regular string comparison between the recognition_sequence_ strings (this will be a one line function).
c) Overload the operator<< for SequenceMap.
d) void Merge(const SequenceMap &other_sequence). This function assumes that the object’s recognition_sequence_ and other_sequence.recognition_sequence_ are equal to each other. The function Merge() merges the other_sequence.enzyme_acronym_ with the object’s enzyme_acronym_. The other_sequence object will not be affected.
Please test it with your own test functions to make sure that it operates correctly.
Please also show the test functions that you utilize so I can also implement it.
thank you.
In: Computer Science
What decimal number does the bit pattern 11001100 represent if it is a unsigned integer?
In: Computer Science
Describe the concept of "streaming" and why it is used in delivering sound via the Internet. Which audio file formats work best for streaming over the web and why?
Research the Recording Industry Association of America (RIAA) and the Motion Picture Association of America (MPA), their influence on Federal regulations, and their evolving role in digital media distribution. You can include discussion of the Digital Millennium Copyright Act (DMCA), the Stop-Online Piracy Act (SOPA) and/or the Protect IP Act (PIPA) in relation to current trends in file sharing technologies.
In: Computer Science
The Language is Java.
Sample Output:
There is no given sample Output
IsEqualToTest (30)
Write a simple generic version of method isEqualTo that compares its two arguments with the equals method and returns true if they’re equal and false otherwise. Use this generic method in a program that calls isEqualToTest with the built-in types Integer, String, Double and Object. The main reads in two Integer, and two Double values with autoboxing, as well as two String and calls the method. For Object just create two Object objects with no parameters. The method doesn’t need to include any correctness tests.
In: Computer Science
Write a decrease-conquer algorithm to solve the following problem:
input: a nonempty unsorted array A[lo..hi] of n distinct nonnegative integers;
output: the (left) median value of A[lo..hi].
What is the asymptotic running time of your algorithm ?
In: Computer Science
PLEASE DO THIS WITH PYTHON 3
Lab 4-2: Computing Tax
The United States federal personal income tax is calculated based on filing status and taxable income. There are four filing statuses: single filers, married filing jointly, married filing separately, and head of household. The tax rates vary every year. Table 3.2 shows the rates for 2009. If you are, say, single with a taxable income of $10,000, the first $8,350 is taxed at 10% and the other $1,650 is taxed at 15%. So, your tax is $1,082.5.
Table 1
2009 U.S. Federal Personal Tax Rates
|
Marginal Tax Rate |
Single |
Married Filing Jointly or Qualified Widow(er) |
Married Filing Separately |
Head of Household |
|
10% |
$0 – $8,350 |
$0 – $16,700 |
$0 – $8,350 |
$0 – $11,950 |
|
15% |
$8,351– $33,950 |
$16,701 – $67,900 |
$8,351 – $33,950 |
$11,951 – $45,500 |
|
25% |
$33,951 – $82,250 |
$67,901 – $137,050 |
$33,951 – $68,525 |
$45,501 – $117,450 |
|
28% |
$82,251 – $171,550 |
$137,051 – $208,850 |
$68,525 – $104,425 |
$117,451 – $190,200 |
|
33% |
$171,551 – $372,950 |
$208,851 – $372,950 |
$104,426 – $186,475 |
$190,201 - $372,950 |
|
35% |
$372,951+ |
$372,951+ |
$186,476+ |
$372,951+ |
You are to write a program to compute personal income tax. Your program should prompt the user to enter the filing status and taxable income and compute the tax. Enter 0 for single filers, 1 for married filing jointly, 2 for married filing separately, and 3 for head of household.
Here are sample runs of the program:
Sample 1:
Enter the filing status: 0
Enter the taxable income: 100000
Tax is 21720.0
Sample 2:
Enter the filing status: 1
Enter the taxable income: 300339
Tax is 76932.87
Sample 3:
Enter the filing status: 2
Enter the taxable income: 123500
Tax is 29665.5
Sample 4:
Enter the filing status: 3
Enter the taxable income: 4545402
Tax is 1565250.7
In: Computer Science
Byzantine Generals Problem and Solutions
Based on the proposed solutions use any code you want to demonstrate one of the solutions.
Include documentation describing your code
include comments in your code describing each step
In: Computer Science
**C++ only, standard library.
We are supposed to create a tower of hanoi program and do a sequence of 100 disks. We are supposed to run the program and then answer two questions:
1) How long does your computer take to run(time)?
2) If I could move 1 disk per second how long would it take?
Here is my program so far:
void towerOfHanoi(int numDisks, char from_rod, char to_rod, char
aux_rod)
{
int count=0;
if (numDisks == 1)
{
//cout << "Move disk 1 from rod " << from_rod
<<
// " to rod " << to_rod<<endl;
return;
}
towerOfHanoi(numDisks - 1, from_rod, aux_rod, to_rod);
//cout << "Move disk " << numDisks << " from
rod " << from_rod <<
//" to rod " << to_rod << endl;
towerOfHanoi(numDisks - 1, aux_rod, to_rod, from_rod);
}
// Driver code
int main()
{
int numDisks; // Number of disks
cout<<"This program solves the Hanoi Tower
puzzle"<<endl<<endl;
cout<<"Enter the number of disks to calculate: ";
cin>>numDisks;
towerOfHanoi(numDisks, 'A', 'C', 'B'); // A, B and C are names of
rods
return 0;
}
In: Computer Science
What code would I add to the following program to have it print out the runtime each time the program is used?
def moveTower(n, source, dest, temp):
if n == 1:
print("Move disk from", source, "to", dest+".")
else:
moveTower(n-1, source, temp, dest)
moveTower(1, source, dest, temp)
moveTower(n-1, temp, dest, source)
def hanoi(n):
moveTower(n, "A", "C", "B")
def main():
print("Towers of Hanoi")
n = int(input("How many disks? "))
moveTower(n, "A", "C", "B")
if __name__ == '__main__': main()
In: Computer Science
find how many times a letter appear in a string for
example yellowstone letter l appear two times
(using python)
In: Computer Science
Personal Computer Fundamentals
Identify a task that you would need to perform in your current career or future career, and explain how you would apply the knowledge you have learned in this course to succeed at performing the task in a real-world scenario.
journal
In: Computer Science