|
(qα = 3.2 x 10–19 C and mα = 6.64 x 10–27 kg)
a) What is the direction of the electric field at this point?
b) What is strength of the electric field?
c) If the field is located 0.25 m away, what is the magnitude of the charge?
In: Physics
Write a class called CheckUserName. CheckUserName must have a main method. Your program must ask for a user name. If the name is on the list below (Liam, for example) greet the user saying: welcome back: Liam If the user is an admin (like Benkamin, for example) print: welcome back: Benjamin you have admin privileges Your program must accept upper case or lower case: emacs% java CheckUserName enter a user name: Liam welcome back: Liam emacs% java CheckUserName enter a user name: liam welcome back: liam Here is the list of users: Liam Noah William James Oliver Benjamin admin Elijah Lucas Mason Logan Alexander admin Ethan Jacob Michael Daniel admin Henry Jackson Sebastian Don't use switch
Examples:
emacs% java CheckUserName enter a user name: Liam welcome back: Liam emacs% java CheckUserName enter a user name: liam welcome back: liam emacs% java CheckUserName enter a user name: Oliver welcome back: Oliver emacs% java CheckUserName enter a user name: Benjamin welcome back: Benjamin you have admin privileges emacs% java CheckUserName enter a user name: benjamin welcome back: benjamin you have admin privileges emacs% java CheckUserName enter a user name: foo You are not a recognized user emacs%
I have this for the java code
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;
public class CheckUserName {
public static void main(String[] args) {
//users list
HashSet<String> users = new HashSet<>();
users.add("liam");
users.add("noah");
users.add("william");
users.add("james");
users.add("oliver");
users.add("elijah");
users.add("lucas");
users.add("mason");
users.add("jacob");
users.add("logan");
users.add("ethan");
users.add("michael");
users.add("henry");
users.add("sebastian");
users.add("jackson");
//admins list
HashSet<String> admins = new HashSet<>();
admins.add("benjamin");
admins.add("alexander");
admins.add("daniel");
Scanner sc = new Scanner(System.in);
System.out.println("enter a user name: ");
String name = sc.nextLine();
//checking in users list
if (users.contains(name.toLowerCase())) {
System.out.println("Welcome back " + name);
}
//checking in admins list
else if (admins.contains(name.toLowerCase())) {
System.out.println("Welcome back " + name);
System.out.println("you have admin privileges ");
}
else System.out.println("You are not a recognized user");
}
}
but I run it, it says "enter a user name:" your output, "enter a user name: welcome back: sebastian" expected output (error with the different names )
In: Computer Science
C++ exercise ! Change the WEEK‐4 program to work through the GradeBook class.
This program has some functionality that you can use with the Gradebook class.
So, please revise Gradebook class so that the class can use sort() and display() functions of WEEK4 program .
week-4 program :
#include
#include
using namespace std;
void sort(char nm[][10]);
void display(char name[][10]);
int main() {
char names[10][10];
int i;
for (i=0; i<10; i++)
{
cout << "Enter name of the student : ";
cin >> names[i];
}
sort(names);
display(names);
return 0;
}
void sort(char nm[][10]){
char temp[10];
cout <<"Sorting names in Ascending Order " << endl;
for (int i = 0; i <10; ++i)
for (int j =i+1; j<10; j++)
{
if (strcmp(nm[i],nm[j])>0)
{
strcpy(temp,nm[i]);
strcpy(nm[i],nm[j]);
strcpy(nm[j],temp);
}
}
};
void display(char nm[][10]) {
cout <<"Displaying names in Ascending Order " <<
endl;
for (int i = 0; i <10; ++i)
{
cout<< nm[i] << " " <
}
}
--------------------------------------------------------------------------------
Gradebook class:
#include
#include // program uses C++ standard string class
using namespace std;
// GradeBook class definition
class GradeBook
{
public:
// function that sets the course name
void setCourseName( string name )
{
courseName = name; // store the course name in the object
} // end function setCourseName
// function that gets the course name
string getCourseName() const
{
return courseName; // return the object's courseName
} // end function getCourseName
// function that displays a welcome message
void displayMessage() const
{
// this statement calls getCourseName to get the
// name of the course this GradeBook represents
cout << "Welcome to the grade book for\n" <<
getCourseName() << "!"
<< endl;
} // end function displayMessage
private:
string courseName; // course name for this GradeBook
}; // end class GradeBook
// function main begins program execution
int main()
{
string nameOfCourse; // string of characters to store the course
name
GradeBook myGradeBook; // create a GradeBook object named
myGradeBook
// display initial value of courseName
cout << "Initial course name is: " <<
myGradeBook.getCourseName()
<< endl;
// prompt for, input and set course name
cout << "\nPlease enter the course name:" <<
endl;
getline( cin, nameOfCourse ); // read a course name with
blanks
myGradeBook.setCourseName( nameOfCourse ); // set the course
name
cout << endl; // outputs a blank line
myGradeBook.displayMessage(); // display message with new course
name
} // end main
In: Computer Science
Morton Forms
Morton Forms is a Canadian controlled private corporation owned by
Viola Morton. For the
taxation year ended December 31, 2016, Ms. Morton's daughter,
Linda, who works in the
business, has calculated a Net Income for Morton Forms of $576,183.
In calculating this figure,
Linda used generally accepted accounting principles.
Linda has produced the following Income Statement for the year
ended December 31, 2016:
Morton Forms Inc.
Income Statement Year ending December 31, 2016
Sales $ 7,578,903
Cost of Goods Sold 5,468,752
Gross Profit 2,110,151
Expenses
General and Admin $ 852,000
Amortization Expense 550,000
Interest 8,500 1,410,500
Operating Income 699,651
Other Income:
Loss on Disposal of Intangible Assets (17,000)
Interest Income 110,532
Income before income taxes 793,183
Income Taxes
Current 182,000
Future 35,000 217,000
Net Income $ 576,183
During your review of Linda’s work and last year’s tax return for
the corporation, you have made
the following notes:
1. In the accounting records, the Allowance for Doubtful Accounts
was $25,000 at
December 31, 2016, and $20,000 at December 31, 2105. During 2016,
the company
had actual write-offs of $11,750. As a result, the accounting Bad
Debt Expense was
$16,750. This amount is included in General and Admin expenses on
the Income
statement.
2. A review of the listing of receivables (for tax purposes),
indicates that the actual items
that may be uncollectible total $15,000 at December 31, 2106. In
2015, the company
deducted a reserve for bad debits of $13,000 for tax
purposes.
3. General and Admin Expenses include:
a) Donations to registered charities 27,000
b) Accrued Bonuses – Accrued Sept 1, 2016. Paid June 15, 2017
78,000
Meals and entertainment costs:
c) $1,000 per month for premium membership at golf club for Viola
12,000
d) $200 per month for membership at golf club for salespeople
2,400
e) Meals while entertaining clients 32,000
f) Food costs for Viola’s personal chef for her meals at home
5,000
g) Annual summer BBQ for all staff 6,000
h) Sponsorship of local baseball team where company name is
prominently displayed on front of jersey 15,000
i) Advertising in a US trade magazine directed at US clients
100,000
j) New software purchased October 1, 2016. ($13,000 for
applications
and $25,000 for systems) 38,000
k) Accounting and legal fees for amended to the articles of
incorporation 6,000
l) Costs to attend annual convention of finger knitters in
Thailand.
While at the convention, Viola was sure to hand out business
cards
and talk to other attendees about her business with the intention
of
claiming the convention as a business expense. 17,000
4. Interest expense consists of the following:
a) Interest expense - operations 5,000
b) Penalty and interest for late and insufficient instalment
payments 2,000
c) Interest on late payment of municipal property taxes 1,500
5. Travel costs (included in general and admin expenses) include
both air travel and travel
reimbursement to employees for business travel. The company policy
is to reimburse
employees $0.58 per kilometer for the business use of their
automobiles. During the
year, seven employees each drove 4,000 on employment related
activities and one
employee drove 7,500 kilometers. None of the kilometer based
allowances are required
to be included in the income of the employees.
6. Maximum CCA has always been taken on all assets. The
undepreciated capital cost
balances at January 1, 2016 were as follows:
Class 1 (4%) $650,000
Class 8 95,000
Class 10.1 17,850
Class 14 68,000
Class 291 135,000
Class 44 65,000
1In 2012, used manufacturing and processing equipment was purchased
for $4,750,000
from another clothing manufacturer who had gone bankrupt. CCA on
this equipment
was fully claimed in 2013, 2014 and 2015. Last year, additional
manufacturing and
processing equipment was purchased for $180,000.
7. There was a loss on disposal of a limited life license to
produce copyrighted materials for
a major distributor. This license originally cost the company
$95,000 , and it was sold for
$63,000 in 2016. The book value of the license at the time of sale
was $80,000. When
the license was sold, it was the only asset in its CCA class. The
loss was claimed as a
loss on disposal of intangible assets on the Income Statement.
8. The cumulative eligible capital balance at January 1, 2016 was
$18,098. Three-quarters
of the $30,000 cost of incorporating the business was put in the
CEC account in 2012.
No other items were included in this account prior to the current
year.
9. Purchases and sales of equipment and other capital assets made
during 2016 were as
follows. (Note: any items discussed in other sections are included
in this list as well)
a. The company purchased land and constructed a new building on it
during the year.
The building was used 95% for manufacturing and processing. The
cost of the land
was $350,000, and the building cost $475,000 to construct.
b. The company purchased a new set of furniture for the reception
area for $1,200.
c. Some outdated desks used by the finance department with a cost
of $5,000 were
sold for proceeds of $3,500.
d. Landscaping of grounds around the new building cost $35,000.
This amount was
capitalized for accounting purposes.
e. A company car for use by the president of the company was
purchased for $90,000.
This car replaced the only other existing company car, which was
purchased in 2013
for $95,000. The old car was sold for $60,000.
f. A fence around the new building cost $52,000.
g. New software was purchased: $13,000 for Applications and $25,000
for Systems.
10. The company sold some shares that had been purchased several
years ago. The
capital gain on these shares was $152,708. Linda didn’t know how to
account for this,
so she credited the entire amount to retained earnings.
Required:
Determine Morton Forms’ minimum Net Income for Tax Purposes for the
year ending December
31, 2106. Ignore GST/HST/PST implications. Using the supplied
formatted Excel spreadsheet,
indicate your rationale for the treatment of all information
given.
In: Finance
|
Use Excel to calculate the values to fill in the empty boxes. Feel free to add additional tables and calculations as |
|
needed. |
|
Historical Demand Data 2012 to 2016: |
|
The table reproduced below is the demand data for a company (aggregated) for the previous five years. |
|
2012 |
2013 |
2014 |
2015 |
2016 |
|
|
Q1 |
11632 |
15034 |
16117 |
15565 |
16470 |
|
Q2 |
22509 |
26824 |
24169 |
20151 |
42858 |
|
Q3 |
21646 |
13314 |
14505 |
13392 |
19278 |
|
Q4 |
11355 |
10698 |
11176 |
10613 |
13934 |
|
Annual Demand |
67,142 |
65,870 |
65,967 |
59,721 |
92,540 |
|
Average Quarterly Demand |
16,785.50 |
16,467.50 |
16,491.75 |
14,930.25 |
23,135.00 |
|
Forecasting Using Moving Average Methods |
|
Using the historical demand data above, you are to determine the total annual demand forecast for 2016 and 2017 using: |
|
Ø the three-period moving average forecasting method |
|
Ø the three-period weighted moving average method with weights of .6, .3, and .1 |
|
Enter your forecast results in the following tables. |
|
2016 Annual Forecast Using a Moving Average |
2016 Annual Forecast Using a Weighted Moving Average |
|
|
63,852.67 |
62209.7 |
|
|
2017 Annual Forecast Using a Moving Average |
2017 Annual Forecast Using a Weighted Moving Average |
|
|
72742.67 |
80037 |
|
|
Calculate a Time Series Linear equation using the all of the above demand data: |
|||||||||||||||
|
Using the historical demand data for 2012 through 2016, create a linear equation with the year as the independent variable and the annual volume as the dependent variable. |
|||||||||||||||
|
Enter your linear equation in text from here: |
|||||||||||||||
|
Calculated 2017 Annual Forecast from Linear Equation:
|
|||||||||||||||
|
2012 |
2013 |
2014 |
2015 |
2016 |
2017 |
||||||||||
|
Actual Annual Demand |
67,142 |
65,870 |
65,967 |
59,721 |
92,540 |
||||||||||
|
Forecasted Annual Demand |
67,142 |
67142 |
66251.6 |
66052.38 |
61620.414 |
||||||||||
|
Forecast Error |
-1,272 |
-285 |
-6,331 |
30,920 |
|||||||||||
|
Values |
Seasonal Factor for each Quarter |
2017 Quarterly Forecast |
|
Quarter 1 |
0.89 |
|
|
Quarter 2 |
1.63 |
|
|
Quarter 3 |
0.98 |
|
|
Quarter 4 |
0.69 |
|
|
Totals |
4.19 |
|
What is the MAD value for the exponential smoothing forecast? Answer = |
|
What is the CFE value for the exponential smoothing forecast? Answer = |
|
What is the MAPE value for the exponential smoothing forecast? Answer = |
|
Forecasting using trend with regression: |
|
|
Calculate forecasts for 2017, 2016 and 2015 using a linear regression of the previous three actual demand values. |
|
|
(Hint: You will need to calculate three different linear equations.) |
|
|
2012 |
2013 |
2014 |
2015 |
2016 |
2017 |
||||
|
Actual Annual Demand |
67,142 |
65,870 |
65,967 |
59,721 |
92,540 |
slope |
-587.5 |
||
|
Forecasted Annual Demand |
67,142 |
67,142 |
66,252 |
66,052 |
61,620 |
intercept |
|||
|
Forecast Error |
-6,331 |
30,920 |
|
What is the MAD value for the trend with regression forecast? Answer = |
|
What is the CFE value for the trend with regression forecast? Answer = |
|
What is the MAPE value for the trend with regression forecast? Answer = |
In: Operations Management
Find a unit vector that is orthogonal to both u = i − 4j + k and v = 2i + 3j.
In: Math
The streamlines of the velocity field
v(x,y,z)=xlnzi+ylnzj+xk
have equations:
In: Physics
how to calculate External Quantum Efficiency from I-V-L graph? Explain in details.
In: Electrical Engineering
Ignoring extinction effects, does a star's "color"
(B-V) depend on its distance? Explain.
In: Physics
In: Accounting