This week, you will create and implement an object-oriented programming design for your project. You will learn to identify and describe the classes, their attributes and operations, as well as the relations between the classes. Create class diagrams using Visual Studio. Review the How to: Add class diagrams to projects (Links to an external site.) page from Microsoftâs website; it will tell you how to install it.
Submit a screen shot from Visual Studio with your explanation into a Word document, save as a .docx, before submitting it.
Below is the code I am trying to add class diagrams to:
using System;
namespace ConsoleApp8
{
class Program
{
static void Main(string[] args)
{
// display the current date
DateTime d = DateTime.Now;
Console.WriteLine("{0:dd/MM/yyyy HH:mm:ss}", d);
Console.WriteLine("Quiz");
string[] questions = LoadQuestions();
Boolean[] status = { false, false, false, false, false, false, false, false, false };
string[] options = LoadOptions();
string[] key = { "A", "B", "C", "D", "B", "C", "A", "A", "A" };
int noCorrectAnswer = 0;
// iterate through questions
for (int i = 0; i < 9; i++)
{
string choice = DisplayQA(questions, options, i);
// record correct answers
if (choice == key[i])
{
status[i] = true;
noCorrectAnswer++;
}
}
// if all answers are not correct, restart the quiz for wrong
answers
if (noCorrectAnswer < 9)
{
Console.WriteLine("Re-Start
Quiz================================");
Console.WriteLine("Repeat the quiz for wrong answered
questions!");
for (int i = 0; i < 9; i++)
{
if (status[i] == false)
{
string choice = DisplayQA(questions, options, i);
if (choice.Equals(key[i],
StringComparison.OrdinalIgnoreCase))
{
noCorrectAnswer++;
status[i] = true;
}
}
}
}
// display correct answers
Console.WriteLine("Number of correct Answers: " +
noCorrectAnswer);
Console.ReadLine();
}
///
/// display question with answer choices
///
///
///
///
///
private static string DisplayQA(string[] questions, string[]
options, int i)
{
string choice = "";
Console.WriteLine(questions[i]);
Console.WriteLine(options[i]);
Console.Write("Enter the answer: ");
choice = Console.ReadLine();
// keep asking until user enters valid option
while (!(choice.ToUpper().Equals("A") ||
choice.ToUpper().Equals("B") || choice.ToUpper().Equals("C") ||
choice.ToUpper().Equals("D")))
{
Console.WriteLine("\nInvalid value. Please choose valid
option!");
Console.Write("Enter the answer: ");
choice = Console.ReadLine();
}
return choice;
}
///
/// Load question options
///
///
private static string[] LoadOptions()
{
return new string[] { "A. 5\nB. 5\nC. 6\nD. 9",
"A. 2\nB. 7\nC. 6\nD. 9"
,"A. 2\nB. 5\nC. 7\nD. 9"
,"A. 2\nB. 5\nC. 6\nD. 24"
,"A. 2\nB. 1440\nC. 6\nD. 9"
,"A. 2\nB. 5\nC. 12\nD. 9"
,"A. 86400\nB. 5\nC. 6\nD. 9"
,"A. 60\nB. 5\nC. 6\nD. 9"
,"A. 60\nB. 5\nC. 6\nD. 9"};
}
///
/// Load Questions
///
///
private static string[] LoadQuestions()
{
string[] questions ={"How many working days are there in a
week?"
,"How many systems make up the human body?"
,"How many days are there in a week?"
,"How many hours make up one day?"
,"How many minutes make up one day?"
,"How many months are there in a year?"
,"How many seconds make up one day?"
,"How many seconds make up one hour?"
,"How many minutes make up one hour?"};
return questions;
}
}
}
The prgramming language is C# through Visual Studio. Thanks.
In: Physics
We have had Paige & Gentry as our auditors for many years, havenât we, Jane? They have been here since I became president two years ago.â âYes, Bob, I have been the Chief Financial Officer for seven years, and they were here before I came. Why do you ask?â âWell, they were really tough on us during the recent discussions when we were finalizing our year-end audited statementsânot at all like I was used to at my last company. When we asked for a little latitude, our auditors were usually pretty obliging. Frankly, Iâm a little worried.â âWhy, Bob, we had nothing to hide?â âThatâs true, Jane, but letâs look ahead. Weâre going to have difficulty making our forecast this year, and our bonuses are on the line. Remember, we renegotiated our salary/bonus package to give us a chance at higher incentives, and we have to be careful.â âLooking ahead, weâve got a problem with obsolete inventory thatâs sure to come to require discussion for a second year in a row. Weâve got the warranty problem with the electrical harness on midrange machine which is going to cost us a bundle, but we want to spread the impact over the next three years when the customers discover the problem and we have to fix it up. And donât forget the contaminated waste spill we just hadâhow much is that going to cost to clean up, if we ever get caught?â âThese are potentially big ticket items. Bill Paige, the guy who is in charge of our audit, is not going to let these go by. He said the inventory problem was almost material this year and we had to argue really hard. You are a qualified accountant; how can we handle this?â âWell, Bob, we could have some informal discussions with other auditorsâmaybe even the ones at your old companyâto see how they would handle issues like these. The word will get around to Bill and he may be more accommodating in the future, and will probably shave his proposed audit fee for next year when he meets with our Audit Committee next month. If you really wanted to play hardball, we could talk the Audit Committee into calling for tenders from new auditors. After all this time, itâs logical to check out the market, anyway. We would have advance discussions during which we would sound them out on how they would assess materiality in our companyâs case. Our audit fee in getting pretty largeâalmost $50,000 this yearâso some big firms will be really interested.â âJane, letâs play hardball. Get a list of audit firms together for the tender process, and I will approach the Audit Committee. Be sure to list some small firms, including Webster & Co., the firm auditing my old company.â Questions 1. Who are the major stakeholders involved in this situation? 2. What are the ethical issues involved? 3. Is this situation unethical? Why and why not? 4. What should Jane do if Webster & Co. looks like the choice the Audit Committee will make and recommend to the board of directors?
In: Accounting
How Forensic Accountants Are Used in Court and The Benefits or Drawbacks?
Forensic accountants play a vital role in court proceedings by providing expert evidence and shedding light on legal matters pertaining to finance. Furthermore, forensic accountants are professionals whose opinion is taken in high regard in the court of law. In effect, the evidence obtained from forensic accountants is regarded as credible. Therefore, these professionals help the court in upholding fair trials. The benefits derived from forensic accountants are as significant to one party as they are to the opposing one. Thus, the true testimonies given during a court proceeding may affect the defendant positively while unfavorably affecting the plaintiff. Conversely, the accuser may win the case as a result of the evidence provided by a forensic accountant. There is a general strain in regards to the professionalism of forensic accountants in that one may not necessarily get what they wished for when they hire such professionals. In essence, forensic accountants must act professionally, and not give manipulative evidence in a bid to please their clients.
Do you agree the primary purpose of the expert is to be a
"settlement facilitator?"
'An expertâs chief purpose varies with the circumstances under which such expertise is required. While a significant number of cases may end in a settlement, some do not, hence the need for professional advice. The expertâs role in a case entailing a settlement is formulating a neutral ground on which the involved parties can stand. Typically, each party will seek a settlement that mostly favors them. Thus, a forensic account will create not only a reasonable settlement but also fair conditions for all parties involved. Nonetheless, the ultimate goal of an expert is not necessarily offering a settlement platform. A forensic accountantâs chief objective is to elucidate the matter at hand and create room for a clearer understanding of the underlying factors and parameters. In eventuality, the forensic accountant should be able to provide a concise report to the court which must be accurate and fair. If by any chance, the litigation process results in a settlement, the forensic accountant will play a vital role in facilitating such procedures as would be necessary.
What are some benefits of settlement?
Most professionals who advocate for settlements cite avoiding trials as their primary reason. Trials may implicitly bring rise to issues other than the matter at hand. Also, a settlement minimizes cost-related risks of a firm or an individual while upholding confidentiality. In essence, the benefits of an agreement cut across all involved parties. Court proceedings may turn to be vigorous, thereby raising unintended information such as corporate secrets which may negatively harm the oneâs reputation. In cases involving financial matters, the parties in conflict face the risk of facing an uninformed jury insofar as such matters are concerned, should they elect to go to trials. A settlement will go a long way to minimizing such risks.
What is the Voir Dire process and how does the expert qualify to testify?
Voir dire entails an assessment carried out by the court in establishing the reliability and qualifications of an expert witness (âQualifying the Expert Witness: A Practical Voir Dire,â 2007). Usually, the process entails verifications of oneâs credentials to prove their ability to stand in the court of law and give an informed opinion based on their expertise. Moreover, a witnessâs experience in a professional will add weight to their legitimacy in the court. Also, the records of an expert witness must be able to conform to an individualâs and personal conduct. Further, a witness must not have a conflict of interest with the parties involved. Voir dire is aimed at ensuring fairness and reliability of evidence and testimonies during the court proceedings.
Read this post and give me a good response with 150 word.
In: Accounting
QUESTION 28
Current evidence indicates the first humans infected with HIV lived in
|
a. Haiti |
||
|
b. Indonesia |
||
|
c. Africa |
||
|
d. San Francisco |
2 points
QUESTION 29
If nondisjunction occurs in one chromosome pair in meiosis I during gametogenesis, what will be the result at the completion of meiosis?
|
a. All the gametes will be diploid. |
||
|
b. Half of the gametes will have an extra chromosome, and half will be missing one. |
||
|
c. There will be three extra gametes |
||
|
d. Two of the four gametes will be haploid, and two will be diploid. |
2 points
QUESTION 30
What is the reason that alleles of linked genes are usually inherited together?
|
a. They are located close together on the same chromosome. |
||
|
b. The number of genes in a cell is greater than the number of chromosomes. |
||
|
c. Chromosomes are unbreakable. |
||
|
d. Alleles are paired together during meiosis. |
2 points
QUESTION 31
This is the pedigree of a family with dry earwax syndrome, a single gene trait. Individuals with dry earwax often need professional flushing of the ear canals to avoid blockage. Individuals with dry earwax also have less body odor, and are less likely to get breast cancer. Affected individuals are colored circles and squares. Open circles and squares indicate those with normal wet earwax. Based on the pedigree, does this dry earwax appear to be dominant or recessive?
|
a. Dominant: Almost half the family has it |
||
|
b. Recessive: Mostly boys are affected |
||
|
c. Dominant: Every affected parent has an affected child |
||
|
d. Recessive: Unaffected parents can have an affected child |
2 points
QUESTION 32
Which of the following is an example of a genotype?
|
a. Blood type O |
||
|
b. Curly hair |
||
|
c. Dwarfism is defined as an adult 4â 10â or shorter |
||
|
d. Someone has two copies of the allele for brown eyes, BB |
2 points
QUESTION 33
In the table above, what does the word âstopâ mean?
|
a. The ribosome will stop and release the completed peptide |
||
|
b. The RNA polymerase will stop transcribing the gene |
||
|
c. Mutations will not occur here |
||
|
d. Primary transcript modification stops |
2 points
QUESTION 34
Which of the following does not occur in prokaryotic gene expression, but does in eukaryotic gene expression?
|
a. mRNA, tRNA, and rRNA are transcribed. |
||
|
b. RNA polymerase binds to the promoter. |
||
|
c. A poly-A tail is added to the 3' end of an mRNA and a cap is added to the 5' end. |
||
|
d. Transcription can begin as soon as translation has begun even a little. |
2 points
QUESTION 35
Small nuclear RNAs, or snRNAs, have several functions including:
|
a. Preventing translation of mRNAs |
||
|
b. Preventing transcription of new mRNAs |
||
|
c. Cutting out introns during RNA processing |
||
|
d. Preventing the DNA from unwinding |
2 points
QUESTION 36
This pedigree is for a family with Marfan syndrome. Marfan syndrome causes abnormal skeletal growth, long limbs, excessive height and sometimes heart defects. Dark-colored symbols are individuals affected with the disease, light symbols are phenotypically normal. Squares are males, circles are females. Using the pedigree, does Marfan syndrome look like it is dominant or recessive?
|
a. Dominant |
||
|
b. Recessive |
||
|
c. Co-dominant |
||
|
d. Not enough information given |
2 points
QUESTION 37
Which enzyme catalyzes the elongation of a DNA strand in the 5' â 3' direction?
|
a. primase |
||
|
b. DNA ligase |
||
|
c. DNA polymerase |
||
|
d. Topoisomerase |
In: Biology
On 1 July 2018, Parent Ltd acquired all the shares of Son Ltd, on a cum-div. basis, for $2,057,000. At this date, the equity of Son Ltd consisted of:
Share capital â 500 000 shares $ 1,000,000
Retained earnings 500,000
Son Ltd also reported a dividend payable of $100,000 and a recorded goodwill of $50, 000 at the acquisition date. The dividend payable was subsequently paid in September 2018.
At the acquisition date, all the identifiable assets and liabilities of Son Ltd were recorded at amounts equal to fair value except for the following:
| Carrying amount | Fair value | |
| Inventory | 40,000 | 50,000 |
| Plant (cost $500 000) | 300 000 | 350,000 |
Of the inventory on hand in Son Ltd at 1 July 2018, 60 percent was sold in August 2018 and the remainder was sold in June 2019. It was estimated that the plant has a further 5-year life with zero residual value.
Son Ltd was involved in a court case that could potentially result in the company paying damages to customers. At the acquisition date, Parent Ltd calculated the fair value of this liability to be $50,000, even though Son Ltd had not recorded any provision for damages (liability). On 29 June 2020 Son Ltd reassessed the liability in relation to the court case as the chance of winning the case had improved. The fair value on 29 June 2020 was considered to be $30,000.
The company applies the partial goodwill method. The income tax rate is 30%.
During the period 1 July 2018 to 30 June 2020, the following intragroup transactions have occurred between Parent Ltd and Son Ltd:
(T1) On 1 January 2019, Parent Ltd acquired furniture for $100,000 from Son Ltd. The furniture had originally cost Son Ltd $150,000 and had a carrying amount at the time of sale of $80,000. The sale was made on credit. At 30 June 2019, $60,000 was outstanding. At 30 June 2020, $20,000 was still not paid and outstanding. Both entities apply depreciation on a straight-line basis. At 1 January 2019, the furniture had a further five years of useful life, with zero residual value.
(T2) On 1 March 2019, Son Ltd sold inventory costing $12,000 to Parent Ltd for $16,000. On 1 October 2019, Parent Ltd sold half of these inventory items back to Son Ltd for $6,000. Of the remaining inventory kept by Parent Ltd, half was sold in March 2020 to Dingo Ltd at a profit of $400.
Required:
a) Prepare the acquisition analysis at 1 July 2018.
b) Prepare the consolidation worksheet entries at 30 June 2020. Your answer should include: 1. BCVR entries,
2. Pre-acquisition entries, and
3. Intragroup transaction adjustment entries (T1 to T2).
c) The adjusting consolidation entries at 30 June 2019 for the last intragroup transaction (T2) is provided below.
| Sales revenue | Dr | 16 000 | |
| Cost of sales | Cr | 12 000 | |
| Inventory | Cr | 4 000 | |
| Deferred tax asset (30%) | Dr | 1 200 | |
| Income tax expense | Cr | 1 200 |
Explain why the above entries are made for the intragroup transaction (T2) as at 30 June 2019, noting the adjustments to each account separately.
d) Critically analyze the accounting treatment of acquisition related costs in a business combination. For your critical analysis, you could compare with how acquisition related costs are accounted for when a company purchases property plant and equipment. [word limit: 150 words]
In: Accounting
Researchers want to know if there are significant differences in life satisfaction based on college students' overall financial status. In a Word document go thru the 5 steps for hypothesis testing and upload your answer here.
| life satisfaction | financial status |
| 35 | 3 |
| 34 | 2 |
| 31 | 3 |
| 31 | 3 |
| 28 | 3 |
| 28 | 3 |
| 28 | 2 |
| 21 | 2 |
| 29 | 3 |
| 30 | 2 |
| 30 | 3 |
| 29 | 3 |
| 29 | 3 |
| 15 | 2 |
| 30 | 2 |
| 30 | 2 |
| 29 | 3 |
| 20 | 3 |
| 29 | 2 |
| 35 | 3 |
| 22 | 2 |
| 31 | 2 |
| 30 | 3 |
| 30 | 3 |
| 20 | 3 |
| 20 | 2 |
| 27 | 2 |
| 33 | 3 |
| 21 | 2 |
| 27 | 3 |
| 17 | 2 |
| 29 | 2 |
| 24 | 2 |
| 24 | 2 |
| 32 | 2 |
| 22 | 3 |
| 27 | 1 |
| 29 | 2 |
| 30 | 1 |
| 27 | 2 |
| 29 | 2 |
| 26 | 2 |
| 35 | 3 |
| 29 | 2 |
| 29 | 2 |
| 30 | 2 |
| 30 | 2 |
| 17 | 1 |
| 21 | 2 |
| 28 | 3 |
| 27 | 3 |
| 29 | 2 |
| 31 | 3 |
| 29 | 3 |
| 28 | 3 |
| 30 | 3 |
| 26 | 3 |
| 31 | 2 |
| 18 | 2 |
| 19 | 1 |
| 23 | 2 |
| 24 | 3 |
| 23 | 2 |
| 24 | 3 |
| 30 | 3 |
| 30 | 2 |
| 18 | 3 |
| 22 | 1 |
| 29 | 2 |
| 23 | 2 |
| 29 | 3 |
| 24 | 3 |
| 13 | 2 |
| 25 | 2 |
| 23 | 3 |
| 25 | 1 |
| 28 | 3 |
| 30 | 3 |
| 16 | 2 |
| 32 | 3 |
| 17 | 2 |
| 35 | 3 |
| 28 | 3 |
| 29 | 2 |
| 29 | 2 |
| 29 | 2 |
| 29 | 3 |
| 29 | 3 |
| 30 | 2 |
| 28 | 2 |
| 23 | 2 |
| 23 | 1 |
| 27 | 3 |
| 28 | 2 |
| 8 | 2 |
| 27 | 3 |
| 32 | 2 |
| 26 | 3 |
| 29 | 3 |
| 26 | 2 |
| 33 | 3 |
| 33 | 2 |
| 28 | 3 |
| 26 | 1 |
| 35 | 2 |
| 30 | 1 |
| 29 | 2 |
| 30 | 2 |
| 31 | 2 |
| 30 | 2 |
| 35 | 2 |
| 16 | 3 |
| 29 | 2 |
| 19 | 1 |
| 27 | 2 |
| 20 | 3 |
| 29 | 2 |
| 21 | 2 |
| 22 | 1 |
| 18 | 1 |
| 23 | 3 |
| 22 | 3 |
| 26 | 2 |
| 27 | 3 |
| 23 | 2 |
| 26 | 3 |
| 21 | 3 |
| 20 | 2 |
| 24 | 2 |
| 28 | 3 |
| 25 | 1 |
| 25 | 3 |
| 27 | 3 |
| 27 | 3 |
| 30 | 2 |
| 24 | 2 |
| 26 | 2 |
| 27 | 2 |
| 25 | 2 |
| 31 | 3 |
| 31 | 3 |
| 29 | 1 |
| 22 | 1 |
| 25 | 2 |
| 32 | 2 |
| 25 | 2 |
| 29 | 2 |
| 21 | 3 |
| 12 | 1 |
| 35 | 2 |
| 27 | 3 |
| 25 | 3 |
| 28 | 2 |
| 19 | 1 |
| 24 | 1 |
| 23 | 3 |
| 18 | 2 |
| 28 | 2 |
| 18 | 1 |
| 30 | 2 |
| 20 | 3 |
| 25 | 2 |
| 15 | 3 |
| 26 | 3 |
| 26 | 1 |
| 23 | 1 |
| 17 | 1 |
| 29 | 2 |
| 17 | 2 |
| 20 | 3 |
| 29 | 2 |
| 33 | 2 |
| 15 | 2 |
| 11 | 2 |
| 18 | 2 |
| 27 | 3 |
| 22 | 2 |
| 26 | 2 |
| 23 | 2 |
| 35 | 3 |
| 12 | 2 |
| 30 | 3 |
| financial status: 1=over extended, 2=making ends meet, 3=comfortable |
In: Statistics and Probability
On I-5, you see the bright pink Almond Roca sign. You know they produce Almond Roca, but you wonder if they have ever thought about Brazil Roca, or Cashew Roca! You think these would be delicious, and you arenât really an almond fan.
Industry Background
Candy has been a part of our world for thousands of years. The first candy was made from honey. It was reserved, as were most good things, for the wealthy for a long time. In the Industrial Revolution, candy started to be more widely available. Latest figures place candy sales at $118 billion world-wide.
There are about 100 different candy manufacturers in the US, both large and small, from Mars, Inc. which is the 6th largest company in the US with $33 billion in sales; to local Almond Roca, with an estimated $50 million in sales.
Current Issues
One of the biggest issues facing this company is the rise in prices of raw materials, especially the iconic almond, which due to drought in California, has seen a price rise in recent years (although market forces are starting to correct for this).
In order to diversify their product, Almond Roca, Inc., has started to expand its repertoire to including other nuts, such as cashews and macadamia nuts. They are considering expanding to even more types of nuts, even mixed nuts!
Part 1 â Manufacturing Methods
Almond Roca is considering three nut mixes for inclusion in a new product line, Mixey Nuts!: Regular Mix, Deluxe Mix, and Holiday Mix. Each mix is made from 5 nuts, in different combinations.
|
Type of Nut |
Shipment Amount (pounds) |
Cost per Shipment |
|
Almond |
6000 |
$7500 |
|
Brazil |
7500 |
$7125 |
|
Filbert |
7500 |
$6750 |
|
Pecan |
6000 |
$7200 |
|
Walnut |
7500 |
$7875 |
The Regular Mix consists of 15% almonds, 25% Brazil nuts, 25% filberts, 10% pecans, and 25% walnuts. The Deluxe Mix consists of 20% of each type of nut.
The Holiday Mix consists of 25% almonds, 15% Brazil nuts, 15% filberts, 25% pecans, and 20% walnuts.
An accountant at Almond Roca, Inc., analyzed the cost of packaging materials, sales price per pound, etc, and determined that the profit contribution per pound is $1.65 for the Regular Mix, $2.00 for the Deluxe Mix, and $2.25 for the Holiday Mix. The price of the nuts can vary from month to month.
The estimate the customer orders for the different types to be as follows:
|
Type of Mix |
Orders (pounds) |
|
Regular |
10,000 |
|
Deluxe |
3,000 |
|
Holiday |
5,000 |
The president of Almond Roca wants to commit to these a minimum, even if not immediately profitable, in order to introduce these new mixes to the market.
Report:
Summarize this problem, and discuss the following topics, in a Word Document:
1. The cost per pound of the nuts included in the Regular, Deluxe, and Holiday mixes.
2. The optimal product mix and the total profit contribution.
3. Recommendation regarding how the total profit contribution can be increased if additional quantities of nuts could be found.
4. A recommendation as to whether Almond Roca should purchase an additional 1000 pounds of almonds for $1000 from a supplier who overbought.
5. Recommendations on how profit contribution could be increased (if at all) if Almond Roca does not satisfy the minimums listed above.
In: Accounting
For this assignment, you will use the provided database in the Unit 5 script file. You will add statements to this file to query the database tables. For your reference, below is a screenshot of the enhanced entity relationship diagram (ERD) as a reference when you write your queries. With the data types listed in the diagram, this will help you identify the types of operators that you can use for particular queries.
Use paiza.io for MySQL to execute and troubleshoot your Structured Query Language (SQL) statements. It is recommended that you use Notepad to write your SQL statements. Then, copy and paste your SQL statements to paiza.io to test your statements to ensure that they execute without errors. Save your work frequently.
The asterisk (*) indicates that a column is not null (i.e., required to have a value).
I didnt understand by what you mean by SQL TEST. If what you are asking me is that an SQL TEST? Yes! It is SQL QUERY TEST!!
In: Advanced Math
How to do a blackjack game with the following rules and WITHOUT USING ARRAY
Part 1 â Displaying Cards
Write a function to display (print) a card.
sample program output
void displayCard(int card)
Prints the name of the card (ten of spades, queen of diamonds
etc.). The parameter should be a value between 1 and 13, from which
the type of card can be determined (1 = ace, 2 = two, âŠ, 10, ==
ten, 11 = jack, 12 = queen, 13 = king).
The card suit (clubs, diamonds, hearts or spades) should be
determined randomly.
Part 2 â Generating Cards
Write a function to get a card.
int getCard()
Returns a random value between 1 and 13, representing a card (ace,
2, âŠ, queen, king). You do not have to keep track of which cards
are dealt. So, if the game deals the queen of spades five times in
row that is perfectly acceptable.
Part 3 â Determining a Cards Score
Write a function to return a card's score.
int cardScore(int card)
Returns a value between 2 and 11 as described in the rules. Recall
that the score is the card's value except that aces are worth 11
and face cards are worth 10. The card parameter represents the card
for which the score is to be determined.
Part 4 â Dealing Cards
Now that you've completed Parts 1 and 2 you can write a function
that handles dealing cards.
int deal(bool isPlayer, bool isShown)
This function is responsible for:
1. Generating the next card to be dealt (Part 1)
2. Printing out what card was dealt (Part 2) and to whom, if needed
(see below)
3. Returning the card's score (Part 3)
The two Boolean parameters are related to printing out the card.
The isPlayer parameter is used to determine whether the word PLAYER
or DEALER should be printed at the start of the output. The isShown
parameter is used to determine if the card should be printed â
recall that the second card dealt to the dealer is hidden.
Part 5 â Playing a Hand
Parts 1 to 4 should be enough to get you started, and the detailed
instructions end here. Your next function should be to play a hand
of Blackjack, following the rules described above.
int playhand()
Responsible for playing a hand of Blackjack. Returns 1 if the
player won, -1 if the player lost and 0 if the player drew (magic
number alert).
There is quite a lot that goes into this function, and it is the
heart of the assignment. I would strongly recommend breaking it
down into other functions that implement the various phases of a
hand of Blackjack.
Part 6 â Game Loop
In your main function (or in another function called by main) write
a loop to ask the user if they want to play Blackjack, as shown in
the sample program output. The user should continue to play hands
of Blackjack until they choose to quit (enter a character other
than 'y').
Your program should keep track of whether the user wins, loses or
draws a hand (see the return value of the hand function) and print
a summary of these results when they exit the program.
The random sequence for the game must not be the same each time it
is played.
User Input and Program Output
Assume that the user enters correct input (lowercase 'y' to play a
hand, and lowercase 'h' or 's' to hit or stand) â but see
Extras.
Your output, wording, spacing and so on may differ from the samples
shown above. To receive full marks, it must correctly describe the
game and must be at least as pretty as mine (not that mine is
particularly pretty).
In: Computer Science
âMoney Canât Buy Happinessâ
Along with this clichĂ©d statement, youâve probably heard that
money does buy happiness.
Both may be true. Economist Richard Easterlin argued that once
basic financial needs have been met, more money doesnât really do
much to make a person happy. Researchers set the limit at around
$75,000, recently prompting one CEO to give away all his earnings
above that amount to his employees.
This is by no means the last word, nor a directive to be unhappy until you make $75,000 and no happier afterward. More recent research worldwide indicates the exact opposite: The more money, the better. The authors said, âIf there is a satiation point, we are yet to reach it.â Given these mixed findings, the relationship between happiness and income is probably not direct. In fact, other research suggests your level of income is less important than how you spend it. Think about why you may be motivated by money. Do you envision the number of zeroes in your bank account increasing? Probably not. Youâre probably more motivated by what you can buy with the money than by the money itself. From research, we know:
âą Giving money away makes people happier than spending it on
themselves. In one study, students were given money and told to
either give it away or spend it on themselves. Then the study asked
people to give away their own money. Either way, people were
happier giving away the money, even if the givers were relatively
poor. What seems to matter is not the amount, but how much impact
you think your donation will have on others.
âą People are happier when they spend money on experiences rather
than products. Research professor Thomas Gilovich says we think to
ourselves, âI have a limited amount of money, and I can either go
there, or I can have this. If I go there, itâll be great, but itâll
be over in no time. If I buy this thing, at least Iâll always have
it. That is factually true, but not psychologically true. We adapt
to our material goods.â
âą People are happier when they buy time . . . but only if they use
it well. Outsource tasks when you can, for instance, and âthink of
it as âwindfall timeâ and use it to do something good,â says
researcher Elizabeth Dunn.
Saying that money brings more happiness when spent on our experiences (and the time to do them) may seem counterintuitive until we think about it closely. What did you think of your cell phone when you bought it compared to what you think of it now? Chances are you were interested and engaged when you bought it, but now it is an everyday object. For experiences, what did you think of your greatest vacation when you were on it, and what do you think of it now? Both the experience at the time and the recollection now may bring a smile to your face.
Sources: A. Blackman, âCan Money Buy Happiness?â The Wall Street
Journal, November 10, 2014, R1, R2; D. Kurtzleben, âFinally:
Proof That Money Buys Happiness (Sort Of),â USNews.com, April 29,
2013; and A. Novotney, âMoney Canât Buy Happiness,â Monitor on
Psychology (July/August 2012): 24â26.
Discussion Question
Do you believe money can buy happiness and is a good motivator in the workplace? Why or why not? Thoughts? Ideas?
In: Operations Management