Write a program to test the functions by computing function

Assignment Help C/C++ Programming
Reference no: EM131049339

Assignment:  C++ - User Functions

Given:   tanh(x ) = 1 - 2 e-2x + 2 e-4x - 2 e-6x + 2 e-8x - 2 e-10x   + ....
cos(x) = 1 - x2 / (2!) + x4 /(4!) - x6  /(6!) + x8 /(8!) +  ....
where   0 ≤  x  < 2 π

Write two functions:

tanh(ax) where a and x are passed to the function and
cos(ax)  where a and x are passed to the function.

The functions must give answers that are accurate at least to six significant digits.

Write a program to test the functions by computing F = 5 tanh(ax) + 4 cos(ax) where 0 ≤ x < 2 π with the values of a and x entered by the user.

Check the answer with a calculator.

Check the functions with these data:

a

X

F

0

0

4

2.78

0

4

0

2.78

4

1

2.78

1.220321454

1.5

2.6

2.092175112

3.78

1

1.782610497

For your reference, read ex, sin(x) and cos(x) functions at www.csun.edu/~glaw and see how these functions are written.

Reference no: EM131049339

Questions Cloud

At what price is the stock selling : Favored stock will pay a dividend this year of $2.88 per share. Its dividend yield is 8%. At what price is the stock selling? (Do not round intermediate calculations.)
Maturity of the bonds-what is the price of the bond now : Several years ago, Castles in the Sand Inc. issued bonds at face value of $1,000 at a yield to maturity of 5.8%. Now, with 5 years left until the maturity of the bonds, the company has run into hard times and the yield to maturity on the bonds has in..
What was plylers equity multiplier : Assuming that all Plyler’s sales are on credit, what was the company’s Days Sales Outstanding in 2015? (For balance sheet accounts, use the average of the beginning and end-of-year balances). What was Plyler’s Equity Multiplier for 2015?
Explain what the wacc means : BUS 420 - Corporate Finance - Explain what the WACC means, how can you use it in decisions, and do you think that you got a reasonable estimate.
Write a program to test the functions by computing function : Write a program to test the functions by computing F = 5 tanh(ax) + 4 cos(ax) where 0 ≤ x
Issue additional bonds to the public at face value : General Matter’s outstanding bond issue has a coupon rate of 9%, and it sells at a yield to maturity of 7.40%. The firm wishes to issue additional bonds to the public at face value. What coupon rate must the new bonds offer in order to sell at face v..
Consider for a moment a midlevel manager : Consider for a moment a midlevel manager at a multinational foods company, Fatima, who would seem to be at the top of her career. She's consistently making her required benchmarks and goals, she has built successful relationships with colleagues, ..
Explain the different transactions in inventory : Explain the different Transactions in Inventory – Sub Inventory Transfers, Inter Org transfers, Miscellaneous Transactions and Move Orders. Explain the different Inventory Controls – Locator, Lot, Serial and Revision. Explain Receiving Functionality ..
Develop information gathering and communication strategies : Learning Outcome: Develop information gathering (research) and communication strategies to enable the provision of professional advice to a client

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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