Questions
What a "base” use case is? DQ 7-1 OOA

What a "base” use case is?

DQ 7-1 OOA

In: Computer Science

Q1. under what circumstances would static hashing be better than extendible hashing? Q2. under what circumstances...

Q1. under what circumstances would static hashing be better than extendible hashing?

Q2. under what circumstances would extendible hashing be better than static hashing?

In: Computer Science

Develop Python implementation of combinatorial algorithm which will find all possible Anagrams of user input. Hint:...

  • Develop Python implementation of combinatorial algorithm which will find all possible Anagrams of user input. Hint: use backtracking algorithm.
  • Example:
  • Input = ROWAN UNIVERSITY
  • Output (298 possibilities):
  • YOUR WINTERS VAIN
  • OAT RUINS WIN VERY
  • ROAR TUNES WIN IVY
  • IRONY UNWISER VAT
  • TIE IN SUN ROW VARY…

In: Computer Science

Chapter 7, Problem 3PE from Introduction to Programming using Python by Y. Daniel Liang. Problem (The...

Chapter 7, Problem 3PE from Introduction to Programming using Python by Y. Daniel Liang.

Problem

(The Account class) Design a class named Account that contains:

■ A private int data field named id for the account.

■ A private float data field named balance for the account.

■ A private float data field named annualInterestRate that stores the current interest rate.

■ A constructor that creates an account with the specified id (default 0), initial balance (default 100), and annual interest rate (default 0).

■ The accessor and mutator methods for id, balance, and annualInterestRate.

■ A method named getMonthlyInterestRate() that returns the monthly interest rate.

■ A method named getMonthlyInterest() that returns the monthly interest.

■ A method named withdraw that withdraws a specified amount from the account.

■ A method named deposit that deposits a specified amount to the account.

Draw the UML diagram for the class, and then implement the class. (Hint: The method getMonthlyInterest() is to return the monthly interest amount, not the interest rate. Use this formula to calculate the monthly interest: balance * monthlyInterestRate. monthlyInterestRate is annualInterestRate / 12. Note that annualInterestRate is a percent (like 4.5%). You need to divide it by 100.)

Write a test program that creates an Account object with an account id of 1122, a balance of $20,000, and an annual interest rate of 4.5%. Use the withdraw method to withdraw $2,500, use the deposit method to deposit $3,000, and print the id, balance, monthly interest rate, and monthly interest.

In: Computer Science

Write a thesis on "Blockchain & Decentralization". Decentralization is important to create a secure, non-discriminatory system....

Write a thesis on "Blockchain & Decentralization". Decentralization is important to create a secure, non-discriminatory system. [5000 words at least ]

In: Computer Science

Explain a significant difference between Google’s 2009 vision of the user interface of the Chrome operating...

Explain a significant difference between Google’s 2009 vision of the user interface of the Chrome operating system and the Chrome OS GUI we see today.

In: Computer Science

Compare and contrast the three levels of permissions available for shared files and folders on Google...

Compare and contrast the three levels of permissions available for shared files and folders on Google Drive.

In: Computer Science

Master thesis on "Blockchain Ecosystem development " , Building a thriving ecosystem is key for the...

Master thesis on "Blockchain Ecosystem development " , Building a thriving ecosystem is key for the long-term success of blockchain projects.

In: Computer Science

this question has been answered incorrectly several times can someone answer it correctly and show me...

this question has been answered incorrectly several times can someone answer it correctly and show me some examples of a run.

AGAIN SOMEONE SENT AN ANSWER THAT IS INCORRECT CAN SOMEONE ELSE PLEASE GET ME THE PROPER ANSWER.

Design and implement a class named Person and its two subclasses named Student and Employee.

Make Faculty and Staff subclasses of Employee.

A person has a name,address, phone number, and email address.

A student has a class status (year 1,year 2,year 3,or year 4).

An employee has an office, salary, and date hired.

Use the Date class from JavaAPI 8 to create an object for date hired.

A faculty member has office hours and a rank.

A staff member has a title.

Override the toString method in each class to display the class name and the person’s name.Design and implement all 5classes.

Write a test program that creates a Person,Student,Employee,Faculty, and Staff, and iinvokes their toString()methods

In: Computer Science

Write a function which takes two words as string arguments and checks whether they are anagrams...

Write a function which takes two words as string arguments and checks whether they are anagrams

NB: Please use spider in anaconda(python) and include a picture of the code

In: Computer Science

Write a program that asks the user to enter a number. Display the following pattern by...

Write a program that asks the user to enter a number. Display the following pattern by writing lines of asterisks.
The first line will have one asterisk, the next two, and so on, with each line having one more asterisk than the previous line,
up to the number entered by the user.For example, if the user enters 5, the output would be:
*
*   *
*   *   *
*   *   *   *
*   *   *   *   *

short codes please

In: Computer Science

For each of the following grammars, first classify the grammar as Regular, Linear, Context-Free or Context-Sensitive,...

For each of the following grammars, first classify the grammar as Regular, Linear, Context-Free or Context-Sensitive, and then precisely describe the language generated by the grammar.

(1) S → aRa

R → aR | bR | є

(2) S → A | B

A → aaaA | є

B → Bbb | b

(3) S → RbR

R → aRb | bRa | RR | bR | є

(4)   S → aSbSaS | aSaSbS | bSaSaS | є

   (5) S → a S b | C  

Set of terminals here is T = {a, b, c}     

C → cc C | є

In: Computer Science

Visual Basics 2015 The local smoothie store, Smoothie Queen has hired you to develop a program...

Visual Basics 2015 The local smoothie store, Smoothie Queen has hired you to develop a program that will make it easier for their sales associates to compute a customer's bill. You are to write a program that will allow the cashier to enter in customer information, smoothie information and display the total amount due. Here are the pertinent details: CALCULATIONS: 1. COST OF A SMOOTHIE: The actual cost of the smoothie is based on the smoothie size and the smoothie style. See the table below for price information. Internally you can handle this in one of two ways – you can either store this in a two-dimensional array/table or you can use an array of structures with two fields like you did in the state/abbreviation program. Small Medium Large King Regular 5.99 6.99 7.99 8.99 Organic 6.99 7.99 8.99 9.99 There are two different ways to approach the needed programming for the smoothie prices. You can use either of these – whichever one makes the most sense to you. My personal approach would be the first one (two dimensional arrays) because the data lays out like an Excel spreadsheet so it’s easy to think in rows and columns. But many people would also take the second approach (array of structures): A. Two-Dimensional Array Approach: If you are going to use a 2 dimensional array/table, you could declare it using something like this at the top of your program near your constants: decimal[,] smoothieListDecimal = {{ 5.99M, 6.99M, 7.99M, 8.99M }, { 6.99M, 7.99M, 8.99M, 9.99M }}; In this setup the cost for a particular smoothie would be based on a row and column of the table. For example, smoothieListDecimal [0, 3] would contain the price of a Regular King Smoothie. You will be able to use the selectedIndex for each of the dropdown lists to determine the row and column you need. TIP: You do not need a loop to search for the correct smoothie price. You only need to know the selectedIndex values for the row (smoothie style) and column (smoothie size) B. Array of Structures Approach: A different approach would be to use an array of structures. If you are going to use an array of structures, you could use a similar setup to the state/abbreviation program with the fields being regularDecimal and organicDecimal. You would then need an array of 4 structure elements (for each size) that you would initialize in the form load. 2. SMOOTHIE EXTRAS: A customer can order one or more extras for their smoothie. Toppings are $0.75 each (use a constant) and will be one of the following:  Echinacea  Bee Pollen  Energy Booster 3. DISCOUNTS: A customer may receive a discount on their purchase. Discounts are computed before taxes and can be one of the following (use a constant):  None – no discount  Preferred customer card - 15% discount  Coupon - 10% discount 4. TAXES: The final bill should also add in a state sales tax of 8% before calculating the amount due. You should incorporate a METHOD / FUNCTION to compute the tax. 5. CONSTANTS: Use appropriate constants for all numerical values that are predefined (e.g., extras, tax, discounts). FORMS SPECIFICATIONS AND VALIDATION 1. ABOUT FORM: Your program should have an “About” form that contains the typical information (program name, date, author, etc.). See sample EXE. 2. MAIN FORM (Customer Data): This form will need several components. There are also several required fields that should display appropriate error messages. When in doubt, refer to the sample EXE or post a question on the discussion board. 3. TEXT BOXES: You will use textboxes for the customer information. All fields must contain information or an error message will be displayed. • Customer Name TIP: You do not need to use a Try/Catch to do all the data validation since these are not numeric text fields. You can use a nested IF/ELSE setup to test the fields for the required input to make sure they are not blank. 4. COMBO BOXES/DROPDOWN LISTS • Smoothie Size: Should be one of the following – small, medium, large or king. Selection required. A size must be selected or an error should appear. Hint: Check to ensure the selectedIndex <> -1. • Smoothie Style: Should be one of the following – regular or organic. Selection required. A style must be selected or an error should appear. Hint: Check to ensure the selectedIndex <> -1. 5. CHECKBOXES/GROUPS: • Extras: Can be none, or, one or more of the following: Echinacea, Bee Pollen and Energy Booster. 6. RADIO BUTTONS/GROUPS: • Discount: May be none or 10% coupon or preferred customer (15% discount). 7. PULL DOWN MENUS (EXTRA CREDIT): The menu system should contain the following options (you can organize the menu choices however you’d like): • Calculate - Totals the customer's bill after adding any extras, deducting discounts and adding appropriate tax (assuming all data validation tests are passed). Displays the subtotal, discount, tax and amount due in the label box as currency. Note that if any validation error occurs, the program should not calculate or display any totals. • Clear - Clears all the text, check and option buttons, and totals. Repositions the cursor in the customer name text box for the next customer. • Help/About – Message box with your name and program name. • File/Exit - Exits the program. I have seen this posted before but wanted to see if someone would be able to explain more and possibly post screenshots of the code. Thank you in advance!

In: Computer Science

PYTHON: Turtle Command Interpreter You will write a program that reads a sequence of codes, converts...

PYTHON: Turtle Command Interpreter


You will write a program that reads a sequence of codes, converts them into Turtle commands, and then executes them. The codes are in a Python list, passed as an argument to your function.

turtleRunner(t, x)
t is a Turtle
x is a list of Turtle commands

Code List
(f, d)    Move forward by d pixels
u Lift pen up
d Put pen down
(l, d) Turn left by d degrees
(r, d) Turn right by d degrees
(c, s) Change color to "s"
(w, d) Change pen width to d

For example [("f", 100), ("r", 30), ("c", "red"), "u", ("f", 50), ("r", 60), "d", ("f", 100)] will execute:

t.forward(100)
t.right(30)
t.color("red")
t.penup()
t.forward(50)
t.right(60)
t.pendown()
t.forward(100)

Your program will need to do the following:

  1. Define a function named turtleRunner(t, x), where t is a turtle and x is a list
  2. Go through each element of x one at a time.
  3. If the element is a tuple (if isinstance(e, tuple)):
    1. Determine if the code is f, r, c, or w
    2. Execute the correct turtle command using the second part of the tuple (a distance or color)
  4. If the element is a string (if isinstance(e, str)):
    1. Execute the correct turtle command

x = [("w",3),("c","red"),("f",100),("r",120),("c","blue"),("f",100),("r",120),("c","green"),("f",100)]
turtleRunner(t, x)

Draws the shape below:

isinstance(x, y) returns True if x is an instance of class y. So isinstance(e, tuple) will return True if e is a Tuple.
(Note no quotes around tuple in the call)

isinstance(e, str) will return True if e is a String.

Starter code(please by off this):

# Tkinter
#
# Turtle Command Interpreter
#
# You will write a program that reads a list of codes, converts them into Turtle commands, and then executes them.
#
# Code list:
# (f, d) Move forward by d pixels
# u         Up
# d         Down
# (l, d)    Turn left by d degrees
# (r, d)    Turn right by d degrees
# (c, s)    Change color to "s"
# (w, d)    Change width to d
#
# Example:
# [("f", 100), ("r", 30), ("c", "red"), "u", ("f", 50), ("r", 60), "d", ("f", 100)]
#
# This will execute:
# t.forward(100)
# t.right(30)
# t.color("red")
# t.penup()
# t.forward(50)
# t.right(60)
# t.pendown()
# t.forward(100)
#
# Your program will need to do the following:
# 1) Define a function named turtleRunner(x), where x is a list
# 2) Go through each element of x one at a time.
# 3) If the element is a tuple (if isinstance(e, tuple)):
#    a) Determine if the code is f, r, or c
#    b) Execute the correct turtle command using the second part of the tuple (a distance or color)
# 4) If the element is a string (if isinstance(e, str)):
#    a) Execute the correct turtle command
#
import turtle

def turtleRunner(t, x):
    pass

w = turtle.Screen()
t = turtle.Turtle()
x = [("w",3),("c","red"),("f",100),("r",120),("c","blue"),("f",100),("r",120),("c","green"),("f",100)]
turtleRunner(t, x)

In: Computer Science

the Unix/Linux commands Enter the “date” command to print the current date and time. Also, try...

the Unix/Linux commands

  1. Enter the “date” command to print the current date and time. Also, try the “cal” command.
  2. Enter the command “clear” to clear the screen.
  3. Use the command “cat .bash_hisrtory” to view your startup file. Note that each shell has a different startup file, and since we’re using the BASH (Bourne-Again Shell), the startup file is .bash_history. (if you can’t find this file think about one way to display!)
  4. Enter the “exit” command to close the terminal window.
  5. Enter the command “who” to display all users currently logged onto the system.
  6. Enter the commands “whoami” and “who am i” to display your own user information. Note the difference.

Whoami shows my username

  1. Enter the “finger” command with your login name to display detailed information about your terminal. (note: if you can’t find finger command, ask your instructor to install it)
  2. Change to the “/bin” directory.
  3. Display all files (ls –l) from the “/bin” directory.
  4. Change to your HOME directory.
  5. Use the “cat” command to create a sample text file called “textfile1”. Enter several lines of text of your choice into that file. The output redirection “>” should be used with the cat command “cat > textfile1”.
  6. Use the “cat” command to view the file you have just created. Then, use the “wc” command to display statistics information about that file (number of lines, words, and characters).
  7. The output redirection can be used with any command. Try the following command which prints all the files in the “/bin” directory into the file output:
  8. ls –la /bin > output

  1. Use the “cat” command to view the contents of the “output” file. How can you display the contents one page at a time?
  2. The output redirection “>” creates a file if it doesn’t exist, and over-writes its contents if the file exists. Try the following command which prints the lists of users into the “output” file we created earlier: who > output
  3. Use the “cat” command to display the contents of the “output” file. You’ll notice that the previous contents have been over-written.
  4. The output re-direction “>>” can be used to append contents to an existing file. Try this: “date >> output”. You’ll notice that the current date has been appended to the previous contents of the output file.
  5. The “touch” command can be used to create an empty file. Try this: “touch myfile”. Check to make sure the file “myfile” has been created.
  6. Try the “touch” command on an existing file “touch textfile1” or “touch output”. What is the effect?
  7. Create a new file called “memo.txt” with the following information “Hello there, my name is …yourname….”.
  8. Append the current date to the end of file “memo.txt”.
  9. Invoke the calendar command and redirect its output to the file “memo.txt”.
  10. Write a command to display statistics (lines, words, characters) about “memo.txt”.

In: Computer Science