stock purchase the following steps calculate the amount of a stock purchase. (a) create the variable costpershare and assign it the value 25.625. (b) create the variable numberofshares and assign it the value 400. (c) create the variable amount and assign it the product of the values of costpershare and numberofshares. (d) display the value of the variable amount. step by step

Respuesta :

Answer:

#include<iostream>

#include<conio.h>

using namespace std;

main()

{

int numberofshares;

float costpershare, amount;

costpershare= 25.625;

numberofshares = 400;

amount = costpershare*numberofshares;

cout<<"\nTotal amount of Stock Purchase =" << amount;

getch();

}

Explanation:

In above mentioned program, total amount of stock purchase need to be calculated for given data. The values 25.625 and 400 assigned to the variables of cost per share and  number of shares.

The formula to calculate the total amount of stock purchase is simply Multiplication of cost and total number of shares. The output will be displayed with the help of variable named as amount.

Solution

Cost per Share = 25.625

Number of shares = 400

amount = cost per share * Number of shares

              =   25.625 * 400

              =    10,250