Questions
C++ using vectors. in the following code, if a user adds duplicate names the votes should...

C++ using vectors.

in the following code, if a user adds duplicate names the votes should be added to only one of the names:

example

display "Enter candidate name: "

input john

display "Enter candidate vote:"

input 10

display "Enter candidate name: "

input john

display "Enter candidate vote:"

input 10

so the output has to be

john with 20 votes.

#include<iostream>

#include<iterator>

#include<string>

#include<algorithm>

#include<array>

#include<ctime>

#include <vector>

#include<bits/stdc++.h>

using namespace std;

int max_element(const vector<int>&stuff)

{

int max_index =0;

for (int i=1; i<stuff.size();++i)

if (stuff[i]>stuff[max_index])

max_index=i;

return max_index;

}

template <typename type>

void show(const vector<type>&stuff)

{

for (int i=0; i<stuff.size(); i++)

cout <<stuff[i]<<' ';

}

int main()

{

vector<string> names;

vector<int> votes;


string name;

int vote;

int size=5;

for (int i=0; i<size;++i)

{

cout<<"enter candidates "<< i+1<<" name: ";

getline(cin, name,'\n');

cout<<"Enter "<<name<< "'s votes ";

cin>>vote;

cin.get();

names.push_back(name);

votes.push_back(vote);

}

  

for (int k=0; k<size;++k)

{

sort(names.begin(),names.end());

if (names[k-1]==names[k]){

return votes[k];

cout<<"votes "<<votes[k]<<endl;

}

}

int max_index= max_element(votes);

for (int j=0;j<size;++j){

if (votes[j]==votes[max_index])

cout<<"The winners list is bellow "<< names[j]<<endl;

}

return 0;

}

In: Computer Science

Instructions Write a program in C++ that create a LookupNames project. In the main function: Ask...

Instructions

Write a program in C++ that create a LookupNames project.

In the main function:
Ask the user to enter a number of names, X to quit input.
Store the names in an array.
Also use a counter variable to count the number of names entered.

Write a function displayNames to display the names.
The function must receive the array and the counter as parameters.

Write a function called lookupNames.
The function must receive the array and the counter as parameters.
Ask the user to enter a letter.
Display all the names with the letter that was entered as the first letter of the name.

Call the displayNames and lookupNames functions from the main function.


Tip: declare your functions above the main() function:

void displayNames(char array[][60], int count)
{
// function code here
}

int main()
{
// main code here
displayNames(names, number);
// possible more code here
}

Tip2: make sure your function parameter matches the data type you send as an argument to that function.
In the above example, names and array should have the same data type, and number and count should have the same data type.


Enter name (X to quit input): John Peterson
Enter name (X to quit input): Diane Lee
Enter name (X to quit input): James Smith
Enter name (X to quit input): Frank Xaba
Enter name (X to quit input): Jacky Mokabe
Enter name (X to quit input): x


List of Names

John Peterson
Diane Lee
James Smith
Frank Xaba
Jacky Mokabe

Enter a letter: J

Names starting with the letter J

John Peterson
James Smith
Jacky Mokabe

In: Computer Science

Financing Deficit Stevens Textile Corporation's 2016 financial statements are shown below: Balance Sheet as of December...

Financing Deficit

Stevens Textile Corporation's 2016 financial statements are shown below:

Balance Sheet as of December 31, 2016 (Thousands of Dollars)

Cash $ 1,080 Accounts payable $ 4,320
Receivables 6,480 Accruals 2,880
Inventories 9,000 Line of credit 0
   Total current assets $16,560 Notes payable 2,100
Net fixed assets 12,600    Total current liabilities $ 9,300
Mortgage bonds 3,500
Common stock 3,500
Retained earnings 12,860
   Total assets $29,160    Total liabilities and equity $29,160

Income Statement for January 1 - December 31, 2016 (Thousands of Dollars)

Sales $36,000
Operating costs 32,440
   Earnings before interest and taxes $ 3,560
Interest 460
   Pre-tax earnings $ 3,100
Taxes (40%) 1,240
Net income $ 1,860
Dividends (45%) $  837
Addition to retained earnings $ 1,023

Suppose 2017 sales are projected to increase by 25% over 2016 sales. Use the forecasted financial statement method to forecast a balance sheet and income statement for December 31, 2017. The interest rate on all debt is 9%, and cash earns no interest income. Assume that all additional debt in the form of a line of credit is added at the end of the year, which means that you should base the forecasted interest expense on the balance of debt at the beginning of the year. Use the forecasted income statement to determine the addition to retained earnings. Assume that the company was operating at full capacity in 2016, that it cannot sell off any of its fixed assets, and that any required financing will be borrowed as a line of credit. Also, assume that assets, spontaneous liabilities, and operating costs are expected to increase by the same percentage as sales. Determine the additional funds needed. Round your answers to the nearest dollar. Do not round intermediate calculations.

Total assets ______ $
AFN ________ $

What is the resulting total forecasted amount of the line of credit? Round your answer to the nearest dollar. Do not round intermediate calculations.
Line of credit _______$

In: Finance

Your answer is partially correct. Try again. The condensed financial statements of Sheridan Company for the...

Your answer is partially correct. Try again.

The condensed financial statements of Sheridan Company for the years 2016 and 2017 are presented as follows. (Amounts in thousands.)

SHERIDAN COMPANY
Balance Sheets
December 31

2017

2016

Current assets
   Cash and cash equivalents

$330

$360

   Accounts receivable (net)

660

590

   Inventory

660

590

   Prepaid expenses

120

160

     Total current assets

1,770

1,700

Investments

200

200

Property, plant, and equipment (net)

420

380

Intangibles and other assets

530

510

     Total assets

$2,920

$2,790

Current liabilities

$1,090

$980

Long-term liabilities

610

580

Stockholders’ equity—common

1,220

1,230

     Total liabilities and stockholders’ equity

$2,920

$2,790

SHERIDAN COMPANY
Income Statements
For the Year Ended December 31

2017

2016

Sales revenue

$4,000

$3,660

Costs and expenses
   Cost of goods sold

1,145

1,080

   Selling & administrative expenses

2,400

2,330

   Interest expense

25

20

     Total costs and expenses

3,570

3,430

Income before income taxes

430

230

Income tax expense

129

69

Net income

$ 301

$ 161


Compute the following ratios for 2017 and 2016. (Round current ratio and inventory turnover to 2 decimal places, e.g. 1.83 and all other answers to 1 decimal place, e.g. 1.8 or 12.6%.)

(a) Current ratio.
(b) Inventory turnover. (Inventory on 12/31/15 was $410.)
(c) Profit margin.
(d) Return on assets. (Assets on 12/31/15 were $2,230.)
(e) Return on common stockholders’ equity. (Stockholders’ equity on 12/31/15 was $980.)
(f) Debt to assets ratio.
(g) Times interest earned.

2017

2016

Current ratio. :1 :1
Inventory turnover. times times
Profit margin. % %
Return on assets. % %
Return on common stockholders’ equity. % %
Debt to assets ratio. % %
Times interest earned. times times

In: Accounting

Reda Bhd is a company engaging in palm oil plantation which is based in Pahang. On...

Reda Bhd is a company engaging in palm oil plantation which is based in Pahang. On 1
January 2010, the company acquired a factory building and a machine at a cost of
RM4,000,000 and RM800,000 respectively. The estimated useful life of the factory building
and the machine were as follows:
Factory building 50 years
Machine 20 years
Depreciation for all the assets is computed based on the straight-line method. The company
applied the revaluation model for all its property, plant and equipment. The followings are the
relevant information of the machine and the factory building.
Machine
On 30 November 2014, the operation manager of the company has proposed to the board of
directors, a new machine to replace the old machine. The new machine is equipped with the
latest technology which can increase the production capacity of the company. In line with this
decision, the company decided to conduct impairment test for the old machine.
As at 31 December 2014, Reda Bhd received a few offers from other factories to purchase
the available machine at RM500,000. Disposal cost for the machine is RM50,000. The value
in use is approximately RM750,000.
Factory building
At the end of 2016, the carrying value of the factory building was as follows:
RM
Net revalued amount as at 31 December 2014 4,500,000
Accumulated depreciation (From year 2015 to 2016) (200,000)
Impairment loss as at 31 December 2016 (600,000)
Carrying value as at 31 December 2016 3,700,000
The factory building was revalued on 31 December 2014 at RM4,500,000. During the year
2019, there were indications that the impairment loss recognised in 2016 may have been
reversed. The estimated recoverable amount is RM4,300,000.

Calculate the followings:
i. The impairment loss for the machine as at 31 December 2014.

ii. The amount of the reversal of impairment loss to be recognised in the Statement
of Profit or Loss for the factory building as at 31 December 2019. Show all
workings.

c. Prepare the journal entries to record the reversal of impairment loss for the factory
building as at 31 December 2019.

In: Accounting

On December 31, 2016, Gary Company had 50,000 shares of common stock outstanding for the entire...

On December 31, 2016, Gary Company had 50,000 shares of common stock outstanding for the entire year. On March 1, 2017, Gary purchased 2,400 shares of common stock on the open market as treasury stock paying $45 per share. Gary sold 600 of the treasury shares on June 1, 2017, for $47 per share. Gary issued a 10% common stock dividend on 7/2/2017.

In addition, Gary had 3,000 shares of 9%, $50 par value, noncumulative convertible preferred stock outstanding at December 31, 2016. Preferred dividends for 2017 amounted to $13,500. Each convertible preferred stock can be converted into two shares of common stock. No convertible preferred stock had been converted by 12/31/2017.

Net income for 2017 was $180,905. The income tax rate is 30%. Other relevant information is as follows:

Outstanding at December 31, 2016, were stock option giving key personnel the option to buy 20,000 (adjusted for the stock dividends) common shares at $40. During 2017, the average market price of the common shares was $50 (adjusted for the stock dividends on December 31, 2017. No stock option was exercised during the year.

$100,000, 9% bonds were issued at a premium on December 20, 2016. None of the bonds had been converted by December 31, 2017. Bond interest expense of $8,700 was recorded in 2017. The premium is being amortized at $300 in 2017. Each $1,000 bond is convertible into 20 shares of common stock.

$500,000 of 8% bonds was issued at a discount on October 10, 2016. None of the bonds had been converted by December 31, 2017. Each $1,000 bond is convertible into 24 shares of common stock.

(a)Compute the weighted average shares of 2017 for Gary Company.

(b)Compute the basic and diluted earnings per share of 2017 for Gary company

In: Accounting

Using the data for Brady and Co. provided in the sheet labeled "Trial Balance" prepare Statement...

Using the data for Brady and Co. provided in the sheet labeled "Trial Balance" prepare Statement of Retained Earnings for 2016.

2016
Dr Cr
Accounts Payable     1,079,837
Accounts Receivable     3,245,967
Accrued Liabilities - Other        721,358
Accrued Pension Liabilities        450,356
Accrued Restructuring Charges           90,476
Accrued Salaries, Wages and Commissions        350,191
Accumulated Other Comprehensive Income (Loss)           85,000
Accumulated Depreciation - Property, Plant & Equipment     1,999,999
Accumulated Post-Employment Benefit Obligation (long-term)        402,634
Additional Paid-in Capital, Common Stock        299,304
Additional Paid-in Capital, Preferred Stock                  75
Allowance for Doubtful Accounts        124,645
Bonds Payable        249,046
Cash and Cash Equivalents        751,329
Common Stock ($1.00 par value) authorized 900 million shares issued 300 million shares in 2016, 284 million in 2015        284,000
Cost of Goods Sold     2,763,584
Current Portion of Long-term Debt        849,869
Deferred Tax Assets (current)           81,236
Deferred Tax Liabilities (long-term)        440,263
Depreciation Expense        311,236
Dividends - Common        214,956
Dividends - Preferred                945
General & Administrative Expenses     1,459,695
Goodwill and Other Intangibles     3,212,491
Income Taxes Payable        102,563
Interest Expense        250,000
Interest Income           18,227
Investments in unconsolidated affiliated companies     1,456,896
Inventories        224,561
Long-term Debt     3,702,700
(Loss) Income from Discontinued Operations, net of tax             7,453
Preferred Stock ($10 par value) authorized 10 million shares issued 90,000 shares in 2016, 90,000 in 2015                900
Prepaid Expenses        170,296
Property, Plant and Equipment     3,936,726
Provision for income taxes        201,636
Research and Development Expenses        496,597
Restructuring Charges        255,013
Retained Earnings, beginning     5,173,286
Sales     6,526,967
Selling Expenses           58,890
Short-term Investments           26,800
Treasury Stock, at cost - 117,156,719 shares in 2016 and 108,822,953 shares in 2015     4,263,984
Unearned Revenues        423,689
23,382,838 23,382,838

In: Accounting

att Winne issued $ 600 comma 000$600,000 of 1717?%, 1010?-year bonds payable on January? 1, 20162016....

att Winne

issued

$ 600 comma 000$600,000

of

1717?%,

1010?-year

bonds payable on January? 1,

20162016.

The market interest rate at the date of issuance was

1414?%,

and the bonds pay interest semiannually.

LOADING...

?(Click the icon to view the Present Value of? $1 table.)

LOADING...

?( Click the icon to view thePresent Value of Annuity of? $1 table.)

LOADING...

?(Click the icon to view the Future Value of? $1 table.)          

LOADING...

?(Click the icon to view the Future Value of Annuity of? $1 table.)Read the requirements

LOADING...

.

Requirement 1. How much cash did the company receive upon issuance of the bonds? payable? ?(Use the factor tables provided with factors rounded to three decimal places. Round all currency amounts to the nearest whole? dollar.)

Upon issuance of the bonds? payable, the company received

?$nothing .

Requirement 2. Prepare an amortization table for the bond using the? effective-interest method, through the first two interest payments. ?(Round all numbers to the nearest whole? dollar.)

Save Accounting Table... +
Copy to Clipboard... +

Interest

Carrying

Cash Paid

Expense

Amortized

Amount

01/01/2016

06/30/2016

12/31/2016

Requirement 3. Journalize the issuance of the bonds on January? 1,

20162016?,

and payment of the first semiannual interest amount and amortization of the bond on June? 30,

20162016.

Explanations are not required. ?(Record debits? first, then credits. Exclude explanations from any journal? entries.)Start by journalizing the issuance of the bonds on January? 1,

20162016.

? (Prepare a single compound? entry.)

??

Save Accounting Table... +
Copy to Clipboard... +

Date

Accounts

Debit

Credit

2016

Jan. 1

Journalize the payment of the first semiannual interest amount and amortization of the bond on June? 30,

20162016.

? (Prepare a single compound? entry.)

Save Accounting Table... +
Copy to Clipboard... +

Date

Accounts

Debit

Credit

2016

Jun. 30

In: Accounting

Financing Deficit Stevens Textile Corporation's 2016 financial statements are shown below: Balance Sheet as of December...

Financing Deficit

Stevens Textile Corporation's 2016 financial statements are shown below:

Balance Sheet as of December 31, 2016 (Thousands of Dollars)

Cash $ 1,080 Accounts payable $ 4,320
Receivables 6,480 Accruals 2,880
Inventories 9,000 Line of credit 0
   Total current assets $16,560 Notes payable 2,100
Net fixed assets 12,600    Total current liabilities $ 9,300
Mortgage bonds 3,500
Common stock 3,500
Retained earnings 12,860
   Total assets $29,160    Total liabilities and equity $29,160

Income Statement for January 1 - December 31, 2016 (Thousands of Dollars)

Sales $36,000
Operating costs 32,440
   Earnings before interest and taxes $ 3,560
Interest 460
   Pre-tax earnings $ 3,100
Taxes (40%) 1,240
Net income $ 1,860
Dividends (45%) $  837
Addition to retained earnings $ 1,023
  1. Suppose 2017 sales are projected to increase by 20% over 2016 sales. Use the forecasted financial statement method to forecast a balance sheet and income statement for December 31, 2017. The interest rate on all debt is 7%, and cash earns no interest income. Assume that all additional debt in the form of a line of credit is added at the end of the year, which means that you should base the forecasted interest expense on the balance of debt at the beginning of the year. Use the forecasted income statement to determine the addition to retained earnings. Assume that the company was operating at full capacity in 2016, that it cannot sell off any of its fixed assets, and that any required financing will be borrowed as a line of credit. Also, assume that assets, spontaneous liabilities, and operating costs are expected to increase by the same percentage as sales. Determine the additional funds needed. Round your answers to the nearest dollar. Do not round intermediate calculations.

1. What is the AFN? Please provide a detailed calculation of the AFN. I keep getting the wrong answer.  

2. What is the resulting total forecasted amount of the line of agreement?

The correct answer for 1 & 2 is $3112.

In: Finance

Reformulating Allowance for Doubtful Accounts and Bad Debt Expense Merck & Company reported the following from...

Reformulating Allowance for Doubtful Accounts and Bad Debt Expense

Merck & Company reported the following from its 2016 financial statements.

$ millions 2013 2014 2015 2016
Accounts receivable, net $7,666 $7,105 $6,965 $7,499
Allowance for doubtful accounts 170 179 191 225


a. Compute accounts receivable gross for each year.

$ millions 2013 2014 2015 2016
Accounts receivable, gross $Answer $Answer $Answer $Answer


b. Determine the percentage of allowance to gross account receivables for each year.

Round answers to two decimal places (ex: 0.02345 = 2.35%).

2013 2014 2015 2016
% allowance Answer % Answer % Answer % Answer %


c. Assume that we want to reformulate the balance sheet and income statement to reflect a constant percentage of allowance to gross accounts receivables for each year. Compute the four-year average and then reformulate the balance sheet and income statements for each of the four years. Follow the process shown in Analyst Adjustments 5.2 and assume a tax rate of 35%.

Four- year average of percentage of allowance to gross accounts receivables.

Round answer to two decimal places (ex: 0.02345 = 2.35%)

Answer

%

Reformulate the balance sheet and income statements.

Round answers to one decimal place.

Use negative signs with answers to indicate the adjustment decreases an account.

2013 2014 2015 2016
Adjusted allowance for doubtful accts. $Answer $Answer $Answer $Answer
Balance Sheets Adjustments
Allowance for doubtful accounts Answer Answer Answer Answer
Accounts receivable, net Answer Answer Answer Answer
Deferred tax liabilities Answer Answer Answer Answer
Retained Earnings Answer Answer Answer Answer
Income Statements Adjustments
Bad debts expense Answer Answer Answer Answer
Income tax expense at 35% Answer Answer Answer Answer
Net Income Answer Answer Answer Answer

In: Accounting