Describe the implementation of the multiply instruction in the hypothetical machine designed by Wilkes. Use a narrative and a flowchart.
In: Computer Science
Java Programming
Task #1 Extending the BankAccount Class
Copy the files AccountDriver.java (Code Listing 10.1) and BankAccount.java(Code Listing 10.2) from the Student CD or as directed by your instructor.BankAccount.java is complete and will not need to be modified.
Create a new class called CheckingAccount that extends BankAccount.
It should contain a static constant FEE that represents the cost of clearing one
check. Set it equal to 15 cents.
Write a constructor that takes a name and an initial amount as parameters. It
should call the constructor for the superclass. It should initializeaccountNumber to be the current value in accountNumber concatenated with –10 (All checking accounts at this bank are identified by the extension –10). There can be only one checking account for each account number. Remember since accountNumber is a private member in BankAccount, it must be changed through a mutator method.
Write a new instance method, withdraw, that overrides the withdraw method in the superclass. This method should take the amount to withdraw, add to it the fee for check clearing, and call the withdraw method from the superclass. Remember that to override the method, it must have the same method heading. Notice that the withdraw method from the superclass returns true or falsedepending if it was able to complete the withdrawal or not. The method that overrides it must also return the same true or false that was returned from the call to the withdraw method from the superclass.
Compile and debug this class.
Task #2 Creating a Second Subclass
Create a new class called SavingsAccount that extends BankAccount.
It should contain an instance variable called rate that represents the annual
interest rate. Set it equal to 2.5%.
It should also have an instance variable called savingsNumber, initialized to 0.
In this bank, you have one account number, but can have several savings accounts with that same number. Each individual savings account is identified by the number following a dash. For example, 100001-0 is the first savings account you open, 100001-1 would be another savings account that is still part of your same account. This is so that you can keep some funds separate from the others, like a Christmas club account.
An instance variable called accountNumber, that will hide theaccountNumber from the superclass, should also be in this class.
Write a constructor that takes a name and an initial balance as parameters and calls the constructor for the superclass. It should initialize accountNumber to be the current value in the superclass accountNumber (the hidden instance variable) concatenated with a hyphen and then the savingsNumber.
Write a method called postInterest that has no parameters and returns no value. This method will calculate one month's worth of interest on the balance and deposit it into the account.
Write a method that overrides the getAccountNumber method in the superclass.
Write a copy constructor that creates another savings account for the same person. It should take the original savings account and an initial balance as parameters. It should call the copy constructor of the superclass, and assign thesavingsNumber to be one more than the savingsNumber of the original savings account. It should assign the accountNumber to be theaccountNumber of the superclass concatenated with the hyphen and thesavingsNumber of the new account.
Compile and debug this class.
Use the AccountDriver class to test out your classes. If you named and
created your classes and methods correctly, it should not have any difficulties. If you have errors, do not edit the AccountDriver class. You must make your classes work with this program.
Running the program should give the following output:
Account Number 100001-10 belonging to Benjamin Franklin Initial balance = $1000.00 After deposit of $500.00, balance = $1500.00 After withdrawal of $1000.00, balance = $499.85
Account Number 100002-0 belonging to William Shakespeare Initial balance = $400.00 After deposit of $500.00, balance = $900.00 Insufficient funds to withdraw $1000.00, balance = $900.00 After monthly interest has been posted, balance = $901.88
Account Number 100002-1 belonging to William Shakespeare Initial balance = $5.00 After deposit of $500.00, balance = $505.00 Insufficient funds to withdraw $1000.00, balance = $505.00
Account Number 100003-10 belonging to Isaac Newton
Code Listing 10.1 (AccountDriver.java)
/** This program demonstrates the BankAccount and derived classes.
*/
public class AccountDriver
{
public static void main(String[] args)
{
double put_in = 500;
double take_out = 1000;
String money;
String money_in;
String money_out;
boolean completed;
// Test the CheckingAccount class.
CheckingAccount myCheckingAccount =
new CheckingAccount("Benjamin Franklin", 1000);
System.out.println("Account Number " +
myCheckingAccount.
getAccountNumber() +
" belonging to " +
myCheckingAccount.getOwner());
money = String.format("%.2f",
myCheckingAccount.
getBalance());
System.out.println("Initial balance = $" + money);
myCheckingAccount.deposit(put_in);
money_in = String.format("%.2f", put_in);
money = String.format("%.2f",
myCheckingAccount.
getBalance());
System.out.println("After deposit of $" +
money_in + ", balance = $" +
money);
completed = myCheckingAccount.withdraw(take_out);
money_out = String.format("%.2f", take_out);
Copyright © 2016 Pearson Education, Inc., Hoboken NJ
money = String.format("%.2f",
myCheckingAccount.
getBalance());
if (completed)
{
System.out.println("After withdrawal of $" +
money_out + ", balance = $" +
money);
} else {
System.out.println("Insuffient funds to " +
"withdraw $" + money_out +
", balance = $" + money);
} System.out.println();
// Test the SavingsAccount class. SavingsAccount yourAccount =
new SavingsAccount("William Shakespeare", 400);
System.out.println("Account Number " +
yourAccount.getAccountNumber() +
" belonging to " +
yourAccount.getOwner());
money = String.format("%.2f",
yourAccount.getBalance());
System.out.println("Initial balance = $" + money);
yourAccount.deposit(put_in);
money_in = String.format("%.2f", put_in);
money = String.format("%.2f",
yourAccount.getBalance());
System.out.println("After deposit of $" +
money_in + ", balance = $" +
money); completed = yourAccount.withdraw(take_out);
Copyright © 2016 Pearson Education, Inc., Hoboken NJ
money_out = String.format("%.2f", take_out);
money = String.format("%.2f",
yourAccount.getBalance());
if (completed)
{
System.out.println("After withdrawal of $" +
money_out + ", balance = $" +
money);
} else {
System.out.println("Insuffient funds " +
"to withdraw $" + money_out +
", balance = $" + money);
}
yourAccount.postInterest();
money = String.format("%.2f",
yourAccount.getBalance());
System.out.println("After monthly interest " +
"has been posted, " +
"balance = $" + money); System.out.println();
// Test the copy constructor of the // SavingsAccount class. SavingsAccount secondAccount =
new SavingsAccount(yourAccount, 5);
System.out.println("Account Number " +
secondAccount.
getAccountNumber() +
" belonging to " +
secondAccount.getOwner());
money = String.format("%.2f",
secondAccount.getBalance());
System.out.println("Initial balance = $" + money);
secondAccount.deposit(put_in);
} }
money_in = String.format("%.2f", put_in);
money = String.format("%.2f",
secondAccount.getBalance());
System.out.println("After deposit of $" + money_in +
", balance = $" + money);
secondAccount.withdraw(take_out);
money_out = String.format("%.2f", take_out);
money = String.format("%.2f",
secondAccount.getBalance());
if (completed)
{
System.out.println("After withdrawal of $" +
money_out + ", balance = $" +
money);
} else {
System.out.println("Insuffient funds " +
"to withdraw $" + money_out +
", balance = $" + money);
} System.out.println();
// Test to make sure new accounts are // numbered correctly. CheckingAccount yourCheckingAccount =
new CheckingAccount("Issac Newton", 5000);
System.out.println("Account Number " +
yourCheckingAccount.
getAccountNumber() +
" belonging to " + yourCheckingAccount.getOwner());
Code Listing 10.2 (BankAccount.java)
/** The BankAccount class is an abstract class that holds general data about a bank account. Classes representing specific types of bank accounts should inherit from this class.
*/
public abstract class BankAccount
{
// Class variable so that each account // has a unique number protected static int numberOfAccounts = 100001;
// Current balance in the account private double balance;
// Name on the account private String owner;
// Number bank uses to identify account private String accountNumber;
/**
Default constructor
*/
public BankAccount()
{
balance = 0;
accountNumber = numberOfAccounts + "";
numberOfAccounts++;
}
/** Standard constructor @param name The owner of the account. @param amount The beginning balance.
*/
public BankAccount(String name, double amount)
{
owner = name; balance = amount; accountNumber = numberOfAccounts + ""; numberOfAccounts++;
}
/** Copy constructor creates another account for the same owner. @param oldAccount The account with information
to copy. @param amount The beginning balance of the
new account.
*/
public BankAccount(BankAccount oldAccount,
double amount)
{
owner = oldAccount.owner;
balance = amount;
accountNumber = oldAccount.accountNumber;
}
/** Allows you to add money to the account. @param amount The amount to deposit in the account.
*/
public void deposit(double amount)
{
balance = balance + amount; }
Copyright © 2016 Pearson Education, Inc., Hoboken NJ
/** Allows you to remove money from the account if enough money is available, returns true if the transaction was completed, returns false if there was not enough money. @param amount The amount to withdraw from
the account. @return True if there was sufficient funds to
complete the transaction, false otherwise.
*/
public boolean withdraw(double amount)
{
boolean completed = true;
if (amount <= balance)
{
balance = balance - amount; }
else {
completed = false; }
return completed; }
/** Accessor method to balance @return The balance of the account.
*/
public double getBalance()
{
return balance; }
/** accessor method to owner @return The owner of the account.
*/
public String getOwner()
{
return owner; }
/** Accessor method to account number @return The account number.
*/
public String getAccountNumber()
{
return accountNumber; }
/**
Mutator method to change the balance
@param newBalance The new balance for the account.
*/
public void setBalance(double newBalance)
{
balance = newBalance; }
/**
Mutator method to change the account number
@param newAccountNumber The new account number.
*/
public void setAccountNumber(String newAccountNumber)
{
accountNumber = newAccountNumber; }
}
In: Computer Science
Please explain how the proportions for two populations are used in hypotheses testing about two population proportions. Please give an example.
In: Math
Write about Oracle product of Database product. your findings should include
Usage, new server versions, Advantages, Disadvantage ,components Server and workstations, Physical structure Logical structure, Portability, Backup Recovery Performance and References
In: Computer Science
Serial Problem Business Solutions LO P1, P2, P3, P4, P5
After the success of the company’s first two months, Santana Rey continues to operate Business Solutions. The November 30, 2017, unadjusted trial balance of Business Solutions (reflecting its transactions for October and November of 2017) follows.
| No. | Account Title | Debit | Credit | |||
| 101 | Cash | $ | 39,264 | |||
| 106 | Accounts receivable | 13,418 | ||||
| 126 | Computer supplies | 2,645 | ||||
| 128 | Prepaid insurance | 2,040 | ||||
| 131 | Prepaid rent | 2,920 | ||||
| 163 | Office equipment | 8,100 | ||||
| 164 | Accumulated depreciation—Office equipment | $ | 0 | |||
| 167 | Computer equipment | 23,200 | ||||
| 168 | Accumulated depreciation—Computer equipment | 0 | ||||
| 201 | Accounts payable | 0 | ||||
| 210 | Wages payable | 0 | ||||
| 236 | Unearned computer services revenue | 0 | ||||
| 307 | Common stock | 66,000 | ||||
| 318 | Retained earnings | 0 | ||||
| 319 | Dividends | 6,100 | ||||
| 403 | Computer services revenue | 37,474 | ||||
| 612 | Depreciation expense—Office equipment | 0 | ||||
| 613 | Depreciation expense—Computer equipment | 0 | ||||
| 623 | Wages expense | 2,450 | ||||
| 637 | Insurance expense | 0 | ||||
| 640 | Rent expense | 0 | ||||
| 652 | Computer supplies expense | 0 | ||||
| 655 | Advertising expense | 1,638 | ||||
| 676 | Mileage expense | 664 | ||||
| 677 | Miscellaneous expenses | 250 | ||||
| 684 | Repairs expense—Computer | 785 | ||||
| Totals | $ | 103,474 | $ | 103,474 | ||
Business Solutions had the following transactions and events in December 2017.
| Dec. | 2 | Paid $960 cash to Hillside Mall for Business Solutions’ share of mall advertising costs. | |
| 3 | Paid $430 cash for minor repairs to the company’s computer. | ||
| 4 | Received $4,750 cash from Alex’s Engineering Co. for the receivable from November. | ||
| 10 | Paid cash to Lyn Addie for six days of work at the rate of $120 per day. | ||
| 14 | Notified by Alex’s Engineering Co. that Business Solutions’ bid of $7,500 on a proposed project has been accepted. Alex’s paid a $2,100 cash advance to Business Solutions. | ||
| 15 | Purchased $1,500 of computer supplies on credit from Harris Office Products. | ||
| 16 | Sent a reminder to Gomez Co. to pay the fee for services recorded on November 8. | ||
| 20 | Completed a project for Liu Corporation and received $6,425 cash. | ||
| 22–26 | Took the week off for the holidays. | ||
| 28 | Received $3,600 cash from Gomez Co. on its receivable. | ||
| 29 | Reimbursed S. Rey for business automobile mileage (600 miles at $0.25 per mile). | ||
| 31 | The company paid $1,300 cash in dividends. | ||
The following additional facts are collected for use in making adjusting entries prior to preparing financial statements for the company’s first three months:
Required:
5. Prepare a statement of retained earnings for
the three months ended December 31, 2017.
6. Prepare a balance sheet as of December 31,
2017.
7. Record and post the necessary closing entries
as of December 31, 2017.
8. Prepare a post-closing trial balance as of
December 31, 2017.
In: Accounting
1)
How many kJ of energy are required to transform 30.00 moles of solid benzene at -20.00 °C to
gaseous benzene at 140.0 °C?
2)
Consider He, CaS, CH4, LiF, CaO, diamond, H2O, CH3CH2OH, LiCl, and CH3OCH3. Arranged
in increasing melting point, these are:
In: Chemistry
You have a daily demand for business cards of 5 units, and you are ordering your business cards from Business Card Kings, who charges $2 per card and $55 per order. For the calculation of your holding cost you think that an annual interest rate of 30% is reasonable. Suppose that you will use EOQ model. Note: Throughout this problem, you are required to round all solutions (intermediary results and the final answers) to integers.
Now suppose that Business Card Kings provides a quantity discount: if you order less than 400 (including 400), it is $2 per card; but if you order more than 400, it is $1.25 per card.
Now suppose that the order delivery lead-time from Business Card Kings is two weeks.
In: Operations Management
Do research to assess potential career opportunities in the telecommunications or networking industry. Consider resources such as the Bureau of Labor Statistics list of fastest growing positions, Network World, and Computerworld. Are there particular positions within these industries that offer good opportunities? What sort of background and education is required for candidates for these positions?
In: Computer Science
Predict the products of the following reactions and then balance the equation. Make sure to put in the phases of the products. Pb(NO3)2 (aq) + Na3PO4 (aq) →
A. For the above equation, write the complete ionic and net ionic equations.
B. If you have a 2.5 M solution of lead (II) nitrate, and a 3.5 M solution of sodium phosphate, how much of the two solutions will you need to make 11.5 g of the product that precipitates?
C. To make the two solutions how many grams of each will you need?
D. What are the spectator ions and will be the final molarity of the compound made up of the spectator ions?
In: Chemistry
The following is information for Flounder Corp. for the year ended December 31, 2020: Sales revenue $1,480,000 Loss on inventory due to decline in net realizable value $74,000 Unrealized gain on FV-OCI equity investments 44,000 Loss on disposal of equipment 35,000 Interest income 7,000 Depreciation expense related to buildings omitted by mistake in 2019 53,000 Cost of goods sold 888,000 Retained earnings at December 31, 2019 990,000 Selling expenses 74,000 Loss from expropriation of land 60,000 Administrative expenses 50,000 Dividends declared 43,000 Dividend revenue 18,000 The effective tax rate is 30% on all items. Flounder prepares financial statements in accordance with IFRS. The FV-OCI equity investments trade on the stock exchange. Gains/losses on FV-OCI investments are not recycled through net income.
a) Prepare a multiple-step statement of financial performance for 2020, showing expenses by function. Ignore calculation of EPS.
b) Prepare the retained earnings section of the statement of changes in equity for 2020. (List items that increase retained earnings first following the adjustment of prior years.)
c) Prepare the journal entry to record the depreciation expense omitted by mistake in 2019. (Credit account titles are automatically indented when the amount is entered. Do not indent manually.)
In: Accounting
QUESTION 1 CASE
The coronavirus pandemic is a human tragedy, affecting hundreds of thousands of people globally. It is also having a growing impact on the global value chain, hence the global economy. All serious companies around the world have therefore found innovative ways of keeping business going nonetheless. One of such notable companies is Ghana’s Kantanka Inc. The company has established a dedicated team to ensure a simple but well- managed set of processes that maximize the health and safety of colleagues and customers. This team is led by the CEO of the company. The focus of the team has been broken down into five distinct work streams: Employee management and wellbeing Financial stress-testing and contingency planning Supply chain monitoring Marketing and sales Any other business Kantanka Inc. is a car manufacturing company originating from Ghana which produces low-end vehicles. The company’s competitive advantage stems from its unconventional but effective and energy efficient technology which is not found in most vehicles around the world. The dashboard and other interior parts of the vehicles are made from wood, and the vehicles are powered by car batteries and solar energy. Recently, they have added on aircrafts and mechanized farming technologies. The company is set to take the African market by storm. The company decided in 2015 to enter Nigeria and Germany. With the backing of the government of Ghana, negotiations with both countries succeeded as negotiators from Nigeria and Germany were in natural sync with the Ghanaian lobbyist contracted. Once the company has gone international, it was only natural that value chain activities of the company would have to be rationalized to deal with the expansion, as well as all forms of risk with respect to exchange rate fluctuations. Speaking of financials, in this coronavirus pandemic period, companies such as Kantanka Inc. that entered into future contracts and used currency options as hedging instruments would have less to worry about since excuses from business partners would almost be non-existent. Recently in 2017, a company from Sậo Tome and Principé, called PreZi contacted Kantanka Inc. to obtain permission to use its technology. As to whether to agree or not to the agreement is still under scrutiny by Kantanka’s international expansion team.
a) Discuss five (5) ways the two negotiators can get along in order for their cultural backgrounds not to affect the outcome of their bargaining process.
b) Explain three (3) financial risks Kantanka Inc would definitely encounter.
c) What five (5) benefits is Kantanka Inc likely to gain from entering the German market?
d) Explain five (5) problems Kantanka Inc’s international expansion team should anticipate before entering the German market.
e) Explain the contractual strategy that would best characterize the Kantanka-PreZi agreement once agreed to.
In: Operations Management
The Hyundai Blue-Will Plug-In hybrid is a compact 4-door, 4-seat
sedan.It is a test bed of new ideas, including panoramic glass roof
with solar
cells for recharging batteries, a thermal generator that converts
hot exhaust gases into electricity, drive-by-wire steering, lithium
polymer
batteries, and touch screen controls. Blue-Will promises an EV
driving range up to 40 miles on a charge and an economy rating up
to 100 mpg.
Helping to achieve those numbers is a direct injection 1.6 liter
152-hp four, a CVT and a 100 kw electric motor..
1. A Hyundai Blue-Will hybrid is capable of an acceleration of 4.3 m/s. It has a mass of 770 kilograms of steel, 180 kilograms of iron, 110 kilograms of plastics, 80 kilograms of aluminum, 60 kilograms of rubber, 20 kilograms of glass, and 8 kilograms of other materials. The driver has a mass of 85 kg. a Sketch the system of the Blue Will b.Sketch the system of the driver c. What is the force on the driver from the acceleration? d.Compare the force of the car on the driver to the driver’s weight, using a ratio. 2. The Hyundai Blue Will hybrid is driving at a velocity of 125 kph, and crashes into another car traveling at a velocity of 35 kph. Assuming the drivers are of comparable mass, and the car bumpers lock on impact: a. What is the final velocity of the cars? b. If the famous Blue Will crashes into a tree, instead, in 2.6 seconds, what is the impulse? c. What is the total force exerted by the tree in stopping the Blue Will? 3. The Famous Blue Will hybrid is being driven at a velocity of 75 kph when the driver sees a tree ahead. a. The driver locks his brakes, causing the car to skid. The coefficient of friction of rubber on dry concrete is 1.0 (static) and 0.7 (kinetic). How much force will the brakes apply to the car? What difference would it make if the driver pumped the brakes? b. After 1.0 second of braking, what will be the car’s velocity? c. How far in advance will the driver need to start braking to avoid the tree? 4. The Hyundai has about the same drag as a Camry (about 0.36) and air has a density of about 1.21 kg/m3. The cross section of the Hyundai is about 1.5 m × 1.5 m. Take the torque provided by the engine at speed as about 250 lbf. a. What is the force applied by air resistance at 75 kph? b. Would this help the driver avoid hitting the tree in the previous problem? Why or why not? c. What is the maximum velocity of the car? Is this answer reasonable? Why or why not?
In: Physics
Hello so I have written this Quicksort code, but it only seems to work when the array size is 100 or less. If it goes over than it takes forever to run and never completes. Please help debug and fix.
public class Test {
public static void main(String[] args) {
int[] myArray = new int[]{5, 10, 12, 55, 24, 90, 52, 900};
System.out.println("Before Sort");
printArray(myArray);
System.out.println("Quicksorted");
quickSort(myArray, 0, myArray.length - 1);
printArray(myArray);
}
public static void quickSort(int array[], int low, int high) {
if (low < high) {
int partitionPoint = partition(array, low, high);
quickSort(array, low, partitionPoint - 1);
quickSort(array, partitionPoint + 1, high);
}
}
public static int partition(int array[], int low, int high) {
int pivot = array[low];
int i = low;
int j = high;
while (i < j) {
while (array[i] < pivot) {
i++;
}
while (array[j] > pivot) {
j--;
}
if (i < j) {
int temp = array[j];
array[j] = array[i];
array[i] = temp;
}
}
int temp = array[j];
array[j] = pivot;
pivot = temp;
return j;
}
public static void printArray(int[] array) {
for (int i = 0; i < array.length; i++) {
System.out.println(array[i] + " ");
}
}
}
Thank you!
In: Computer Science
Using the USPRES.TXT file complete the following:
Create a dialog where a user would select 'search by last name' and 'search by first name'.
use a select statement to determine which routine your will run. You can use procedures and functions if you want.Ensure your code is well documented.
Turn in all work.
Using the USPRES.TXT file complete the following:
Create a dialog where a user would select 'search by last name' and 'search by first name'.
use a select statement to determine which routine your will run. You can use procedures and functions if you want.Ensure your code is well documented.
Turn in all work.
[George Washington
John Adams
Thomas Jefferson
James Madison
James Monroe
John Q. Adams
Andrew Jackson
Martin Van Buren
William Harrison
John Tyler
James Polk
Zachary Taylor
Millard Fillmore
Franklin Pierce
James Buchanan
Abraham Lincoln
Andrew Johnson
Ulysses Grant
Rutherford Hayes
James Garfield
Chester Arthur
Grover Cleveland
Benjamin Harrison
Grover Cleveland
William McKinley
Theodore Roosevelt
William Taft
Woodrow Wilson
Warren Harding
Calvin Coolidge
Herbert Hoover
Franklin Roosevelt
Harry Truman
Dwight Eisenhower
John Kennedy
Lyndon Johnson
Richard Nixon
Gerald Ford
James Carter
Ronald Reagan
George H. W. Bush
Bill Clinton
George W. Bush
Barack Obama]
Update
Case statement for each of the options.
Search for President by first name or last name.
** open file, read in each row, parse out the name part, perform a match on names, if match return full name, else move to next row. Have message if you each the end without a match.
USE METHODS!
Update
Case statement for each of the options.
Search for President by first name or last name.
** open file, read in each row, parse out the name part, perform a match on names, if match return full name, else move to next row. Have message if you each the end without a match.
USE METHODS!
I NEED TO WRITE JAVA PROJECT IN THIS QUESTION
In: Computer Science
Holly Hiker goes for a walk which consists of three parts:
1: Walks 6.00km at an angle of 60.0 degrees west of north
2: sits for lunch for 30 minutes
3: Walks 4.00km at an angle of 75.0 degrees north of west for 45 mins ( or 0.75 hours)
a) draw a vector diagram showing Holly's walk. Include both legs and the resultant
b) Write the two walking legs of the trip in unit vector notation
c) Find Holly's displacement and average velocity( in both polar and unit vector notation)
Thanks so much in advance!!
In: Physics