Questions
Task Intro: Password JAVA and JUnit5(UNIT TESTING) Write a method that checks a password. The rules...

Task Intro: Password JAVA and JUnit5(UNIT TESTING)

Write a method that checks a password. The rules for the password are:

- The password must be at least 10 characters.
- The password can only be numbers and letters.
- Password must have at least 3 numbers.
Write a test class(Junit5/Unit testing) that tests the checkPassword method.

Hint: You can (really should) use method from built-in String class:

public boolean matches(String regex)
to check that the current string matches a regular expression. For example, if the variable "password" is the string to be checked, so will the expression.
password.matches("(?:\\D*\\d){3,}.*") 

return true if the string contains at least 3 numbers. Regular expression "^ [a-zA-Z0-9] * $" can be used to check that the password contains only numbers and letters.

Let your solution consist of 4 methods:

checkPassword(string password) [only test this method]
checkPasswordLength(string password) [checkPassword help method]
checkPasswordForAlphanumerics(string password) [checkPassword help method]
checkPasswordForDigitCount(string password) [checkPassword help method]

Intro: Password Criteria

The code is structured and formatted
Your code uses the standard java formatting and naming standard, it is also nicely formatted with the right indentation etc.
Good and descriptive variable names
Your code uses good variable names that describe the damped function, such as "counter" instead of "abc".

The code is logical and understandable

Your code is structured in a logical way so it's easy to understand what you've done and how to solve the problem. It should be easy for others to understand what your code does and how it works.

The solution shows understanding of the problem
You show with your code that you have thought about and understood the problem. It is worth thinking about how you will solve the problem before you actually solve it
The code solves the problem
Your code manages to do what is required in the assignment text, and it does not do unnecessary things either.
Unit tests (Junit5) cover all common use cases
Unit tests for your code check all common ways it can be used, such as the isEven (int number) method being tested with even, odd, negative, and null, reverseString (String text) will be checked with regular string, empty string and zero object, etc.
The code uses Regex and built-in methods
Do not try to reinvent the wheel, it is possible to check the text string for digits with a while / for loop, but using regex and matching function is much easier. There are many websites that help you find regex for what you need, so use them.

In: Computer Science

4. DNS hijacking is a common technique that is used by censors (i.e., networks who perform...

4. DNS hijacking is a common technique that is used by censors (i.e., networks who perform censoring actions), where fake DNS responses can be injected. As a DNS request could traverse a number of routers along the path, each router along the path could inject a fake DNS response. In the paper “The Collateral Damage of Internet Censorship by DNS Injection”, authors use a technique similar to traceroute to identify the router that actually injects the fake DNS response. Authors deliberately decrease the TTL (time-to-live) value in the IP header to monitor ICMP packet and fake DNS response to decide the router that injects fake response. In this paper, DNS is built on UDP. However, DNS can also be built on top of TCP. This expands the attack surface for attackers. Specifically, the censors inject RST packets to both the client and the server in one TCP connection if a DNS query in this connection carries “sensitive” information. Different from UDP, TCP requires three-way handshake. Therefore, the packet that carries sensative information (e.g., a TCP-based DNS query) will be the packet that comes later than packets for three-way handshake. Let us make the following assumptions for this question 1. We assume that DNS over TCP is using a publicly-known port number. 2. Censors are stateless, which means that they will not consider whether a TCP packet belongs to an established connection. They make decision based on each individual packet instead of packets belonging to the same connection. In order to make the method discussed in “The Collateral Damage of Internet Censorship by DNS Injection” to be useful in this new setting, we need to make a few changes of this method. Question: Please verify whether each of the following changes is needed or not (1 Point). And please justify your answer (1 Points). a. When you select a target IP to send honey queries, this IP should never respond you with TCP RST packets if you send a TCP-based DNS query to this IP. b. When you send out a honey query (a TCP-based DNS query with a sensitive domain) to a target IP, you can directly send this TCP-based DNS query to this target IP without establishing a TCP connection with the target IP (i.e., through 3-way handshake). c. You should now expect RST packets from the censor rather than a forged DNS response.

In: Computer Science

[The following information applies to the questions displayed below.] Cougar Plastics Company has been operating for...

[The following information applies to the questions displayed below.]

Cougar Plastics Company has been operating for three years. At December 31 of last year the accounting records reflected the following:

Cash $ 22,000 Accounts payable $ 15,000
Investments (short-term) 3,000 Accrued liabilities payable 4,000
Accounts receivable 3,000 Notes payable (short-term) 7,000
Inventory 20,000 Notes payable (long-term) 47,000
Notes receivable (long-term) 1,000 Common stock 10,000
Equipment 50,000 Additional paid-in capital 80,000
Factory building 90,000 Retained earnings 31,000
Intangibles 5,000


During the current year, the company had the following summarized activities:

  1. Purchased short-term investments for $10,000 cash.
  2. Lent $5,000 to a supplier who signed a two-year note.
  3. Purchased equipment that cost $18,000; paid $5,000 cash and signed a one-year note for the balance.
  4. Hired a new president at the end of the year. The contract was for $85,000 per year plus options to purchase company stock at a set price based on company performance.
  5. Issued an additional 2,000 shares of $0.50 par value common stock for $11,000 cash.
  6. Borrowed $9,000 cash from a local bank, payable in three months.
  7. Purchased a patent (an intangible asset) for $3,000 cash.
  8. Built an addition to the factory for $24,000; paid $8,000 in cash and signed a three-year note for the balance.
  9. Returned defective equipment to the manufacturer, receiving a cash refund of $1,000.
Required:

1. & 2.

Post the current year transactions to T-accounts for each of the accounts on the balance sheet. (Two items have been given in the cash T-account as examples).


            

4. Prepare a trial balance at December 31 of the current year.

5. Prepare a classified balance sheet at December 31 of the current year.

6.

Compute the current ratio for the current year. (Round your answer to 2 decimal places.)

In: Accounting

Financial Projections & Explaining Uncertainties When doing a financial projection, it is important to always somehow...

Financial Projections & Explaining Uncertainties

When doing a financial projection, it is important to always somehow predict the financial cost of the unknowns and to have details surrounding those unknowns. Although they can be scary and cause worry, having detailed historical data or reason behind the uncertainty can help calm an audience almost immediately. In explaining a financial uncertainty, I would recommend starting with pointing out some positives based on the actual numbers. These positives should be the based off of the forecast that was built and defined. From here I would recommend briefly touching upon the fact that things sometimes don’t go as planned; a hurricane wipes out a town, a massive snow storm wipes the power from the state for multiple days or a competitor suddenly starts taking a portion of your customers. All of these things can’t be predicted and are therefore uncertainties. Giving the audience context around what these uncertainties are helps build a solid foundation of understanding.

From here I recommend that communication on the difference in the uncertainty and the actual financial prediction are discussed in great detail. Everything should be outlined, starting with this was our predicted number, this was our final number and these are the reasons we didn’t get to our actual number. It could be that there was an error in the number of days predicted in the month, it could be that the sale Nordstrom rolled out wasn’t discounted enough to sell more products or simply that the number of people predicted to make a purchase at Nordstrom was over projected. A solid reason around why the prediction versus the actual occurred will calm an audience.

Lastly, the audience wants to hear how this will be mitigated going forward and factored into future predictions. Outlining the detail around the uncertainty allows the predictor to learn and comprehend what actually happened versus what was predicted so that historically they can better predict next time as well as aid in calming the audience.

For Chegg: constructively critique my explanations. Support your initial comment and response with sound reasoning and relevant examples.

In: Finance

Mr Dumas is a famous French chef who moved from Paris to Sydney on 1 November...

Mr Dumas is a famous French chef who moved from Paris to Sydney on 1 November 2018 to work for an Australian fine dining restaurant. His remuneration includes a salary of $350,000 plus $50,000 bonus per year and a contractual term of two years. Mr Dumas would be paid a lump sum of $500,000 in return for his promise that, if he resigns, he would not set up in a business in Sydney in competition with an Australian fine dining restaurant for 3 years. Mrs Dumas moved to Sydney with her husband and three children. Mr Dumas obtained permanent residence since 1 November 2018 and bought the following assets in Sydney: A vintage motor vehicle built in 1961: acquired on 15 November 2018 at a cost of $150,000. Mr Dumas intended it to be kept as a long-term investment. A family house in Chatswood: acquired on 1 December 2018 at a cost of $1,200,000 10,000 Shares in BHP: acquired on 1 January 2019 at a cost of $300,000 were sold for $320,000 on 15 May 2020. During the financial year 2020, Mr Dumas signed the contract with SBS TV channel around November 2019 and agreed to travel to New Zealand in December 2019 for filming The Food Show. The fee of $100,000 will be paid out to him once the show is released on TV in August 2020. On 1 May 2020, Mr Dumas sold the following overseas assets which he bought before he came to Australia: 30,000 shares in a USA company: acquired on 1 July 1982 at a cost of $15,000 and was sold for $35,000 on 1 May 2020. The market value was $6,000 as at 1 November 2018. An investment flat in Paris: acquired on 15 July 2018 at a cost of $230,000 and was sold for $200,000 on 1 May 2020. Mr Dumas still maintains a bank account at the Bank of Paris in France which earned a total of $8,500(2018/2019) and $10,000(2019/2020) in interest income. He neither repatriated nor declared any part of the interest derived in France because he has paid 15% withholding tax. Hence, at the time of lodging his Australian tax return, Mr Dumas declared his Australian sourced income only. Mr Dumas lodged his 2018/19 tax return on 15 August 2019 and received a notice of assessment on 25 October 2019. On 15 February 2020, he received a notice of amended assessment which included his Australian taxable income the amounts derived in French. The amended assessment required Mr Dumas to pay $4,250 additional tax to the ATO. Mr Dumas and his family decided to relocate to New Zealand indefinitely and left Australia on 30 June 2020 to set up a high-end restaurant. On 10 July 2020, he also received a lump sum payment of $500,000 under the terms of his remuneration package with his Australian employer.

Required: Under what circumstances and on what grounds could the ATO issue the amended assessment for the year 2018/2019?

What should Mr Dumas do if he decides to dispute this amended assessment, and what time limits would apply for the dispute to be commenced?

Advise Mr Dumas on what amounts may be included in his Australian taxable income for the 2019/20 tax year.

Calculate his taxable income for the year ending 30 June 2020.

In: Accounting

You will make many purchases online in order to benefit from greater convenience or lower—prices, but...

You will make many purchases online in order to benefit from greater convenience or lower—prices, but you will likely set foot in a brickand mortar retail store at least occasionally, and you may have noticedsome changes brought by technology. A few decades ago, large retail chains started introducing computerized point-of-sale inventory systems consisting of checkout computers and an inventory control system. A simple bar code scancaptures a sale, and the item is automatically deducted from the store’s inventory, allowing real-time tracking of purchases so that the retailer knows when to reorder merchandise or restock shelves. In addition to a speedier checkout process, such systems help to reduce stockouts, increasing customer satisfaction. In many grocery stores, this system has been taken a step further, allowing the customers to conduct the checkout process themselves, saving time and labor costs. In Switzerland, grocery retailer Migros introduced a system that allows customers to scan items as they are placed into the shopping cart. At the checkout counter, all the customer has to do is swipe a credit card.

In the near future, many items may be equipped with radio frequency identification (RFID) tags (see Chapter 8), eliminating the need to scan each individual item, so that the total price for a cart full of merchandise can becalculated within a second, saving even more time and adding convenience for the customer. Imagine the time you’ll save when all you have to do is pass with your cart through an RFID reader and swipe your credit card.

Payment systems are also changing. A new “Pay by Fingerprint” system allows customers to complete a purchase by placing a finger onto a fingerprint scanner without the need to sign a sales slip or enter a personal identification number (PIN ); this makes the checkout process extremely convenient and secure. Another innovative way to pay for a purchase is via mobile phone. Using a technology called near-field communication (NFC; similar to Bluetooth), the customer’s mobile phone communicates with the retailer’s payment terminal, and the payment amount is automatically debited from the customer’s bank account. NFC-based payment systems have already begun to be implemented; major smartphone manufacturers such as Samsung, Nokia, Motorola, and HT C actively support this new technology by integrating it into new handsets.

Further, many brick-and-mortar retailers have had to respond to the phenomenon of showrooming, in which, as discussed earlier, customers examine products in person at a store and then leave to order the same product online for less. Retailers invest billions to build and maintain their storefronts, and online retailers can often undercut physical stores’ prices; when a customer takes advantage of this, the brick-andmortar retailer cannot recoup the cost of the storefront. Some retailers like Best Buy and Target are embracing this trend, however, by encouraging consumers to browse their shelves and compare prices online. By providing perks such as superior, personal customer service and instituting price-matching policies, these retailers prevent loss of customers due to price while benefiting by selling additional products. Other new and exciting in-store technologies include smart fitting rooms that use augmented reality technology to show how an item would look when worn or suggest complementary items. Finally, retail stores are increasingly using Bluetooth-enabled sales beacons to provide customers with real-time promotional offers.

As you can see, information systems have had a huge impact on retailing, and many more changes are yet to hit the shelves.

You may make many purchases online in order to benefit from greater convenience or lower prices, but you will likely set foot in a brick-and-mortar retail store at least occasionally, and you may have noticed some changes brought by technology. A few decades ago, large retail chains started introducing computerized point-of-sale inventory systems consisting of checkout computers and an inventory control system. A simple bar code scan captures a sale, and the item is automatically deducted from the store’s inventory, allowing real-time tracking of purchases so that the retailer knows when to reorder merchandise or restock shelves. In addition to a speedier checkout process, such systems help to reduce stockouts, increasing customer satisfaction. In many grocery stores, this system has been taken a step further, allowing the customers to conduct the checkout process themselves, saving time and labor costs. In Switzerland, grocery retailer Migros introduced a system that allows customers to scan items as they are placed into the shopping cart. At the checkout counter, all the customer has to do is swipe a credit card.

In the near future, many items may be equipped with radio frequency identification (RFID) tags (see Chapter 8), eliminating the need to scan each individual item, so that the total price for a cart full of merchandise can be calculated within a second, saving even more time and adding convenience for the customer. Imagine the time you’ll save when all you have to do is pass with your cart through an RFID reader and swipe your credit card.

Payment systems are also changing. A new “Pay by Fingerprint” system allows customers to complete a purchase by placing a finger onto a fingerprint scanner without the need to sign a sales slip or enter a personal identification number (PIN ); this makes the checkout process extremely convenient and secure. Another innovative way to pay for a purchase is via mobile phone. Using a technology called near-field communication (NFC; similar to Bluetooth), the customer’s mobile phone communicates with the retailer’s payment terminal, and the payment amount is automatically debited from the customer’s bank account. NFC-based payment systems have already begun to be implemented; major smartphone manufacturers such as Samsung, Nokia, Motorola, and HT C actively support this new technology by integrating it into new handsets.

Further, many brick-and-mortar retailers have had to respond to the phenomenon of showrooming, in which, as discussed earlier, customers examine products in person at a store and then leave to order the same product online for less. Retailers invest billions to build and maintain their storefronts, and online retailers can often undercut physical stores’ prices; when a customer takes advantage of this, the brick-andmortar retailer cannot recoup the cost of the storefront. Some retailers like Best Buy and Target are embracing this trend, however, by encouraging consumers to browse their shelves and compare prices online. By providing perks such as superior, personal customer service and instituting price-matching policies, these retailers prevent loss of customers due to price while benefiting by selling additional products. Other new and exciting in-store technologies include smart fitting rooms that use augmented reality technology to show how an item would look when worn or suggest complementary items. Finally, retail stores are increasingly using Bluetooth-enabled sales beacons to provide customers with real-time promotional offers.

As you can see, information systems have had a huge impact on retailing, and many more changes are yet to hit the shelves.

Help with an Introduction & Summary!!!!! Please!

In: Computer Science

XYZ Corporation, an Australian based carmaker, is considering an expansion into Asia after its expansion into...

XYZ Corporation, an Australian based carmaker, is considering an expansion into Asia after its expansion into the US last summer was highly successful. Currently, XYZ does export cars to Asia, but the increased demand raises the question of an expansion in Asia. XYZ is trying to decide whether to establish a car manufacturing plant and office in Japan where cars would be built and then sold across Asia.

All relevant data is given in the tables below. The cost of the expansion is Yen 80,000,000, which must be immediately expended. Three-year EBITDA are 35,000,000 45,000,000 and 55,000,000 respectively. Moreover, XYZ would have to fund additional working capital of Yen 5,000,000 at the time of the expansion. Further investment in net working capital would be Yen 5,000,000, Yen 8,000,000, and Yen 10,000,000 in year 1, 2, and 3 respectively. If it builds the plant, XYZ will depreciate it at a rate of Yen 4,000,000 per year (starting in year 1) and will have to fund additional capital expenditures of Yen 8,000,000 per year to maintain and improve the plant. Although the project is assumed to have an infinite life, cash-flows are only projected up to three years and the terminal value of the project is computed based on the year 3 free cash-flow (FCF) assuming a growth rate that equals the Japanese long-run GDP growth rate.

All taxes are paid in Japan in the year the income is earned. Tax treaties are in effect so that XYZ will have no tax obligations to the Australian Tax Office (ATO). The following information applies to the valuation.

Japan

Australia

Price Inflation

2.00%

3.00%

Annual return on government bonds

3.00%

4.00%

Corporate tax rate

40.00%

30.00%

Equity market risk premium AUD

6.00%

Spot rate-S(AUD/Yen)

0.01

Before tax cost of debt

5.00%

Debt-to-value ratio (D/V)

0.5

Systematic risk (beta)

1.2

Japanese long-run GDP growth rate

3%

WACC

12.80%

Required:

  1. Calculate the cost of capital, in Australia, for the project.   
  2. Calculate the forward exchange rates, F1(AUD/Yen) through F3(AUD/Yen), for the years 1, 2, and 3 based on the spot rate and the interest rates given in the question. (round to 5 decimal places)   
  3. Calculate the Free of Cash Flows of the project in Yen from year 1 to year 3.   
  4. What is the terminal value as of year 3? Use a perpetuity formula, the Free Cash Flows in Yen for year 3, and the Japanese growth rate assumption given in the question. Assume the appropriate discount rate is WACC.                              
  5. Calculate the AUD value of FCF for the years 0, 1, 2 and 3 and the terminal value   using the forward rates calculated in (b).
  6. What is the NPV of the project from XYZ's perceptive (in AUD)? Should XYZ expand into the Asian market?

In: Finance

The dataset for this assignment contains house prices as well as 19 other features for each...

The dataset for this assignment contains house prices as well as 19 other features for each property. Those features are detailed below and include information about the house (number of bedrooms, bathrooms…), the lot (square footage…) and the sale conditions (period of the year…) The overall goal of the assignment is to predict the sale price of a house by using a linear regression. For this assignment, the training set is in the file "house_prices_train.csv" and the test set is in the file "house_prices_test.csv"

Here is a brief description of each feature in the dataset:

  • SalePrice: the property's sale price in dollars. This is the target variable that you're trying to predict.
  • LotFrontage: Linear feet of street connected to property
  • LotArea: Lot size in square feet
  • YearBuilt: Original construction date
  • BsmtUnfSF: Unfinished square feet of basement area
  • TotalBsmtSF: Total square feet of basement area
  • 1stFlrSF: First Floor square feet
  • 2ndFlrSF: Second floor square feet
  • LowQualFinSF: Low quality finished square feet (all floors)
  • GrLivArea: Above grade (ground) living area square feet
  • FullBath: Full bathrooms above grade
  • HalfBath: Half baths above grade
  • BedroomAbvGr: Number of bedrooms above basement level
  • KitchenAbvGr: Number of kitchens
  • TotRmsAbvGrd: Total rooms above grade (does not include bathrooms)
  • GarageCars: Size of garage in car capacity
  • GarageArea: Size of garage in square feet
  • PoolArea: Pool area in square feet
  • MoSold: Month Sold
  • YrSold: Year Sold

I completed the code correctly for question 1a(Open the training dataset and remove all rows that contain at least one missing value (NA) & Return the new clean dataset and the number of rows in that dataset) but need help with the rest of the question. This is my code:

def clean_data():
import pandas as pd
data = pd.read_csv('house_prices_train.csv', index_col=0)
data_train = data.dropna()
nb_rows = data_train.shape[0]
  
return([nb_rows, data_train])

Question 1b:

For the training dataset, print a summary of the variables “LotArea”, “YearBuilt”, “GarageArea”, and “BedroomAbvGr” and “SalePrice”. Return the whole summary and a list containing (in that order):

  • The maximum sale price
  • The minimum garage area
  • The first quartile of lot area
  • The second most common year built
  • The mean of BedroomAbvGr

Hint: Use the built-in method describe() for a pandas.DataFrame

Here's the sample code i was given to start off:

def summary(data_train):
# Code goes here
# max_sale = maximum sale price in the training dataset
# min_garea = mining garage area
# fstq_lotarea = first quartile of lot area
# scd_ybuilt = second most common year built
# mean_bed = mean number of bedrooms above ground
### YOUR CODE HERE
return([max_sale, min_garea, fstq_lotarea, scd_ybuilt, mean_bed])

Question 1c:

Run a linear regression on "SalePrice" using the variables “LotArea”, “YearBuilt”, “GarageArea”, and “BedroomAbvGr”. For each variable, return the coefficient associated to the regression in a dictionary similar to this: {“LotArea”: 1.888, “YearBuilt”: -0.06, ...} (This is only an example not the right answer)

Compute the Root Mean Squared Error (RMSE) using the file "house_prices_test.csv" to measure the out-of-sample performance of the model.

################# Function to fit your Linear Regression Model ###################
def linear_regression_all_variables(data_train):
from sklearn import linear_model
  
# Code goes here
# dict_coeff = dictionnary (key = name of the variable, value = coefficient in the linear
# regression model)
# lreg = your linear regression model
###
### YOUR CODE HERE
###
  
return([dict_coeff, lreg])

Question 1d:

Refit the model on the training set using all the variables and return the RMSE on the test set.

(The first column "unnamed: 0" is not a variable)

################# Function to compute the Root Mean Squared Error ###################
def compute_mse_test(data_train, data_test):
from sklearn import linear_model, metrics
  
dict_coeff, lreg = linear_regression_all_variables(data_train)
###
### YOUR CODE HERE
###
# rmse = Root Mean Squared Error
return(rmse)

def linear_regression_all(data_train, data_test)

from sklearn import linear_model, metrics
  
#Code goes here
  
#rmse = root mean squared error of the second linear regression on the test dataset
###
### YOUR CODE HERE
###
rmse = np.sqrt(metrics.mean_squared_error(y_test, y_pred))
  
return (rmse)

In: Computer Science

Calculation of cost basis of a used machine

A used machine with a purchase price of $41,809, requiring an overhaul costing $9,833, installation costs of $6,615, and special acquisition fees of $32,417, would have a cost basis of

a. $139,539

b. $90,674

c. $51,642

d. $41,809

In: Accounting

​ An investment has an installed cost of $673.658

An investment has an installed cost of $673.658. The cash flows over the four year life of the investment are projected to be $228,701, $281,182, $219,209, and $190,376. 


Requirement 1: 

If the discount rate is zero, what is the NPV? (Do not round intermediate calculations.) 


Requirement 2: 

If the discount rate is infinite, what is the NPV? (Do not round intermediate calculations. Negative amount should be indicated by a minus sign.) 


Requirement 3: 

At what discount rate is the NPV just equal to zero? (Do not round intermediate calculations. Round your answer to 2 decimal places (e.g. 32.16).) 

In: Finance