Where f is the fahrenheit temperature and c is the celsius


1. The formula for converting a temperature from Fahrenheit to Celsius is

C=5/9(F-32)

where F is the Fahrenheit temperature and c is the Celsius temperature. write a function named Celsius  that accepts a Fahrenheit temperature as an argument. The function should return the temperature, converted to Celsius. Demonstrate the function by calling it in a loop that display a table of the Fahrenheit temperatures 0 through 20 and their Celsius equivalents. 

2. The profit from the sale of a stock can be calculated as follows:

Profit ? (( NS X  SP ) -  SC ) - (( NS X  PP ) +  PC )

where  NS is the number of shares,  SP is the sale price per share,  SC is the sale commission paid,  PP is the purchase price per share, and  PC is the purchase commission paid. If the calculation yields a positive value, then the sale of the stock resulted in a profit. If the calculation yields a negative number, then the sale resulted in a loss.

INSTRUCTIONS

Write a function that accepts as arguments the stock name, the stock ticker symbol, number of shares, the purchase price per share, the purchase commission paid, the sale price per share, and the sale commission paid. The function should return the profit (or loss) from the sale of stock.

Then use the function that you wrote in a program that calculates the total profit or loss from the sale of multiple stocks.  Therefore, the program must loop to allow this functionality.  The program should ask the user for the number of stock sales and the necessary data for each stock sale. It should accumulate the profit or loss for each stock sale and then display the total.

You must then allow the user to create a file that will store data about each stock sale.  The user should be able to create the own file name.  The data written to the file must be coherent data.  For example, do not simply written numeric data without an explanation of that numeric data.  You must also write the grand total of the sales and whether the sale ended in a profit or loss.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Where f is the fahrenheit temperature and c is the celsius
Reference No:- TGS01142027

Expected delivery within 24 Hours