Write a function named celsius

Assignment Help Basic Computer Science
Reference no: EM13859263

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.

Reference no: EM13859263

Questions Cloud

Calculate net pay for november and record the payroll : Calculate net pay for November and record the payroll and calculate the FICA withholdings that should be made for each employee for December 31.
Write a report for random noise : We need to enter a music.wave file with random noise adding them together by using matlab, after that the signal of both music and random noise will enter to a three types (or two) of filters to remove only random noise
From the e-activity : From the e-Activity, devise a scenario where a user in a business environment is unable to print a document to a printer connected to a Windows Server 2012 print server. Determine at least two (2) troubleshooting steps an IT support technician should..
Research and evaluate authoritative standards : Research and evaluate authoritative standards for detecting fraud - The paper should be in paragraph format, please do not list items in bullet format or otherwise create unnecessary empty space.
Write a function named celsius : 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 b..
Calculate the position of poid d when piston 1 is retracted : Calculate the position of poid D when Piston 1 is retracted 8 in from fully extented position. Calculate the force developed by the actuator when Piston 1 is retracted 8 in from fully extented position.
Write a paper on the advantages of the inventory models : Write a 300 to 500 word paper on the advantages and disadvantages of the three different inventory models known as EOQ (economic order quantity).
Case diagram-airline reservation problem : To summarize, this swing GUI displays the reservation form and the airplane seating availability "diagram". Construct a Use-Case diagram for this airline reservation problem.
Find a current news article in the ashford university : Find a current news article in the Ashford University Library's ProQuest Newsstand database about an ethical issue that involves computer technology, or involves a technology company Summarize the facts and major points from the article and be sure t..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Create supply chain management system

What are some of the reasons that RMO decided to build supply chain management system previous to customer support system?

  Topic selection and research paper requirements

Prior to writing your paper, you may choose to submit a short research topic proposal in the form of a short paragraph, to your instructor. If you choose to do so, please email a copy of your paragraph description of your Research Paper topic p..

  What happens when you assign

What happens when you assign 340,282,343,598.33 to a Single variable? Assuming that the variable in question is named sngNumber and you execute the statement MessageBox.Show

  What is the technique called

In the transport layer, data transmission is controlled to ensure data integrity and avoid data loss. What is the technique called?

  Formula gives the distance between two points (

formula gives the distance between two points (x1, y1) and (x2, y2) in the Cartesian plane:

  Create the class diagram and write the code

Create the class diagram and write the code that defines the class and implements the mutator methods.

  Consumption of goods

Joe College is a UT student.  His course schedule is set and his parents have already paid for his tuition, room, and board for the semester. Now Joe must decide how to allocate his time between "leisure" (which includes study time, socializing, etc...

  Explain the principles of logical design

Explain the principles of logical design. Discuss the strengths and weaknesses of various network designs. Demonstrate an understanding of network design by presenting their own designs and share and promote own design by means of written communic..

  Explain the four stages of the bpm process and summarize

Explain the four stages of the BPM process and summarize the activities in each.

  Describe three components found in a web system

In order to design Web forms in Visual Studio.NET

  Multiplexors whose control bit allows

Multiplexors whose control bit allows you to select between one of two modes right shift or left shift. Include logic to perform arithmetic shift left and arithmetic shift right . This means you must include logic to perform sign extension in ..

  Cloud computing

Select two (2) organizations in which you are interested, and use the Internet and Strayer Library to research the advantages and disadvantages of cloud computing for the selected organizations. Use the Internet to research the characteristics ..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd