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

  Can a language have no reserved words

Can a language have no reserved words? That is, suppose every reserved word (such as if and for) were merely predefined identifier. Can such a language exist? Explain.

  Approach appropriate for company forefront of technology

However, adopting a secondary approach where others adopt early and a firm learns from their mistakes is often a viable strategy. When is each approach most appropriate and why?

  What features would you look for on the switches

What features would you look for on the switches you purchase for design and explain why you would want each feature. Do you need to include any other devices in this design?

  Relative risk comes form inside the organisation

Write a report on relative risk that comes form inside organisation as opposed to risk which comes from external sources.

  What are some additional performance metrics of interest

Suppose you have two systems. System #1 processes jobs at rate 100 jobs/sec and system #2 at a rate 150 jobs/sec. What is the speed-up and relative change of system #1 with respect to system #2?

  Discuss where nhs would fall on a technological acceptance

Develop an annotated bibliography containing ten references that can be used to evaluate five potential technological solutions for the scenario.

  Find any derivation in the grammar plus-times

find any derivation in the grammar PLUS-TIMES for i*(i) and for { i* (i + i) } by using the bottom-up parsing.

  Determine what check bits would be stored in memory

Suppose an 8-bit data word stored in memory is 11000010. Using the Hamming algorithm, determine what check bits would be stored in memory with data word. Show how you got your answer.

  Diseases of the gastrointestinal system

A new appreciation for the path the food you eat takes. Let's examine some of the problems that patients encounter in this complex body system. A section titled "A Quick Trip Through Some of the Diseases of the Gastrointestinal System".

  Find the average case complexity of sequential search

Find the average case complexity of sequential search in an array if the probability of accessing the last cell equals 1/2, the probability of the next to the last cell equals 1/4 .

  Write a sql statement to list the sequence owner and name

Write a SQL statement (not a DESCRIBE) to list the sequence owner and name for all of the sequence objects available to you.

  Purpose a workshop is to become familiar with the creation

The purpose of this workshop is to become familiar with the creation, search, and modification of B+-trees

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