A C++ question:
Implement the following functions. Each function deals with null terminated C-strings. You can assume that any char array passed into the functions will contain valid, null-terminated data. Your functions must have the signatures listed below.
1. This function returns the last index where the target char can be found in the string. it returns -1 if the target char does not appear in the string. For example, if s is âGiantsâ and target is âaâ the function returns 2.
int lastIndexOf(char *s, char target)
2. This function alters any string that is passed in. It should reverse the string. If âflowerâ gets passed in it should be reversed in place to ârewolfâ. To be clear, just printing out the string in reverse order is insufficient to receive credit, you must change the actual string to be in reverse order.
void reverse(char *s)
3. This function finds all instances of the char âtargetâ in the string and replaces them with âreplacementCharâ. It also returns the number of replacements that it makes. If the target char does not appear in the string it returns 0 and does not change the string. For example, if s is âgo giantsâ, target is âgâ, and replacement is âGâ, the function should change s to âGo Giantsâ and return 2.
int replace(char *s, char target, char replacementChar)
4. This function returns the index in string s where the substring can first be found. For example if s is âSkyscraperâ and substring is âyscâ the function would return 2. It should return -1 if the substring does not appear in the string.
int findSubstring(char *s, char substring[])
5. This function returns true if the argument string is a palindrome. It returns false if it is not. A palindrome is a string that is spelled the same as its reverse. For example âabbaâ is a palindrome. So is âhannahâ, âabc cbaâ, and âradarâ.
bool isPalindrome(char *s)
Note: do not get confused by white space characters. They should not get any special treatment. âabc baâ is not a palindrome. It is not identical to its reverse.
6. Extra Credit, up to 10 extra points. This function should reverse the words in a string. A word can be considered to be any characters, including punctuation, separated by spaces (only spaces, not tabs, \n etc.). So, for example, if s is âThe Giants won the Pennant!â the function should change s to âPennant! the won Giants Theâ
void reverseWords(char *s)
You can get up to 5 extra credit points if you implement this correctly. You can get up to another 5 extra credit points if you do it without using a second array. Note: this is one of the classic coding questions given during programming interviews.
Requirements
- You may use strlen(), strcmp(), and strncpy() if you wish, but you may not use any of the other C-string library functions such as strstr(), strncat(), etc.
- You will not receive credit for solutions which use C++ string objects, you must use C-Strings (null-terminated arrays of chars) for this assignment.
-Please indent the code.
In: Computer Science
|
PROJECT DETAILS:
â˘
Use
the CHRONOLOGICAL RESUME
TEMPLATE or SKILLS BASED/FUNCTIONAL RESUME TEMPLATE
(it
is strongly
recommended to use Chronological Resume as this is a little easier
to work with).
â˘
You
may only use 10 or 12pt TIMES NEW ROMAN or ARIAL fonts for this
assignment (except for your name - should be larger font size and
bold to stand out).
â˘
Cover
letter will be 1 page in length.
â˘
Your
resume MUST fit properly on one or two pages (not including
reference sheet). If your resume is only slightly longer than one
page, you will need to work on formatting to try and make it fit on
a single sheet.
â˘
Include
a separate reference sheet with at least THREE (3) references -
must ask permission prior to using names (can't be immediate family
members) and at least ONE reference should be able to speak to your
character.
â˘
Use
BOLD or ITALIC styles for headings, etc. as needed.
â˘
Use
BULLETS for point form information.
â˘
Make
sure line spacing and indents are consistent throughout your
documents.
|
In: Computer Science
Case study
Fatima Hassan is responsible for the collection, and auditing services of clients' accounts for the Doha Audit Office. Has been commissioned With a new client, Al Wajba Consulting Services Company, which contracted with the Doha Audit Office recently. Company CEO It is Mr. Ali Mahmoud, who monitors all operating activities of the company and takes all major decisions. Never use this company Previously, any services from the audit office. In addition to preparing the financial statements, the Doha Audit Office will handle the related matters Company taxes.
On her first visit to the company, Fatima Hassan met Hala Abdullah, she was recently hired as an accountant and is still a student. Accounting last year at a local university. At a later meeting, Hala assured Fatma that she had found the job at the beginning of the class Scholastic after extensive research. She needs money to help fund her studies at university and feels lucky to have found A well-paid job during this current phase of the economic downturn due to the COVID-19 pandemic.
Hala felt that Fatima was someone she could talk to and get advice from. Hala spoke of a situation she had in mind Some time ago. Hala concerns dealing with sales revenue. When the proceeds from sales are collected and deposited on a weekly basis, the necessary report is filled out with the most accurate categories of payment: cash, checks or credit cards. Distance Depositing the total amount on a weekly basis, Mr. Ali Mahmoud prepares a report after adjusting the total amount deposited by His own vision. After looking at some of the weekly deposits, Hala noticed that 20,000 Qatari cash were missing from each Deposit process.
After a more comprehensive examination of the monthly tax documents that Mr. Ali filled out, Hala notes that the total income is the monthly amount reported to the Tax Authority is QR 80,000 less than the amount actually calculated. Professor Ali He is the only person to deal with the funds after they have been pooled. It is also the only person who deposits money on a weekly basis. When Hala asked Mr. Ali about the non-reporting of these unreported revenues, Mr. Ali replied that it was being done for tax purposes. It is believed that the auditor will accept this procedure because the fees of the Doha Audit Office are to implement Audit tasks and other tax services are paid by Al Wajba Consulting Services.
Study requirements:
Each student must answer the following questions but each question should be answered at least 120 word for each question:
1. What is the problem or ethical problems in this situation? And why is each of them an ethical problem?
2. Who are the affected stakeholders in this situation? Explain how.
3. What are the alternatives available to Hala Abdullah, Fatima Hassan, and Professor Ali Mahmoud?
4. For each alternative dealt with in Requirement (3), are the net benefits exceeding the net losses for all the owners? Discuss your interpretation clearly
5. Whose rights will be violated in every alternative dealt with in Question 3? Discuss your interpretation clearly
In: Finance
Septimus was the seventh born child in his family; that is why he was called Septimus - which comes from the Latin word for 'seventh.' Despite the fact he had a numerical name, Septimus hated Hip Hop artists because so many of them appeared to be named after numbers (eg 50 Cent).
Because of his love of classical music, Septimus worked in the record indust1y as a company director for a recording company, My Masters Voice Ltd (or MMV Ltd). MMV Ltd specialized in recording classical music with a twist ( eg electric violin artists).
October 2013 proved to be a newsworthy month for Septimus and MMV. First, Septimus received a confidential report that MMV was going to merge with the leading recording company on earth, Mowertown. On hearing that news, Septimus purchased further shares in MMV and Mower-town. He purchased these shares in his own name. Secondly, at a Halloween party, one of the artists who records with MMV said to Septimus: "I'm really happy, the motor company my dad works for - Four Wheels are Better than None Ltd - is about to be cleared by a government enquiry - it turns out their quad-bike wasn't designed badly, after all. But please do not tell anyone I told you." Septimus subsequently bought shares in Four Wheels are Better than None. Finally, Septimus read an article in the No Idea Magazine that said smart investors were now buying shares in garden supply companies. Septimus went out and bought gardening shares.
(a) ASIC is now investigating Septimus' share purchases. They seek your advice on whether his three purchases have breached the Corporations Act. Advise ASIC giving legal reasons.
(b) One work experience cadet at ASIC learns about the Septimus matter and says: "The law relating to this matter is confusing. I am not sure whether Septimus' share purchases are governed by directors' duties or some other part of the Corporations Act. Also, even if he pleads guilty, I cannot make any sense out of the principles courts apply when sentencing offenders. I think the law is soft on white collar crime." Do you agree? Discuss this statement and in so doing, explain the relevant (white collar crime) sentencing principles to the cadet. Are you aware of other problems ASIC has had in white collar crime law suits? If so, discuss them.
(c) Imagine the above facts slightly change. First, instead of buying shares in Mower-town in his own name, Septimus instructs his accountant to buy the shares using a family company. Might that change the sections under which ASIC prosecutes Septimus? Why?
(d) Finally, imagine the facts change again. This time, instead of buying shares, Septimus makes a statement to the stock exchange which he knows is incorrect. When ASIC read the minutes of one directors' meeting, they find evidence that Septimus must have known the true situation. When confronted with this evidence by ASIC, Septimus simply says: "Well, the minute taker must have got it wrong." What are Septimus' prospects of success?
In: Accounting
A Case of Growing Pains
When he first opened his own business, Dionysus loved it. He went
to work early in the morning and did not leave until after 9.00P.M.
To spend time with his family, he would take off a few hours in the
afternoon and then return to the store after supper, staying until
closing time. When he was away from the store in the late
afternoon, part-time personnel handled the operation. That was five
years ago. Since then, Dionysusâs business has grown tremendously.
Now he employs eight full-time people and sells seven times as much
as he did originally. With this increase in business, however, have
come a lot of headaches. In particular, Dionysus has to make many
more decisions than he did before. Additionally, although he wants
to get his employees involved in the decision-making process and
not do all of the work himself, he feels he must do many tasks on
his own. He does not believe he can delegate much authority. For
example, Dionysus still makes all of the decisions regarding
purchasing, pricing, advertising, hiring, and merchandise display,
and he still sells goods in the store. Recently, Dionysus went to
the doctor for his annual physical. The doctor told him he was
working too hard and had to start slowing down. âYouâve been
running that store singlehanded for as long as I can remember,â the
doctor said. âYouâve got lots of help in the store. Start relying
on them to help you out.â Dionysus did not disagree. The doctor
offered good advice, and Dionysus knows the has to start delegating
more authority and getting out of the actual hustle-bustle of daily
activity. However, this worries him. A few months ago, he tried
turning over more work to his employees and staying in the
background. During that time, he concerned himself with the overall
operation of the store and left the minor day-to-day business to
the staff. But Dionysus was bored with this side of the operation.
He wants to be active-active role in the business, not just to sit
in the sidelines. Second, he wants to be in the forefront of the
action, like he always has been. Dionysus does not know how to
resolve this dilemma. He would like to maintain his level of
involvement at the shop but realizes that, for health reasons, this
is inadvisable. However, to
be a manager in the true sense of the word seems boring to
him.
Source: Adapted from Kuratko, D.F & Hornsby, J.S. (2009). âNew
Venture Management: The
Entrepreneurâs Roadmapâ. New Jersey: Pearson International
Edition.
Your consultation: Answer all questions
1. Help Dionysus by explain the key unique challenges of growing a
venture and how
important delegation is for growth.
2. Next, explain the key elements in the growth stage that Dionysus
should understand.
3. Finally, recommend a way that Dionysus can implement the
transactional process from
entrepreneurial style to managerial style during the growth
stage.
In: Operations Management
Question 1
The Covid-19 pandemic in the first half of 2020 has significantly
changed the business
landscape globally and locally. Businesses struggle to survive and
share prices of companies
continue to tumble.
This situation, however, presents good investment opportunities for
PropThrive Pte Ltd
(PropThrive). PropThrive is an investment holding company which
invests in companies with
strong fundamentals and promising growth opportunities. Given the
current depressed share
prices, the Chief Investment Officer (CIO) thinks that now is a
good time to buy into shares of
such companies.
You have recently been recruited as a financial analyst of
PropThrive. You report to Peter Tan,
one of the two investment strategists of PropThrive. In a recent
meeting you attended with
Peter, both the CIO and the Chief Financial Officer (CFO) have
identified Kitchen Culture
Holdings Ltd. (Kitchen Culture) as a promising investment target.
Their rationale was that
despite the continuing losses experienced by Kitchen Culture, it
has a strong reputation.
Moreover, the pandemic has kept the people around the world indoor
more and this trend is
here to stay. People tend to cook more when they stay indoor and
consequently, the demand
for good quality kitchen appliances will continue to rise.
The CFO and CIO have requested you and Peter Tan to examine and
report to them on the
performance and financial position of Kitchen Culture. Your report
should include a full
analysis and preliminary conclusion to be used by the CFO and CIO
in their investment
decision.
Peter Tan has requested that you obtain the two most recent annual
reports of Kitchen Culture
that include the financial statements for the financial periods
ended 30 June 2019 (FY2019),
30 June 2018 (FY2018) and 30 June 2017 (FY2017) respectively, and
any other relevant
materials of Kitchen Culture to start helping him to analyse and
draft the report.
As this is the first time you are preparing such a report, Peter
Tan has given you some advice
which you should heed. You are free to decide the relevant
financial tools to use for your
analysis and assessment. As this is a formal report, the contents
should be succinct and
professional. You should also use a proper format and limit your
word count to no more than
1,000. All detailed computations, tables and charts should be in
appendices to avoid distracting
readers from the main key points.
Peter also advised you that unless unavailable, all information,
data and documents should be
obtained from reliable sources like the Singapore Exchange website.
This is the url link to the
said website:
https://www.sgx.com/securities/annual-reports-related-documents.
Peter has also
furnished the SGInvestors.io website url for you to obtain the
share prices of listed companies
in Singapore: https://sginvestors.io/sgx/stock-listing/alpha.
Required:
Peter specified that the report must include the following
components:
(a) Analyse and discuss the profitability; liquidity and
efficiency; and solvency of Kitchen
Culture.
(b) Appraise whether Kitchen Culture is a good investment option
and state your
preliminary conclusion. Besides the quantitative data, you should
also use qualitative
information to support your preliminary conclusion.
what exactly is qualitativea analysis?
In: Economics
Q1) One-Sample t-Test (21 points total)
I am curious about how many hours per week my students spend on their online coursework. So, I surveyed 9 of my students on how many hours per week they spend on my online PSY 230 course. According to a survey of online college students (in all courses), students studied an average of 9 hours a week for a 3-credit course. I assume that the national study time scores are normally distributed, and I set the significance level at Îą = .05.
|
Student |
Study hours |
|
1 |
12 |
|
2 |
19 |
|
3 |
21 |
|
4 |
14 |
|
5 |
11 |
|
6 |
9 |
|
7 |
12 |
|
8 |
10 |
|
9 |
7 |
In: Statistics and Probability
data
| Therapy | Medication | Score |
| Cog | Zoloft | 54 |
| Cog | Zoloft | 42 |
| Cog | Zoloft | 50 |
| Cog | Zoloft | 47 |
| Cog | Zoloft | 48 |
| Cog | Zoloft | 44 |
| Cog | Prozac | 70 |
| Cog | Prozac | 68 |
| Cog | Prozac | 66 |
| Cog | Prozac | 61 |
| Cog | Prozac | 61 |
| Cog | Prozac | 40 |
| Cog | Lexapro | 54 |
| Cog | Lexapro | 52 |
| Cog | Lexapro | 55 |
| Cog | Lexapro | 54 |
| Cog | Lexapro | 58 |
| Cog | Lexapro | 54 |
| Assert | Zoloft | 30 |
| Assert | Zoloft | 35 |
| Assert | Zoloft | 34 |
| Assert | Zoloft | 35 |
| Assert | Zoloft | 36 |
| Assert | Zoloft | 38 |
| Assert | Prozac | 50 |
| Assert | Prozac | 54 |
| Assert | Prozac | 55 |
| Assert | Prozac | 54 |
| Assert | Prozac | 55 |
| Assert | Prozac | 58 |
| Assert | Lexapro | 68 |
| Assert | Lexapro | 70 |
| Assert | Lexapro | 62 |
| Assert | Lexapro | 62 |
| Assert | Lexapro | 54 |
| Assert | Lexapro | 56 |
USE R to do it will soon, and if you use r, could you give me a code
Suppose that a clinical psychologist is interested in comparing
the relative effectiveness of two forms of psychotherapy
(cognitive-behavioral and assertiveness training) in combination
with three different medications (Zoloft, Prozac, and Lexapro) for
alleviating depression. Thirty-six individuals are randomly sampled
and randomly assigned a combination of treatment. The Depression
Scale of MMPI serves as the response (score). The goal is to lower
the score.
(a) Write out the initial hypotheses to be tested in words.
(b) Write out the appropriate statistical model and explain all
terms. (Let i be associated with therapy)
(c) Construct an interaction plot where medication is the âtrace
factorâ. Based on the plot, does there appear to be evidence of an
interaction? Hint: Since there are 3 different medications, youâll
have to modify the following arguments for the code in R for the
interaction plot to ensure that all 3 types of medication the are
plotted. Note that you can use any number in the pch argument and
any colors in the col argument. You will need to save this as a
PDF, Word doc, or png.
The code here is for two levels: pch=c(1,2), col = c("red",
"blue")
What can you do for three levels?
(d) Calculate the degrees of freedom for each term including the
residual. Make sure to show work on how you calculated the degrees
of freedom. Source Degrees of Freedom
Note: The sample size is 36
(e) Obtain the ANOVA table in R and confirm the degrees of freedom
you reported in part (d). Should the main effects or simple effects
be analyzed?
(f) Based on your answer above, report the appropriate results. If
the main effects are appropriate, specify the estimated difference
in average score for the therapies and/or medications along with
the corresponding 95% confidence intervals for those which are
statistically different. If the simple effects are appropriate,
provide the estimated difference in average scores at a given type
therapy along with the corresponding 95% confidence intervals for
those which are statistically different.
(g) If a psychiatrist is currently using assertiveness training
with a patient and currently has access to Prozac, should they
switch their patient to using Prozac instead of Lexapro? Justify
your answer
In: Statistics and Probability
The Marburg Colloquy, 1529 The Hessian Chancellor Feige: My gracious prince and lord [Landgrave Philip of Hesse] has summoned you for the express and urgent purpose of settling the dispute over the sacrament of the Lordâs Supper.... Let everyone on both sides present his arguments in a spirit of moderation.... Now then, Doctor Luther, you may proceed. Luther: Noble prince, gracious lord! Undoubtedly the colloquy is well intentioned.... Although I have no intention of changing my mind, which is firmly made up, I will nevertheless present the grounds of my belief and show where the others are in error.... Your basic contentions are these: In the last analysis you wish to prove that a body cannot be in two places at once, and you produce arguments about the unlimited body which are based on natural reason. I do not question how Christ can be God and man and how the two natures can be joined. For God is more powerful than all our ideas, and we must submit to his word. Prove that Christâs body is not there where the Scripture says, âThis is my body!â Rational proofs I will not listen to.... It is God who commands, âTake, eat, this is my body.â I request, therefore, valid scriptural proof to the contrary. Zwingli: I insist that the words of the Lordâs Supper must be figurative. This is ever apparent, and even required by the article of faith: âtaken up into heaven, seated at the right hand of the Father.â Otherwise, it would be absurd to look for him in the Lordâs Supper at the same time that Christ is telling us that he is in heaven. One and the same body cannot possibly be in different places.... Luther: I call upon you as before: your basic contentions are shaky. Give way, and give glory to God! Zwingli: And we call upon you to give glory to God and to quit begging the question! The issue at stake is this: Where is the proof of your position? I am willing to consider your words carefullyâno harm meant! Youâre trying to outwit me.... Youâll have to sing another tune. Luther: Youâre being obnoxious. Zwingli: (excitedly) Donât you believe that Christ was attempting in John 6 to help those who did not understand? Luther: Youâre trying to dominate things! You insist on passing judgment! Leave that to someone else! ... It is your point that must be proved, not mine. But let us stop this sort of thing. It serves no purpose. Zwingli: It certainly does! It is for you to prove that the passage in John 6 speaks of a physical repast. Luther: You express yourself poorly and make about as much progress as a cane standing in a corner. Youâre going nowhere. Zwingli: No, no, no! This is the passage that will break your neck! Luther: Donât be so sure of yourself. Necks donât break this way. Youâre in Hesse, not Switzerland.
How did the positions of Zwingli and Luther on the sacrament of the Lordâs Supper differ? What was the purpose of this debate? Based on this example, why do you think Reformation debates led to further hostility rather than compromise and unity between religious and sectarian opponents? What implications did this have for the future of the Protestant Reformation?
In: Economics
Part #2: Creating a table
Background: Prior to storing data in a RDBMS, a table with suitable schema must be created.
Exercise: Create a table with your ID (e.g.: derricker) with the following procedure
|
mysql> CREATE TABLE id ( id INTEGER NOT NULL, name VARCHAR(64) NOT NULL, email VARCHAR(32) NOT NULL, PRIMARY KEY (id) ); |
|
F |
NOTE: You will need to complete this part of the exercises successfully prior to proceeding with remainder of this exercise. So, if you get error messages ensure you get help from your instructor to resolve the error. |
Part #3: Insert some data into your table
Background: One of the key operations of working with a database is inserting new values into the database. This is accomplished using SQL insert statement.
Exercise: Insert sample data into your ID table that you created in the previous step with the following command:
|
INSERT INTO id (id, name, email) VALUES (100, 'John Doe', '[email protected]'); |
|
id |
name |
|
|
200 |
'Mary Doe' |
|
|
300 |
'James Bond' |
|
|
400 |
'Superman' |
|
F |
NOTE: You will need to complete this part of the exercises successfully prior to proceeding with remainder of this exercise. So if you get error messages ensure you get help from your instructor to resolve the error. |
Part #4: Experiment with SQL queries
Background: Querying data using SQL involves coding suitable SELECT statements with necessary columns and conditions.
Exercise: Using the SELECT statements discussed in class, code the SQL statement for the following queries:
In: Computer Science