answer.
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
larisa86 [58]
2 years ago
11

You decide to buy some stocks for a certain price and then sell them at anotherprice. Write a program that determines whether or

not the transaction wasprofitable. Here are the details:• Take three separate inputs: the number of shares, the purchaseprice of the stocks, and the sale price, in that order.• You purchase the number of stocks determined by the input.• When you purchase the stocks, you pay the price determined by the input.• You pay your stockbroker a commission of 3 percent on the amount paid forthe stocks.• Later, you sell the all of the stocks for the price determined by the input.• You pay your stockbroker another commission of 3 percent on the amountyou received for the stock.Your program should calculate your net gain or loss during this transaction andprint it in the following format:If your transaction was profitable (or if there was a net gain/loss of 0) print:"After the transaction, you made 300 dollars."(If, for example, you gained 300 dollars during the transaction.)If your transaction was not profitable, print:"After the transaction, you lost 300 dollars."(If, for example, you lost 300 dollars during the transaction.)Use string formatting.
Computers and Technology
1 answer:
kobusy [5.1K]2 years ago
7 0

Answer:

no_of_shares = int(input("Enter the number of shares: "))

purchase_price = float(input("Enter the purchase price of the stock: "))

sale_price = float(input("Enter the sale price of the stock: "))

total_stock_price = purchase_price*no_of_shares

total_spend_on_buying = total_stock_price + (0.03*total_stock_price)

total_sale_price = sale_price*no_of_shares

commission_while_selling = total_sale_price*0.03

net_gain_or_loss = total_sale_price - (total_spend_on_buying + commission_while_selling)

if(net_gain_or_loss<0):

print("After the transaction, you lost {} dollars".format(abs(net_gain_or_loss)))

else:

print("After the transaction, you made {} dollars".format(abs(net_gain_or_loss)))

You might be interested in
The domains of the risk IT framework mutually inform each other, creating flexibility and agility. It is possible to uncover a p
Andrej [43]

Answer:

The best option is A).True

Explanation:

This is because, according to the statement, it is possible to uncover a potential threat in the risk governance domain and quickly assess its impact using the risk evaluation domain in an IT environment. The risk IT framework is used in an IT environment for security of domains, the business involved, etc.

6 0
2 years ago
JAVA
barxatty [35]

Answer:

Answer is in the provided screenshot! This was a lot of fun to make!

Explanation:

We need to create a new Array which has to be the size of amount * original - as we now that we are going to have that many elements. Then we just iterate through all the values of the new array and set them equal to each of the elements in order.

Ignore the code in my main function, this was to print to the terminal the working code - as you can see from the output at the bottom!

5 0
2 years ago
Kaira's company recently switched to a new calendaring system provided by a vendor. Kaira and other users connect to the system,
goldfiish [28.3K]

The service model that Kaira’s company is using is Saas

Explanation

Kaira’s company is using Software as a Service to access their new calendaring system that has been hosted by a 3rd party vendor over the web. It is the work of the SaaS to host specific applications and to deliver these applications to customers over the cloud. With SaaS, Kaira’s company does not need to install their calendaring software on their PCs. Every useful thing they want from their calendaring system can easily be accessed over the internet. All the company will need are personalized accounts with usernames and passwords for their employees to access.

The other different types of Cloud Computing services include;

  • PaaS: A set of tools and services designed to make coding and deploying those applications quick and efficient.
  • IaaS: hardware and software that powers it all – servers, storage, networks, and operating systems.

Learn more:

What is cloud computing?

brainly.com/question/2662575

Explain the three basic types of Cloud computing

brainly.com/question/12967175

#LearnwithBrainly

3 0
2 years ago
Databases, authentication, and user accounts are all part of a website's ______________.
Varvara68 [4.7K]

Answer:

The answer is "Backend".

Explanation:

The Backend Development applies to just the webserver side when they concentrate mostly on how well the site functions. The website generally includes 3 sections consist of all this web design: a client, program, or server. The Backend user codes are the information provided by the database to both the web browser.

5 0
2 years ago
Mitchell is assisting her teacher in a project by entering data into the spreadsheet. Which types of data can Michelle enter in
Rainbow [258]

Hello, Paper, types of data that Michelle can enter into a cell is,

• Data – values, usually numbers but can be letters or a combination of both.

• Labels – headings and descriptions to make the spreadsheet easier to understand.

• Formulas – calculations that update automatically if referenced data changes.

Hope this helped!

4 0
2 years ago
Read 2 more answers
Other questions:
  • A mistake programmers often make with loops is that they ____.
    15·1 answer
  • Joe runs a handyman service. He enjoys writing and keeping up on the latest trends. He wants to share this information with his
    7·1 answer
  • PHP is based on C rather than ______.
    5·1 answer
  • Broker Ray is closely acquainted with the Subdivision Heights neighborhood of his town. Over the year, Ray has made it a practic
    7·1 answer
  • Which of the registration patterns is best suited for complex architecture? A. Client side discovery pattern B. Third party regi
    13·1 answer
  • XYZ Corp.’s facilities in Nashua, New Hampshire, are two office buildings 400 feet apart, each with its own LAN. To connect the
    9·1 answer
  • ________ is a free online service that enables a user to contact a cell phone number to hear who answers the telephone without i
    5·1 answer
  • Consider the formula: G=D+(A+C^2)*E/(D+B)^3 Show the order that a processor would follow to calculate G. To do so, break down th
    10·1 answer
  • If productCost and productPrice are numeric variables, and productName is a string variable, which of the following statements a
    11·1 answer
  • When you add a zero to the right of a decimal number, it multiplies its value by 10 (For example, "15" becomes "150"). What simi
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!