1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
svetoff [14.1K]
3 years ago
10

An investor’s stock portfolio consists of four Exchange Traded Funds (SPY, QQQ, EEM, and VXX). Write a program that requests the

amount invested in each fund as input and then displays the total amount invested and each fund’s percentage of the total amount invested
Computers and Technology
1 answer:
Allisa [31]3 years ago
3 0

Answer:

The solution code is written in Python 3

  1. SPY = float(input("Enter SPY Amount: "))
  2. QQQ = float(input("Enter QQQ Amount: "))
  3. EEM = float(input("Enter EEM Amount: "))
  4. VXX = float(input("Enter VXX Amount: "))
  5. totalAmount = SPY + QQQ + EEM + VXX
  6. print("Total amount invested: $" + str(totalAmount))
  7. print("Percentage invested for SPY: " + str(SPY / totalAmount * 100) + "%")
  8. print("Percentage invested for QQQ: " + str(QQQ / totalAmount * 100) + "%")
  9. print("Percentage invested for EEM: " + str(EEM / totalAmount * 100) + "%")
  10. print("Percentage invested for VXX: " + str(VXX / totalAmount * 100) + "%")

Explanation:

Firstly, let's declare four variables, SPY, QQQ, EEM and VXX and use input() function to prompt user to input the amount invested in each fund (Line 1 - 4).

Next, sum up all the funds' amount and assign the total to totalAmount variable (Line 6).

Next display the total amount invested and the percentage invested for each fund using print function (Line 7 - 11). Please note the formula to calculate the percentage of investment is

(fund / totalAmount ) * 100

You might be interested in
Write a program that prompts the user to enter an oligonucleotide sequence, such as TATGAGCCCGTA.
Alexxx [7]

Answer:

Explanation:

The following code is written in Python. It continues looping and asking the user for an oligonucleotide sequence and as long as it is valid it outputs the reverse complement of the sequence. Otherwise it exits the loop

letters = {'A', 'C', 'G', 'T'}

reloop = True

while reloop:

   sequence = input("Enter oligonucleotide sequence: ")

   for x in sequence:

       if x not in letters:

           reloop = False;

           break

   if reloop == False:

       break

   newSequence = ""

   for x in sequence:

       if x == 'A':

           newSequence += 'T'

       elif x == 'T':

           newSequence += 'A'

       elif x == 'C':

           newSequence += 'G'

       elif x == 'G':

           newSequence += 'C'

   print("Reverse Complement: " + newSequence)

7 0
3 years ago
100 points, PLEASE HELP...To generate numbers between and including -10 to 10 you would use:
Orlov [11]

Answer:

A number line?

6 0
3 years ago
You are having trouble closing a program. You have tried to hit the Close button, the keyboard shortcut to close the program, an
vladimir2022 [97]

Answer:

You can open the version of your computer or device from the task manager to see the running programs and close the application

Explanation:

Right-click on the Windows Start menu and choose Task Manager (another way to open it is to press the keyboard shortcut Ctrl + Alt + Delete and select it from the options that appear).

NOTE: Click here if you don't know how to display Windows 8 Start.

You will see the main Administrator window (as in the image above). Displays a list of the programs that are currently running.

Find the application or process you want to close. Click on it with the RIGHT button and choose End task. In some cases a notice appears asking you to confirm it. Read what it says to know the consequences of forcing it. Confirm if you are determined to do so.

IMPORTANT:

There are viruses, adware or other spam programs that you may not be able to close even in this way. For these cases follow this link on how to clean viruses without entering Windows.

When you're done you can exit the Task Manager window. Click here to close background applications.

Estos pasos sirven para forzar que se cierren programas que no responden en Windows 10, 8 u 8.1. Enlazan además a instrucciones para cerrar programas o aplicaciones

4 0
3 years ago
30% of the mass of an objects is 24 kilograms. use this fact to find:
Triss [41]

Answer:

chemați. mfvd5. fn. cfcfcfcfcfcfcf 4t

6 0
3 years ago
Rock, Paper, Scissors is a two-player game in which each player chooses one of three items. If both players choose the same item
mezya [45]

Answer:

The answer is c

Explanation:

7 0
3 years ago
Other questions:
  • Can u suggest me some Hindi movies that is on you-tube please suggest
    7·2 answers
  • "You are on a service call to fix a customer’s printer when she asks you to install a software package. The software is on a per
    13·1 answer
  • You have three users who travel to four branch offices often and need to log on to the RODCs at these offices. The branch office
    12·1 answer
  • Discuss the different types of user-friendly interfaces and the types of users who typically use each.
    12·1 answer
  • Who distributes IP Address?
    10·1 answer
  • Explain the difference between social engineering and reverse social engineering.
    6·1 answer
  • PHOTOSHOP IS A GRAPHICS EDITING PROGRAM CREATED WITH IMAGES KNOWN AS________ ​
    6·1 answer
  • How should you schedule a meeting with someone in another time zone?
    7·1 answer
  • Whats the flow in this code, and whats the risk that its creating and what can i do to fix it? (c language)
    10·1 answer
  • ________ take advantage of vulnerabilities in software. Group of answer choices Blended threats Bots Trojan horses Direct-propag
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!