1. Write a program that helps a stock market investor understand how much they've made when selling Acme Software, Inc. stock. 2. Ask your user how many shares of Acme Software, Inc. they purchased. 3. And ask your user how much they paid per share. 4. Then, assume that your user sold the same number of shares they had purchased some time later. 5.Ask your user at what price they sold the shares. 6. In both instances, the purchase and sale, your user had to pay their stockbroker a commission that amounted to 2% of the amount paid for the stock as well as the amount received for the stock. 7.Then, display: a) The amount your user paid for the stock. b) The amount of commission your user paid their stockbroker when they bought the stock. c) The amount your user sold the stock for. d) The amount of commission your user paid their stockbroker when they sold the stock. e) The amount of profit that your user made after selling the stock and paying the two commissions to their broker. (Important note: If the amount of profit that your program displays is a negative number, then your user lost money on the transaction.) Other coding notes: 1. Make it simple and use variables of type double for the number of shares, the dollar amounts and the commission (0.02 == 2%). 2. A very complete program might use an if statement or two.
Operations
In mathematics and computer science, an operation is an event that is carried out to satisfy a given task. Basic operations of a computer system are input, processing, output, storage, and control.
Basic Operators
An operator is a symbol that indicates an operation to be performed. We are familiar with operators in mathematics; operators used in computer programming are—in many ways—similar to mathematical operators.
Division Operator
We all learnt about division—and the division operator—in school. You probably know of both these symbols as representing division:
Modulus Operator
Modulus can be represented either as (mod or modulo) in computing operation. Modulus comes under arithmetic operations. Any number or variable which produces absolute value is modulus functionality. Magnitude of any function is totally changed by modulo operator as it changes even negative value to positive.
Operators
In the realm of programming, operators refer to the symbols that perform some function. They are tasked with instructing the compiler on the type of action that needs to be performed on the values passed as operands. Operators can be used in mathematical formulas and equations. In programming languages like Python, C, and Java, a variety of operators are defined.
1. Write a
2. Ask your user how many shares of Acme Software, Inc. they purchased.
3. And ask your user how much they paid per share.
4. Then, assume that your user sold the same number of shares they had purchased some time later.
5.Ask your user at what price they sold the shares.
6. In both instances, the purchase and sale, your user had to pay their stockbroker a commission that amounted to 2% of the amount paid for the stock as well as the amount received for the stock.
7.Then, display:
a) The amount your user paid for the stock.
b) The amount of commission your user paid their stockbroker when they bought the stock.
c) The amount your user sold the stock for.
d) The amount of commission your user paid their stockbroker when they sold the stock.
e) The amount of profit that your user made after selling the stock and paying the two commissions to their broker.
(Important note: If the amount of profit that your program displays is a negative number, then your user lost money on the transaction.)
Other coding notes:
1. Make it simple and use variables of type double for the number of shares, the dollar amounts and the commission (0.02 == 2%).
2. A very complete program might use an if statement or two.
Step by step
Solved in 3 steps with 2 images
hello, i forgot to mention, i need the
----
1. Write a program that helps a stock market investor understand how much they've made when selling Acme Software, Inc. stock.
2. Ask your user how many shares of Acme Software, Inc. they purchased.
3. And ask your user how much they paid per share.
4. Then, assume that your user sold the same number of shares they had purchased some time later.
5.Ask your user at what price they sold the shares.
6. In both instances, the purchase and sale, your user had to pay their stockbroker a commission that amounted to 2% of the amount paid for the stock as well as the amount received for the stock.
7.Then, display:
a) The amount your user paid for the stock.
b) The amount of commission your user paid their stockbroker when they bought the stock.
c) The amount your user sold the stock for.
d) The amount of commission your user paid their stockbroker when they sold the stock.
e) The amount of profit that your user made after selling the stock and paying the two commissions to their broker.
(Important note: If the amount of profit that your program displays is a negative number, then your user lost money on the transaction.)
Other coding notes:
1. Make it simple and use variables of type double for the number of shares, the dollar amounts and the commission (0.02 == 2%).
2. A very complete program might use an if statement or two.