Questions
Modified from Chapter 07 Programming Exercise 5 Original Exercise: Rock, Paper, Scissors Modification Programming Exercise 11...

Modified from Chapter 07 Programming Exercise 5

Original Exercise:

Rock, Paper, Scissors Modification
Programming Exercise 11 in Chapter 6 asked you to design a program that plays the Rock, Paper, Scissors game. In the program, the user enters one of the three strings—"rock", "paper", or "scissors"—at the keyboard. Add input validation (with a case-insensitive comparison) to make sure the user enters one of those strings only.

Modifications:

  • Allow the user to input "r", "p", "s" or the full strings "Rock", "Paper", "Scissors"
    • Allow the user to input upper or lowercase
    • try the following:
      • input = input.lower()
  • Refer to the following code to help generate a random computer player action
    • import random
      pc_choice_list = ["rock", "paper", "scissors"]
      pc_choice = random.choice(pc_choice_list)
  • Allow the player to input a "q" for their turn if they want to quit the game
  • Use loops not only to validate the input but also to keep the game running as long as the player does not input a "q" on their turn
  • Example outputs
    • Rock beats Scissors
    • Paper beats Rock
    • Scissors beats Paper
    • Tie
    • Game Over
    • Let's Play Rock, Paper, Scissors
      Input your choice: r,p, or s

Turn IN:

Raptor flowchart file (or alternative flowchart screenshot)
        If you are on Windows please try using the built-in "Snip & Sketch" program to take a perfectly sized screenshot.
Thonny Python file (or Python file is written in any IDE/program)
        Turn in the actual Python code file "file_name.py"

In: Computer Science

Javascript 1. Write a function which receives four arguments (array, start, end, delimiter). Copy the array...

Javascript

1. Write a function which receives four arguments (array, start, end, delimiter). Copy the array values from the start to end index separated by delimiter\'s value. function([1,2,3,4],1,3,'*') // returns 2*3*4 as string

2. Write a function to change the case of all the characters in string based on their position which matches the value of the pos parameter passed to function(str, pos [even|odd]). Example: function(‘abCd’, ‘odd’) // returns Abcd

3 Write a function which receives two arguments (array, oddOrEven) based on the value of oddOrEven (odd or even value) the function will return the sum of all the array elements that matches the type of oddOrEven value. function([1,1,2,3,4],11) // returns 5 (which is the sum of all odd numbers)

DO NOT USE THESE BUILT IN FUNCTIONS BELOW

endsWith() includes() indexOf() lastIndexOf() localeCompare() match() repeat() replace() search() slice() split() startsWith() substr() substring() toLocaleLowerCase() toLocaleUpperCase() toLowerCase() toString() toUpperCase() trim() valueOf() trimLeft and trimRight unshift() valueOf()

includes() indexOf() lastIndexOf() localeCompare() match() repeat() replace() search() slice() split() startsWith() substr() substring() toLocaleLowerCase() toLocaleUpperCase() toLowerCase() toString() toUpperCase() trim() valueOf() trimLeft and trimRight unshift() valueOf()   
concat() copyWithin() every() fill() filter() find() findIndex() forEach() indexOf() isArray() join() lastIndexOf() map() pop() push() reduce() reduceRight() reverse() shift() slice() some() sort() splice() toString()

In: Computer Science

5. Write a program that prints all numbers between 27 and 78, one number per line....

5. Write a program that prints all numbers between 27 and 78, one number per line.

6. In questions 6,7 the following list is used: [1,2,5,6,3,77,9,0,3,23,0.4,-12.4,-3.12]

7. Using “for” loop, write program that finds the smallest number in the list.

8. Using “for” loops, calculate arithmetic mean of all numbers in the list. Do not use built-in function in Python.

9. For this question envision you are creating a dummy alert to help the doctor determine if patient needs a mammogram or not: Ask the user to answer the following questions:

• "What is your patient’s gender? Please answer F for female, M for male " and store it in a variable "gender".

• "What is your patient’s age? " store it in a variable "age"

• "Does your patient have family history of breast cancer? Please answer with True or False " store it in a variable name "history" The program should display the following alert messages based on conditions:

• If patient is female and over 40 the system should alert the doctor to "consider ordering mammogram”

• If the patient is female but younger than 40 the program should go to next step and consider patient family history to determine if mammogram is recommended. If patient has family history of breast cancer the program should display a message "consider mammogram because of family history". If not just display "my not need mammogram" • In any other case the alert should say "no mammogram order recommended". Suggestion: Attention to the variable types when you input and compare.

In: Computer Science

USING MATLAB: Using the data from table below fit a fourth-order polynomial to the data, but...

USING MATLAB:

Using the data from table below fit a fourth-order polynomial to the data, but use a label for the year starting at 1 instead of 1872. Plot the data and the fourth-order polynomial estimate you found, with appropriate labels. What values of coefficients did your program find? What is the LMS loss function value for your model on the data?

Year Built SalePrice
1885 122500
1890 240000
1900 150000
1910 125500
1912 159900
1915 149500
1920 100000
1921 140000
1922 140750
1923 109500
1925 87000
1928 105900
1929 130000
1930 138400
1936 123900
1938 119000
1939 134000
1940 119000
1940 244400
1942 132000
1945 80000
1948 129000
1950 128500
1951 141000
1957 149700
1958 172000
1959 128950
1960 215000
1961 105000
1962 84900
1963 143000
1964 180500
1966 142250
1967 178900
1968 193000
1970 149000
1971 149900
1972 197500
1974 170000
1975 120000
1976 130500
1977 190000
1978 206000
1980 155000
1985 212000
1988 164000
1990 171500
1992 191500
1993 175900
1994 325000
1995 236500
1996 260400
1997 189900
1998 221000
1999 333168
2000 216000
2001 222500
2002 320000
2003 538000
2004 192000
2005 220000
2006 205000
2007 306000
2008 262500
2009 376162
2010 394432

In: Computer Science

The following task does not involve writing program code: instead, you will be writing function signatures...

The following task does not involve writing program code: instead, you will be writing function signatures for hypothetical functions (you will be defining functions in subsequent tasks).

  1. For this task, you are presented with several 'hypothetical' functions. These aren't built-in Python functions: they are functions that you will have to define (i.e. implement, write) yourself later. however, you only need to write a signature for each hypothetical function listed here:
    1. toThePower(): takes two numbers e.g. x and y , and returns the value of (x to the power y). For example, toThePower(3,3) returns 27, and toThePower(-0.1,3) returns -0.001.
    2. quadruplicate(): takes a string, and returns a string consisting of three copies of that string concatenated together. For example, quadruplicate("na") returns "nananana", and quadruplicate("..?") returns "..?..?..?..?".
    3. subtract(): takes two numbers, and returns the difference between them. For example, subtract(10,3) returns 7, and subtract(2.2,5) returns -2.8.
    4. overlap(): We are not going to tell you exactly what it does, but we will give you a few examples: overlap("banana","analyze") returns 3 (not 4), overlap("abracadabra","abraham") returns 4 (not 5), overlap("foobar","red") returns 1, and overlap("foobar","bazinga") returns 0.
    5. multiplicate(): We are not going to tell you exactly what it does, but we will give you a few examples: multiplicate("x",5) returns "xxxxx", multiplicate("goo",3) returns "googoogoo", and multiplicate("never",0) returns "" (the empty string).

In: Computer Science

Discuss how Intel changed ingredient-marketing history. What did it do so well in those initial campaigns?...

  1. Discuss how Intel changed ingredient-marketing history. What did it do so well in those initial campaigns?

Intel made Intel inside marketing and branding campaign in order to distinguish itself from competitors and build brand awareness in customer minds. They chose Pentium name that could be trademark for its latest microprocessor. This marketing campaign included Intel logo in their PC and sticker on outside of laptops and their PC by giving rebates to computer manufacturer. It aided to move the Intel brand name from outside the PC and into the consumer minds in the marketplace. After that Intel used special advertisements for their products. Such as: Bunny People. Commodity product into one of famous brands was built in history through their innovative marketing campaign.

  1. Evaluate Intel’s more recent marketing efforts as the industry moves out of the PC era. What are Intel’s greatest risks and strengths during this changing time?

Intel promoted new product’s development and searched new opportunities to extend its growth and market. It launched new platform Unwired which is integration of new microprocessor, classmate PC for children, home entertainment, Atom processor for mobile internet devices, netbooks and Intel Core i7 which is useful for advanced computer activities video and 3d gaming. It brought big revenue for company. When they replace the logo from familiar Intel Inside to Leap Ahead, They lost some old value. But new slogan reflected their ambition to lead market and new Intel direction which meet the needs of customer.

Do you agree with the posted above? why?

In: Operations Management

Instructions: In your first reflective learning assignment on Personal Leadership Development, you will answer the following...

Instructions:

In your first reflective learning assignment on Personal Leadership Development, you will answer the following 2 questions.

Always use the title that you have been given. Do stick to the word count.

Use the title: Reflecting on My Personal Leadership Values and Vision

  1. Reflect on what you have learned about values, personal (Rokeach) and managerial (CVF). How will you use these results for your personal leadership development? ? (250 words)

  1. Write your Personal Leadership Vision.
    1. Ensure that you consider your values from the preceding exercises and the desirable behaviours and attitudes that were described in the thank you card exercise and the aspects of the Fundamental State of Leadership.
    2. Keep the characteristics of an effective vision in mind.
    3. Craft the vision carefully.
    4. Do not exceed 25 words.
    5. Make is memorable and motivational for you!

EXAMPLE:

Here’s a personal leadership vision built on the inputs from our sample person. From other assessments this person has completed, we know she is a “yellow” on the CVF. She prefers to act in the mentor and facilitator roles. Her Rokeach values results indicate that her top three terminal values are freedom, self-respect and, wisdom. Her top three instrumental values are ambitious, intellectual and responsible. Below is the first draft of her leadership vision:

“I am authentically engaged. Integrity and learning matter - always. I want to grow and grow others. I will make a difference.”

In: Operations Management

Jenny had discovered some new friends on the Internet—friends who shared her interest in programming. One...

Jenny had discovered some new friends on the Internet—friends who shared her interest in programming. One of these new friends sent her a link to a new warez (illegally copied software) site.

She downloaded a kit called Blendo from the warez site. Blendo is a tool that helps novice hackers create attack programs that combine a mass e-mailer with a worm, a macro virus, and a network scanner. She clicked her way through the configuration options, clicked a button labeled “custom scripts,” and pasted in a script that one of her new friends had e-mailed to her. This script was built to exploit a brand-new vulnerability (announced only a few hours before).

Although she didn’t know it, the anonymous high-schooler had created new malware that was soon to bring large segments of the Internet to a standstill.

She exported the attack script, attached it to an e-mail, and sent it to an anonymous remailer service to be forwarded to as many e-mail accounts as possible. She had naively set up a mailback option to an anonymous e-mail account so she could track the progress of her creation. Thirty minutes later, she checked that anonymous e-mail account and saw that she had more than 800,000 new messages; the only reason there were not even more messages was that her mailbox was full.

Required:

Evaluate the ethical issues as described in the scenario.

(1000 to 1200 words)

In: Computer Science

Twenty-one years later, the firm has 20 stores throughout 7 east coast states, of which 10...

Twenty-one years later, the firm has 20 stores throughout 7 east coast states, of which 10 are operated by the company and 10 by franchisees. Each store was built to the same specifications for both interior and exterior design. Locations were chosen in heavily African-American populated areas since their success depended greatly upon serving a target market of customers with the resources to purchase the firm’s art products. Inventory items were standardized into the three categories, and advertising focused on one of the three product themes. Prospective franchisees signed a document that was designed to keep sales of items, locations and other details standard irrespective to their geographical location, and each new location required an initial payment of $10,000. In addition, franchisees were obligated to a royalty of 5% of gross sales, and each franchisee had to spend at least 2% of gross receipts on local advertising. The firm believed that properly trained employees were the key to success; therefore, managers and company trainees were required to attend a two-week program covering all aspects of the company’s operations. This case begins in June, 2010 when Mr. Smith started preparing to complete his analysis for the construction of five new company-owned stores where the sizes have not yet been determined. Mr. Smith and his management team believe that a larger capacity store with capacity to handle $100,000 in product inventory would be more profitable than the present stores where inventory capacity is $70,000. The company faces two choices that Mr. Smith must evaluate with your assistance: continue with the current smaller sized stores, or select larger stores for the firm’s strategic growth or construction plan. The initial cost will be $2,100,000 for each of the smaller sized stores and $3,700,000 for each of the five larger ones. Projected present value of cash flows for the smaller units projected for the firm’s five-year strategic plans are $450,000 for each year while the projected cash flows for the larger units are projected to be $740,000 per year. Because the projects must be financed from different sources, unfortunately, financing costs will be different. Mr. Smith’s data indicates that the current and projected 120-day treasury bill rate is 9.75% and the firm’s expected market return is 12.5% for the plan period. The beta for the African art industry and the planned new stores is 1.15. However, the bond rates for the projects are 10% for the smaller stores and 12.7% for the larger store funds. Thus, the details have been provided for the analysts, namely you, to:

1. Determine the capital asset pricing model rate for the firm.

2. Combine that rate with the specific debt rates for each store model, using a tax rate of 34%.

3. Determine the weighted average cost of capital (WACC) for each project.

4. Find the net present value (NPV) for each alternative purchase.

5. Use the NPV and profitability index analyses (because each project will have a different WACC rate) to advise/convince Mr. Smith of your selection of the most desired, profitable project for the company.

In: Finance

Question: In terms of comparative advantage, explain how does the Iowa Car Crop works. (IOWA CAR...

Question: In terms of comparative advantage, explain how does the Iowa Car Crop works.

(IOWA CAR CROP STORY)

There are two technologies for producing automobiles in America. One is to manufacture them in Detroit, and the other is to grow them in Iowa. Everybody knows about the first technology; let me tell you about the second. First you plant seeds, which are the raw material from which automobiles are constructed. You wait a few months until wheat appears. Then you harvest the wheat, load it onto ships, and sail the ships eastward into the Pacific Ocean. After a few months, the ships reappear with Toyotas on them.

International trade is nothing but a form of technology. The fact that there is a place called Japan, with people and factories, is quite irrelevant to Americans’ well-being. To analyze trade policies, we might as well assume that Japan is a giant machine with mysterious inner workings that convert wheat into cars. Any policy designed to favor the first American technology over the second is a policy designed to favor American auto producers in Detroit over American auto producers in Iowa. A tax or a ban on “imported” automobiles is a tax or a ban on Iowa-grown automobiles. If you protect Detroit carmakers from competition, then you must damage Iowa farmers, because Iowa farmers are the competition.

The task of producing a given fleet of cars can be allocated between Detroit and Iowa in a variety of ways. A competitive price system selects that allocation that minimizes the total production cost. It would be unnecessarily expensive to manufacture all cars in Detroit, unnecessarily expensive to grow all cars in Iowa, and unnecessarily expensive to use the two production processes in anything other than the natural ratio that emerges as a result of competition.

That means that protection for Detroit does more than just transfer income from farmers to autoworkers. It also raises the total cost of providing Americans with a given number of automobiles. The efficiency loss comes with no offsetting gain; it impoverishes the nation as a whole.

There is much talk about improving the efficiency of American car manufacturing. When you have two ways to make a car, the road to efficiency is to use both in optimal proportions. The last thing you should want to do is to artificially hobble one of your production technologies. It is sheer superstition to think that an Iowa-grown Camry is any less “American” than a Detroit-built Taurus. Policies rooted in superstition do not frequently bear efficient fruit.

In 1817, David Ricardo—the first economist to think with the precision, though not the language, of pure mathematics—laid the foundation for all future thought about international trade. In the intervening 150 years his theory has been much elaborated but its foundations remain as firmly established as anything in economics.

Trade theory predicts first that if you protect American producers in one industry from foreign competition, then you must damage American producers in other industries. It predicts second that if you protect American producers in one industry from foreign competition, there must be a net loss in economic efficiency.

In: Economics