The function returns the price of one share of stock


The price of stocks is sometimes given to the nearest eighth of a dollar; for example, 29 7/8 or 89 1/2. Write a program that computes the value of the user's holding of one stock. The program asks for the number of shares of stock owned, the whole dollar portion of the price and the fraction protion. The faction portion is to be input as two int values, one for the numerator and one for the denominator. The program then outputs the value of the user's holdings. Your program should allow the user to repeat this calculation as often as the wishes. Your program will include a function definition that has three int arguments consisting of the whole dollar portion of the price and the two integers that make up the fraction part. The function returns the price of one share of stock as a single number of type double.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: The function returns the price of one share of stock
Reference No:- TGS0132684

Expected delivery within 24 Hours