Question

In: Computer Science

Use Python ## Problem Set 3 - James is looking for his dream job, but has...

Use Python

## Problem Set 3

- James is looking for his dream job, but has some restrictions. He loves California and would take a job there if it paid over 40,000 a year. He hates Massachusetts and demands at least 100,000 to work there. Any other place he’s content to work for 60,000 a year, unless he can work in space in which case he would work for free.
- Write a program to capture the above statement
- For each of the following job offers, write down the output that would be generated.
- location = "Massachusetts" pay = 50000
- location = "Iowa" pay = 50000
- location = "California" pay = 50000
- location = "U.S.S. Enterprise" pay = 1
- location = "California" pay = 25000

  

Solutions

Expert Solution

CODE :

OUTPUT :

Raw_Code :

locations = ["Massachusetts","lowa","California","U.S.S. Enterprise","California"]   #list of locations of job offers
payments = [50000,50000,50000,1,25000]           #list of payents of job offers
for (i,j) in zip(locations,payments):           #loop over the job locations and payments
   if(i=="California" and j>=40000):               #condition to accept job at california
       print("James will accept job offer at ",i," for ",j)
   elif(i=="Massachussets" and j>=100000):           #condition to accept job at Massachussets
       print("James will accept job offer at ",i," for ",j)
   elif(i!="California" and i!="Massachussets" and j>=60000):   #condition to accept job at other places
       print("James will accept job offer at ",i," for ",j)       #printing respect output
   else:
       print("James will not accept job offer at ",i," for ",j)   #if he wont accept

*********Comment me for any queries and Rate me up***********


Related Solutions

Use Python : Problem Set 01: The network for this task has two input nodes, one...
Use Python : Problem Set 01: The network for this task has two input nodes, one hidden layer consisting of two nodes, and one output node. It uses a ReLU activation function. For the hidden layer, the weights for the first hidden node (from the input nodes) are (2.3, -0.64, 2). The last number is the weight for the bias term. The weights for the second hidden node are (-3, -2, -1). For the output layer, the weights are (5,...
USE PYTHON : # Problem Set 04: - Write a function to seek for all even...
USE PYTHON : # Problem Set 04: - Write a function to seek for all even numbers and odd numbers in the middle of two number A and B. Print even and odd numbers in 1 and 2020 (including both these two numbers) # Problem Set 05: - A website requests an user to input his account password. - Write a program to examize the validity of the password. - The valid password must consists of: - At least 1...
Use Python: # Problem Set 01: - Develop neurons and print truth table of the following...
Use Python: # Problem Set 01: - Develop neurons and print truth table of the following 2-input logic gates: AND, OR, NAND, NOR, XOR, XNOR and 1-input NOT gate (Notice: use Markdown to explain how you developed a neuron, and to insert images showing the truth table of logic gates before coding) # Problem Set 02: - Develop neuron and print truth table of XOR gate using only NAND gates - Develop neuron and print truth table of XOR gate...
Please Use Python 3.The Problem: Read the name of a file and then open it for...
Please Use Python 3.The Problem: Read the name of a file and then open it for reading. Read the name of another file and then open it for output. When the program completes, the output file must contain the lines in the input file, but in the reverse order. • Write the input, output, and the relationship between the input and output. • Develop the test data (A single test will be alright). Make the input file at least 3...
John Fillmore's lifelong dream is to own his own fishing boat to use in his retirement....
John Fillmore's lifelong dream is to own his own fishing boat to use in his retirement. John has recently come into an inheritance of $500,000. He estimates that the boat he wants will cost $400,000 when he retires in 5 years. How much of his inheritance must he invest at an annual rate of 10% (compounded annually) to buy the boat at retirement? On January 15, 2010, Dolan Corp. adopted a plan to accumulate funds for environmental improvements beginning July...
Problem Set 3: One-Way randomized ANOVA Research Scenario: A health psychologist is looking into the effects...
Problem Set 3: One-Way randomized ANOVA Research Scenario: A health psychologist is looking into the effects of different kinds of exercise on stress. She divides volunteers into three exercise groups: high-intensity interval training (HIIT) (n=8), yoga (n=8), or running (n=8). The volunteers participate in a set number of hours of the exercise for a month, after which the psychologist measures their stress levels on a scale of 1-40 where lower scores = lower stress, and higher scores = higher stress....
3. Henry and Ella have spent months looking for their dream home. One day the saw...
3. Henry and Ella have spent months looking for their dream home. One day the saw it and fell in love with everything about the house. They asked the Mr. Sellers, the realtor to draw up a purchase agreement, which they signed. Before signing the agreement, they asked if the house was in good shape. The real estate associate replied that it was. They signed the papers at the closing. After moving into the house, Henry and Ella soon discovered...
instructions- You have to use Python in order to do this Problem Set. 4 Cobb-Douglas Production...
instructions- You have to use Python in order to do this Problem Set. 4 Cobb-Douglas Production Function Suppose a firm uses the following production function Y = z × K0.3 × N 0.7 d , where Y is output, z is TFP, K is capital, and Nd is labor. 1. Set z = 10, K = 5 and plot the production function over the range Nd ∈ [0, 5] 2. Derive this function w.r.t. Nd.Set z = 10, K =...
A student majoring in economics is looking for a job. Given his work experience and grades,...
A student majoring in economics is looking for a job. Given his work experience and grades, the probability of getting a job offer from a firm to which he applies is 50%. If he applies to 3 firms, what is the probability that he gets 2 job offers? (Find the nearest answer.) a. 24.3% b. 38.4% c. 43.2% d. 37.5% e. 44.1%
our dream is to take up a job that basically provides wages that has a present...
our dream is to take up a job that basically provides wages that has a present value of at least $2,000,000 today (Ignoring taxes). Other words, you want the present value of all net future earning to be greater than 2 million. You want to feel like a millionaire today! You just completed your master of science in biochemistry and a large bio-medical company wants to hire you. Their offer is as follows: Annual salary of $200,000 starting one year...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT