Can someone add comments on this explaining the code and also I could not figure out...

Can someone add comments on this explaining the code and also I could not figure out how to code the finalbattle to make it where if u use a lowercase "a" for the final attack you lose.

from sys import exit

print ("The city needs your help, you must save them!")
print ("What is your name?")
name=input("Enter your name:")
print ("Ok, are you ready to begin?")
def decisions():
decision = input("yes or no?\n")
if decision == "yes":
print ("You made the right decision, may your blade keep you safe.")
elif decision == "no":
print ("You have let the people down and the city will be destroyed.")
exit(0)
decisions()

def choosepath():
print ("You must leave the town in order to save the people.")
print ("You may go either north or south to destroy the enemies raiding the city.")
print ("The paths to the east and west have been destroyed and it is up to you to stop this from happening elsewhere.")
path = ''
while path !='north' and path !='south'and path !='east' and path !='west':
print ("which path would you like to take?")
print ("choose north or south:")
path = input()
if path =="north":
print ("You head north towards the enemy approching the front gates.")
elif path=="south":
print ("You head south to sneak up on the enemy and attack from behind.")
choosepath()

print("You arrive at the battle and start planning your attack!")
print("You spot an enemy and must make a wise decision to start your fight...")
print("Before picking your target you must choose your weapon!")
def weapon():
weapon = ''
while weapon != 'sword' and weapon !='axe':
print("Choose your sword or axe!")
weapon = input ()
if weapon == "sword":
print("You chose sword!")
elif weapon =="axe":
print ("You chose axe!")
weapon()

print("Now that you have chosen your weapon it is time to attack!")
print("You look around for a brief moment...")
print("You start to have doubts, now is your chance to turn around.")
print("Would you like to turn around and let the people die to save your own life?")
final_decision = input ("yes or no?\n")
if final_decision == "yes":
print("You have let the people down...")
exit(0)
elif final_decision =="no":
print("You are a brave knight.")
print("Now is your time to strike!")
print("Quickly! the enemy is approaching, it is now or never!")

enemy = 0
a=50
A=50

enemy_approaches = input ("Press a to attack!")
if enemy_approaches=='a' or enemy_approaches =='A':
enemy = enemy + 50
enemy_approaches = input ("The enemy is getting weaker keep attacking!")
if enemy_approaches=='a' or enemy_approaches =='A':
enemy = enemy + 50
enemy_approaches = input ("Time for the final blow!")
if enemy_approaches=='a' or enemy_approaches =='A':
enemy = enemy+ 50
if enemy >= 150:
print ("Congratulations, you have defeated the enemy!")

def finalbattle():
print("You defeated a soldier now it is time to take out the leader!")
print("You must be careful great knight, he if very powerful!")
print("You will need to use power attacks to defeat him!")
print("Use capital A for a power attack.")
print("Use basic attacks until he is stunned, when the time is right kill him with a powerful blow!")
print("...")
print("NOW! IT IS TIME TO ATTACK!")

finalbattle()

enemy = 0
a=50
A=100

enemy_approaches = input ("Press a to attack!")
if enemy_approaches=='a':
enemy = enemy + 50
enemy_approaches = input ("One more and you will have him stunned!")
if enemy_approaches=='a':
enemy = enemy + 50
enemy_approaches = input ("You stunned him! Use your powerful strike")
if enemy_approaches =='A':
enemy = enemy+ 100
if enemy >= 200:
print("You have defeated the boss and saved the city!")
print("YOU WIN!")

In: Computer Science

assuming 80 mg of vitamin C present in 29.57 ml of the orange juice, how many...

assuming 80 mg of vitamin C present in 29.57 ml of the orange juice, how many millileters of 0.0102 M KIO3 would be required to reach the stoichiometric point? i dont want just an answer, i want to know how to do it too. thanks!

In: Chemistry

Your company has been testing two flavors of coffee using free samples, let's call them Flavor...

Your company has been testing two flavors of coffee using free samples, let's call them Flavor A and Flavor B. You are planning to only offer one flavor for sale and are interested in whether your customers prefer Flavor A or Flavor B.

You use a taste testing survey of 60 randomly selected people, and find that 36 people prefer Flavor B.

Using greta and assuming a generative model with Bernoulli data (X) and a Beta prior (θ):

X∼Bernoulli(θ)

Θ∼Beta(2,2)

determine what your updated probability is that Flavor B is preferred to Flavor A. In other words, what percentage of your posterior draws have a theta that is above 0.5?

(Enter answer as a decimal - i.e. 12% would be entered as 0.120. Round to the nearest thousandths place)

Please show me how something like this would be solved using R.

In: Math

[The following information applies to the questions displayed below.] Astro Co. sold 20,400 units of its...

[The following information applies to the questions displayed below.] Astro Co. sold 20,400 units of its only product and incurred a $53,368 loss (ignoring taxes) for the current year as shown here. During a planning session for year 2018’s activities, the production manager notes that variable costs can be reduced by 50% by installing a machine that automates several operations. To obtain these savings, the company must increase its annual fixed costs by $154,000. The maximum output capacity of the company is 40,000 units per year. ASTRO COMPANY Contribution Margin Income Statement For Year Ended December 31, 2017 Sales $ 773,160 Variable costs 618,528 Contribution margin 154,632 Fixed costs 208,000 Net loss $ (53,368 ) 4. Compute the sales level required in both dollars and units to earn $240,000 of target pretax income in 2018 with the machine installed and no change in unit sales price. (Do not round intermediate calculations. Round your answers to 2 decimal places. Round "Contribution margin ratio" to nearest whole percentage)

In: Accounting

1. How could DAPD1 loss-of-function explain what is seen in the patients? (4 marks) 2. Why...

1. How could DAPD1 loss-of-function explain what is seen in the patients?

2. Why would denaturation of the antigen before injection give the unexpected results described? Explain both why denaturation would lead to normal levels of T-cell response to virally infected cells, and lack of antibody binding to viral antigen.

In: Biology

hi guys, could someone tell my where this is going wrong please, its adding into a...

hi guys, could someone tell my where this is going wrong please, its adding into a double linked list, i have another method to add at the end which is working but the rest of this??

thanks

public boolean add(int index, Token obj) {
       if(obj == null) {
           throw new NullPointerException();
       }
       if (index < 0 || index > this.size()-1) {
           throw new IndexOutOfBoundsException();
       }
       // new node to add
       Node toADD = new Node(null,null,obj);
      
       //insert at the beginning of the list
       if(index == 0) {
          
           // make the next of the new node point to the previous head, and previous to null
           toADD.next = head;
           toADD.prev = null;
           //change the previous of head to the new node
           if(head != null) {
               head.prev = toADD;
           // set the new node to be the head;
           head = toADD;
           size++;
           }
       if(index >1) {
          
           for(int i =1; i<= index; i++ ) {
               if(index == i) {
                   Node oldNode = this.getNode(i);
                   toADD.prev = oldNode.prev;
                   oldNode.prev = toADD;
                   toADD.next = oldNode;
                   toADD.prev.next = oldNode;
                   size++;
                   }
       if(index == this.size()-1) {
           this.add(obj);

In: Computer Science

Question 3 The town of Cypress Creek is preparing to go to war against the American...

Question 3

The town of Cypress Creek is preparing to go to war against the American government. To do this, it is building a giant satellite laser! To build the laser, the government of the town will resort to taxation to fund its expenditure. The initial economy of Cypress Creek can be expressed by the following agents:

Consumers, C = 25 + 0.95(Y-T)

Output, Y = 5000

Government expenditures, G = 2000

Taxation, T = 2000

Investors, I = 750-125r

Markets are fully competitive and the equilibrium condition for markets are:

Goods and service market: Y =C + I + G

Financial market: I = S

When it builds the Satellite, government and taxation change to

Government expenditures, G = 4000

Taxation, T = 4000

Hank Scorpio, the towns' founder, announces that "even by increasing government spending and

taxation, we are not worst off, as production has not changed!"

i) [2 points] check to make sure output does not change.

j) [2 points] find the consumption level in both scenario's (low and high government spending)

k)[3 points] who is paying for the burden of taxation? (how is this new spending/taxation being

distributed between investors and consumers)

l)[2 points] as the government increases its spending (G from 2000 to 4000) why won't output

change?

Hank Scorpio makes another announcement "People of North Haverbrook! We must all work together in this to crush the American Government - I implore you to save you wages! Don't spend!"

m)[2 points] by how much would consumers need to reduce their Marginal propensity to consume

(MPC) such that the market clearing interest rate does not change?

n)[2 points] Who will end up paying the burden of this project? (consumers or investors? And by

how much?)

In: Economics

4. Read three recent news articles about Biometrics and write a brief summary. Include a reference...

4. Read three recent news articles about Biometrics and write a brief summary. Include a reference to each article.

In: Computer Science

In Java Language. Must Include Comments. We will simulate a dice game in which 2 dice...

In Java Language.

Must Include Comments.

We will simulate a dice game in which 2 dice are rolled.

If the roll is 7 or 11, you win.

If the roll is 2, 3 or 12, you lose

If the roll is any other value, it establishes a point.

If, with a point established, that point is rolled again before a 7, you win.

If, with a point established, a 7 is rolled before the point is rolled again you lose.

Build your algorithm incrementally. First write a program that simulates a roll of two dice, then

outputs if it is a simple win (7 or 11), or a simple loss (2 or 3 or 12), or something else.

1. I will help you with the algorithm:

//get a random number between 1 and 6, call it d1

//get a second random number between 1 and 6, call it d2.

//compute the total & print it so we know what it was

//if the total is 7 or 11 print “congratulations, you win”

// else if the total is 2 or 3 or 12 print “you lose”

//else print “something else”

2. Create the program and test it by running it a few times to verify that you are correctly

printing whether you won, lost, or “something else”.

3. Now fix the part where you wrote “something else”. In this case you rolled a number which

we called total. We need to keep rolling the dice and looking at the new total each time. If the

new total is the same as total, you win. If the new total is 7, you lose. And if something else

you roll again...... For example, an initial total of 6 was neither a win or a lose. So 6 is now

the important number called “point” above. Roll the dice again, if it is 6 you win, and if 7 you

lose. If anything else you roll again and keep doing so until you roll either a 6 and win, or 7

and lose.

Write this part of your algorithm here (or on another piece of paper). Once we verify your logic is

correct you may code it.

In: Computer Science

On February 12, 2005, Nancy Trout and Delores Lake formed Kingfisher Corporation to sell fishing tackle....

On February 12, 2005, Nancy Trout and Delores Lake formed Kingfisher Corporation to sell fishing tackle. Pertinent information regarding Kingfisher is summarized as follows.

Kingfisher's business address is 1717 Main Street, Ely, MN 55731; its telephone number is (218) 555-2211; and its e-mail address is [email protected]. The employer identification number is 11-1111111, and the principal business activity code is 451110.

Nancy owns 50% of the common stock and is president of the company, and Delores owns 50% of the common stock and is vice president of the company. No other class of stock is authorized.

Both Nancy and Delores are full-time employees of Kingfisher. Nancy's Social Security number is 123-45-6789, and Delores's Social Security number is 987-65-4321.

Kingfisher is an accrual method, calendar year taxpayer. Inventories are determined using FIFO and the lower of cost or market method. Kingfisher uses the straight-line method of deprecation for book purposes and accelerated depreciation (MACRS) for tax purposes. During 2018, the corporation distributed cash dividends of $80,000.

Kingfisher Corporations depreciable assets with $240,000 original cost were purchased on September 15, 2015. These assets are classified as 5-YR MACRS. You will need to determine the correct 2018 tax depreciation expense on these assets and take this into consideration in your final solution on form 1120

Kingfisher's financial statements for 2018 are shown below.

Income Statement
Income
Gross sales $2,408,000
Sales returns and allowances (80,000)
Net sales $2,328,000
Cost of goods sold (920,000)
Gross profit $1,408,000
Dividends received from stock investments in
      less-than-20%-owned U.S. corporations
12,000
Interest income:
    State bonds $  14,000
    Certificates of deposit 10,000 24,000
Total income $1,444,000
Expenses
Salaries—officers
    Nancy Trout $160,000
    Delores Lake 160,000 $320,000
Salaries—clerical and sales 290,000
Taxes (state, local, and payroll) 85,000
Repairs and maintenance 56,000
Interest expense:
    Business loans $  12,000
    Loan to purchase state bonds 8,000 20,000
Advertising 6,000
Rental expense 68,000
Depreciation* 40,000
Charitable contributions 15,000
Employee benefit programs 24,000
Premiums on term life insurance policies on lives of Nancy Trout and
      Delores Lake; Kingfisher is the designated beneficiary
16,000
Total expenses (940,000)
Net income before taxes $  504,000
Federal income tax (106,680)
Net income per books $397,320

*The depreciation expense for taxes is the sames as the depreciation expense per the books.

Balance Sheet
Assets January 1, 2018 December 31, 2018
Cash $  380,000     $  337,300      
Trade notes and accounts receivable 308,400     480,280      
Inventories 900,000     1,012,000      
State bonds 160,000     160,000      
Federal income tax refund -0-     1,320      
Certificates of deposit 140,000     140,000      
Stock investments 300,000     300,000      
Building and other depreciable assets 240,000     240,000      
Accumulated depreciation (88,800)    (128,800)     
Land 20,000     20,000      
Other assets 3,600     2,000      
    Total assets $2,363,200     $2,564,100      
Liabilities and Equity January 1, 2018 December 31, 2018
Accounts payable $  300,000     $  223,880      
Other current liabilities 80,300     40,000      
Mortgages 210,000     200,000      
Capital stock 500,000     500,000      
Retained earnings 1,272,900     1,590,220      
    Total liabilities and equity $2,363,200     $2,564,100      

During 2018, Kingfisher made estimated tax payments of $27,000 each quarter to the IRS.

Determine Kingfisher's income tax liability for tax year 2018 providing the following information that would be reported on Form 1120 and supporting schedules.

Additional question: What should Kingfishers deferred federal tax asset or liability be as of December 31, 2018. Show calculation please

In: Accounting

Part A On January 1, 2018, ABC Co. provides goods to a customer with the following...

Part A On January 1, 2018, ABC Co. provides goods to a customer with the following payment plan: Date Amount Jan 1, 2018 $1,500 Jan 1, 2019 $1,000 Jan 1, 2020 $1,000 Jan 1, 2021 $1,000 Jan 1, 2022 $4,000 Total $8,500 The customer normally would be subject to 8% interest. Required: a) What is the product revenue that is recorded by ABC on the sale on January 1, 2018? b) What will be the interest revenue for 2018 for ABC as a result of this transaction? Show and label all calculations. State all factors. You may use your finance formulas or tables from the book only. Part B SMU Inc. sold product to a customer on December 31, 2018. The customer’s price was “$10,000 with no interest”. The customer only has to make annual payments of $2,000 per year for five years, starting December 31, 2019. The customer would normally be subject to 10% interest based on their risk level. The cost of the product sold was $7,000 to SMU. Required: a) Calculate the revenue SMU Inc. would record on the car sale in 2018. (Show your calculations.) **USE PV tables from the book only. State all factors. b) Calculate the gross profit on the product sale. c) Prepare all journal entries for 2018 and 2019 as a result of this arrangement. d) What is the value of the outstanding note receivable from the customer after the first payment on December 31, 2019?

In: Accounting

Explain the difference between a confidence interval and credible interval?

Explain the difference between a confidence interval and credible interval?

In: Math

what does a 16S rDNA sequence of an organism look like? This sounds like a dumb...

what does a 16S rDNA sequence of an organism look like? This sounds like a dumb question but I do not understand what this is. How many base pairs?

What is the 16S rDNA sequence of Streptomyces aureofaciens? I have to find it and paste it in an assignment but I do not know how to find it or where to look. Please help.

In: Biology

Prepare a 700- to 1,050-word paper defining logistics and discuss how logistics influences the supply chain....

Prepare a 700- to 1,050-word paper defining logistics and discuss how logistics influences the supply chain. Define logistics and discuss the increased importance of logistics on satisfying customer requirements for a product or service. Identify and describe the managerial issues that influence logistics and directly impact the supply chain. Drawing on personal experience, provide an example of a logistics managerial issue which lead to customer dissatisfaction, and one example where logistics plays a crucial role in customer satisfaction.

In: Economics

Cyber Security Control Frameworks are created to provide guidance in developing security policies and procedures. State...

Cyber Security Control Frameworks are created to provide guidance in developing security policies and procedures. State the control frameworks and give two examples of how this control is applicable in developing security policies and procedures?

In: Computer Science