Questions
2. Implement a main method that does the following: Use Java (a) Creates a binary search...

2. Implement a main method that does the following: Use Java

(a) Creates a binary search tree to hold sports scores as data for a sport of your own choice

(b) Adds between 5 and 8 scores to the tree using standard tree operations Try insert

(c) Choose one of the tree traversals, preorder or postorder, and use it to print out all elements of the tree

(d) Delete one score from the tree using standard tree operations (suppose the score was found to be illegitimate) (e) Use an iterator to get a list for an inorder traversal for the tree (so that you can process each element from the tree), and print out a message about the sports score, including the sport and other informative information you can come up wit

In: Computer Science

The following flow chart is a bubble sort. Write the code for this sort. Make sure...

The following flow chart is a bubble sort. Write the code for this sort. Make sure you display each pass and comparison. Include comments.

In: Computer Science

i'm working on this assignment where we must simulate a bank account. I am having a...

i'm working on this assignment where we must simulate a bank account. I am having a few issues. The first issue is that for menu option 1 i am struggling to make the program so that I can add the name and balance of the account all at once. For example I would type "mike 350" and it would update the dictionary with a new account and balance, right now i have to open the account then deposit a balance separately using two different menu functions. The second issue i am having is that every account name in the dictionary has the same balance, I need to have each person have a separate balance. The third and last issue I am having is with menu option #6, i am not sure how to list the account names and balances with a number of each account to the left, the professor wants the output to look like this for option 6

No Customer Name   Balance

== =============   =======

1 joe 10

2 jim 20

3 eric 30

I have made it this far.

def main():
  
print("1. Open an account")
print("2. Close an Account")
print("3. Deposit money")
print("4. Withdrawal money")
print("5. Enquire about balance")
print("6. Print a list of customers and balances")
print("7. Quit")


accounts = {}
balance = 0
main()

while True:
menu_choice = int(input("Type in a menu choice: "))

#menu choice 1
if menu_choice == 1:
number = input("Enter name of the new customer and \nthe amount of money to be deposited \n into the new account (Ex. 'Mike 350'):")
if number in accounts:
print('This customer already exists!')
  
else:
accounts[number]=balance
print ("Account name", number, "opened.")

#menu choice 2
elif menu_choice == 2:
number = input("Account name:")
  
if number not in accounts:
print('Enter the customer/account name to be deleted: ')
if number in accounts:
if balance>0:
print('Can not close an account with balance greater than zero')
else:
del accounts[number]
print ("Account number", number, "is closed.")

#menu choice 3
elif menu_choice == 3:
print ("Enter the customer name for deposit: ")
number = input("Account name: ")
if number in accounts:
deposit = float(input("Enter the amount to be deposited: "))
  
balance += deposit
print ("your balance is:", balance-deposit, "before deposit")
print ("Your balance is:", balance, "after deposit")
else:
print ("This customer doesn't exist!")

#menu choice 4   
elif menu_choice == 4:
number = input("Enter the customer name for withdrawl: ")
if number not in accounts:
print('This customer doesnt exist!')
  
if number in accounts:
withdraw = float(input("Enter the amount to be withdrawn: "))
if withdraw <=balance:
balance -=withdraw
print ('your balance is:', balance+withdraw, 'before withdrawal')
print ("Your balance is:", balance, 'after withdrawal')
if withdraw >balance:
print ('your balance is:', balance, 'before withdrawal')
print ('You dont have enough balance to cover the withdrawal')

#menu choice 5
elif menu_choice == 5:
number = input('Enter the customer name for balance enquiry: ')
if number not in accounts:
print('This customer doesnt exist!')

if number in accounts:
print('your balance is:', balance)
  
#menu choice 6
elif menu_choice == 6:
print ("Accounts")
for x in accounts.keys():
print ('No Customer Name Balance')
print ('============================')
print (x , balance\n)

#menu choice 7
elif menu_choice == 7:
print ("Quit.")
break
else:
print ("Please enter a menu choice between 1 and 6.")

main()

In: Computer Science

All along we have been discussing processing similar kind of data in a MapReduce job. In...

All along we have been discussing processing similar kind of data in a MapReduce job. In other words lots of data of same kind. But sometimes, you have to process two different kinds of data sets together, join them and produce a joined output. This is called joins. We take joins for granted in RDBMS, but it takes an effort to implement in MapReduce. Research various Join techniques/algorithms available for MapReduce. In your opinion, what are the pros and cons of the various MapReduce join options. Please keep it to your own words rater than paraphrasing sentences from websites.

In: Computer Science

Create a program called DualPivotQuickSort.java that implements the QuickSort algorithm using Yaroslavskiy’s algorithm. The program should...

Create a program called DualPivotQuickSort.java that implements the QuickSort algorithm using Yaroslavskiy’s algorithm. The program should be able to do the following: accepts one command line parameter. The parameter specifies the path to a text file containing the integers to be sorted. The structure of the file is as follows: There will be multiple lines in the file (number of lines unknown). Each line will contain multiple integers, separated by a single whitespace. reads the integers from the text file in part a into an array of integers. sort the integers in descending order using DualPivotQuickSort, and then prints out a sorted version of these integers on a single line, separated by white spaces. The implementation should follow the given the pseudo code/algorithm description. DUALPIVOTQUICKSORTYAROSLAVSKIY(A, left, right) // Sort the array A in index range left, ... , right 1 if right left 1 p= A[le Show transcribed image text

In: Computer Science

Create a MIPS assembly program to calculate x^y using a recursive subprogram. You may assume that...

Create a MIPS assembly program to calculate x^y using a recursive subprogram. You may assume that y is not negative.

In: Computer Science

What is the function of a replacement algorithm?  Do you need a replacement algorithm for direct mapping?  ...

  1. What is the function of a replacement algorithm?  Do you need a replacement algorithm for direct mapping?  
  2. Define the two write policies in about ten sentences total. Discuss the relative merits of the policies.  
  3. Describe a simple way of implementing an LRU replacement algorithm in a 4-way set associative cache.
  4. What is the impact of the design decision of line size on hit ratio?  Discuss the various approaches of cache coherency in a multiprocessor system (in about 10 sentences).  Discuss the relative merits of unified vs. split (code/data) cache design.    

In: Computer Science

SpriteKit is Apple’s built in 2D Gaming API, but there are others out there. What other...

SpriteKit is Apple’s built in 2D Gaming API, but there are others out there. What other libraries exist for developing 2D games? What are the advantages or disadvantages with using SpriteKit vs these other libraries?

In: Computer Science

The result of subtracting the following two signed binary numbers on an eight bit machine is...

The result of subtracting the following two signed binary numbers on an eight bit machine is
     10110011
   - 01101001

In: Computer Science

JAVA PROGRAMMING Write a program that ask the user for a number then prints the cube...

JAVA PROGRAMMING Write a program that ask the user for a number then prints the cube of the number. The program should be called CubeNumbers. Use a value returning method with parameter, call the method myCube.

In: Computer Science

Step 2: using text editor (WordPad) to create a web page with the following content (you...

Step 2: using text editor (WordPad) to create a web page with the following content (you may cut-and-paste):

-----------------------------------------------------------------------------------

Just a screenshoot of the output

Book-O-Rama Catalog Search

Book-O-Rama Catalog Search

    Choose Search Type:

         Author      Title      ISBN    

   

    Enter Search Term:

   

   

   

-------------------------------------------------------------------------------------

Then save above document to the local directory (C:\temp) and make sure that you saved it in the plain text format (in the “Save as type” popup window, choose “Text Document (*.txt)), name your file “firstpage.txt”.

Step 3: test your web page

You can test your page by doing the following:

1. change the file extension to html. Thus, you should have a file firstpage.html.

2. create a sub director named “firstwebsite” in the web server’s root directory. Your web root may be different from mine. In my machine, the XAMPP is installed at C drive. Thus, the web root will be:

C:\xampp\htdocs\

At the end of this step, the directory structure will be:

C:\xampp\hpdocs\firstwebsite\

3. copy the newly created file “firstpage.html” to the directory shown in the previous line.

4. fire up a web browser and type the following to the URL:

http:\\localhost\firstwebsite\firstpage.html

In: Computer Science

Provide a detailed code for Double Encryption using Image Steganography in PYTHON First encrypt the data(using...

Provide a detailed code for Double Encryption using Image Steganography in PYTHON

First encrypt the data(using RC4/AES algorithm) before storing it in the image, after encrypted data is stored in the image, use image steganography to encrypt the image. Hence, we are using double encryption

In: Computer Science

Write a C++ program that requires the user to type in an integer M and computes...

Write a C++ program that requires the user to type in an integer M and computes the function y(M) which is defined by y(0)=2, y(1)=1, y(m+1)=y(m)+2*y(m-1).

In: Computer Science

The section on hacking by governments (Section 5.3.4) describes, mostly, incidents of hacking for military or...

The section on hacking by governments (Section 5.3.4) describes, mostly, incidents of hacking for military or strategic purposes.

1. Find and summarize information about hacking for industrial or economic espionage.

In: Computer Science

4. Write a function called mean that will return the average value of an integer array....


4. Write a function called mean that will return the average value of an integer array. The integer array and its length must be passed to the function as parameters.

5.Write a function called max that will return the index of the max value of an integer array. The integer array and its length must be passed to the function as parameters.
E.g. array = {1,2,3,4,5,6,7,8,9,0}
max = 9
index = 8

6.Write a function called variance that calculates and returns the variance of an array that is passed to it as a parameter. Also, pass the length of the array as a parameter.
variance = mean(array^2) - (mean(array))^2
array^2 = square of each element of the array
You must use the mean function above in your calculation.

c language

In: Computer Science