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

  Write the definition of a function named addmoney

Now write the definition of a function named addMoney that receives two Money arguments and returns their sum, in normalized form. So if the equivalent of $1.85 and $2.19 is passed the function would return the equivalent of $4.04.

  Paper on human-computer interaction

Write a paper which is called Human-computer interaction

  Define a method hello

Define a method hello(name) which takes in a string representing a name and prints out "Hello, " followed by the name.

  How itdepartment helps organization achieve strategic goels

Discuss how the IT department helps the organization achieve their strategic goals

  What does n-tier architecture mean

What does N-tier architecture mean? Describe the purpose of the Presentation Layer, Business Layer, and Data Layer

  Sql dml for data modification in tables

Write SQL DML statements that will modify data from within a database. Using the Northwind database, write a SQL DML statement that will modify the data. Base it on the following requirements:

  Analyze a paper on artificial intelligence

Analyze a paper on Artificial Intelligence and I would like some additional help. I have researched the internet, catalogs and online books.

  Computer architecture is the combination of software and

computer architecture is the combination of software and hardware that is organized in such a fashion as to deliver the

  Display the new balances for both savers

Then set the annual InterestRate to 5%, calculate the next month's interest and display the new balances for both savers.

  How the chips are to be connected to the address bus

Explain in words how the chips are to be connected to the address bus. Thank You. Please Explain your answer, will help a lot.

  Analyse the case study and produce a vision document

Analyse the case study and produce a Vision document for a software system to solve the business issue identified in the case study - use case diagram capturing at least all critical and significant use cases that the system will have to support

  How big is block size used by the file system to read data

How big is the block size used by the file system to read data? Hint: use reads of varying sizes and plot the time it takes to do such reads. Also, be wary of prefetching effects that often kick in during sequential reads.

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