### How JustAnswer Works:

• Ask an Expert
• Get a Professional Answer
• 100% Satisfaction Guarantee

Raj, Engineer
Category: Homework
Satisfied Customers: 1267
Experience:  4 + Experiance in IT Industry
16752232
Type Your Homework Question Here...
Raj is online now

# Trigonometric functions, such as sine and cosine are normally

### Resolved Question:

Trigonometric functions, such as sine and cosine are normally evaluated on computers by using a truncated infinite series. The same approach is used to compute the inverse of these functions.
For instance, a truncated series used to calculate the cos of an arbitrary angle x is
 cos x=1-(x^2/2!) +(x^4/4!) - (x^6/6!)+.....+(-1)^n (x^(2n)/(2n)!)
and, k! = 1x2x3x......x k
           
in which x is in radians. Write a program in VB that allows user to enter values x and n. Then the
program calculates cos(x) by above formula using n first terms of the series and a DO LOOP. Using
your program find and report values of cos30 and cos60 for n=2, 4, and 5.
Develop a ‘Windows Forms’ application which allows user to enter values of n
and x via a graphical interface, and calculates/dispays cos(x) when ‘Calculate’ button is clicked User can exit the program by clicking ‘Exit’ button.
Submitted: 1 year ago.
Category: Homework
Expert:  LogicPro replied 1 year ago.
Hi,
Welcome back.
Thank you for asking me.
You should be using 'for logicpro'

What is the deadline?
Customer: replied 1 year ago.

hey, yeah sorry it just said ask logic pro so I thought it just send straight to you.

Customer: replied 1 year ago.
Expert:  Raj replied 1 year ago.
Hi There,

My Name is XXXXX XXXXX I will be helping you with the solution.
May I know how much time is left before the deadline?

Thank you
Customer: replied 1 year ago.

I just need it within an hour?

Expert:  Raj replied 1 year ago.
1 Hour is enough for me to complete the project.
Will be posting the solution within 1 hr.
Customer: replied 1 year ago.

thanks raj

Expert:  Raj replied 1 year ago.
You are Welcome
Almost done just implementing the do part of the loop
Customer: replied 1 year ago.

do you reckon you could make it as basic as possible? if that makes sense?

Expert:  Raj replied 1 year ago.
Yes I am making it very basic.
Customer: replied 1 year ago.

thankyou

Expert:  Raj replied 1 year ago.

Hi There,

Solution project is ready.

I have compressed the Solution project into one file.
So after downloading the file you will have to extract its content and in the folder open the file with name "Cos Function.sln" to open the project in Visual Basic

http://www.mediafire.com/?3jm77gss94qcy1k

If you face any difficulty than feel free to ask for help.

If the solution file is satisfactory than Please don't forget to RATE the Answer.
It will hardly take few seconds to RATE my Answer

Thank You and Have a Good Day.

Expert:  Raj replied 1 year ago.
I think my last post containing solution didn't go through So, I will post the solution file again:

Solution project is ready.

I have compressed the Solution project into one file.
So after downloading the file you will have to extract its content and in the folder open the file with name "Cos Function.sln" to open the project in Visual Basic

http://www.mediafire.com/?3jm77gss94qcy1k

If you face any difficulty than feel free to ask for help.

If the solution file is satisfactory than Please don't forget to RATE the Answer.
It will hardly take few seconds to RATE my Answer

Thank You and Have a Good Day.

Customer: replied 1 year ago.

so I tried to run it, and their are a few errors it says? stuff about

'statement is not valid in a namespace'

and

Error 1 'Sub Main' was not found in 'ConsoleApplication1.Module1'. ConsoleApplication1

and

Error 12 'End Class' must be preceded by a matching 'Class'. C:\Users\Donna\AppData\Local\Temporary Projects\ConsoleApplication1\Module1.vb 114 1 ConsoleApplication1

Expert:  Raj replied 1 year ago.

I sent you a GUI Form Application not a Console Application so The Error Above is not possible using the Project I sent you.

Simply Uncompress the File and open the SLN FILE not the VB File

Than Run the project and Output will look something like the following:

Customer: replied 1 year ago.

when I open the solution file it comes up with an error message saying one or more projects in the solution were not loaded correctly. sorry to e a nuisance, im just not very good with all this programing

Expert:  Raj replied 1 year ago.
No Problem , I understand
What version of Visual Studio are you using? Is it 2008 or 2010 or 2012?
Customer: replied 1 year ago.

its 2010

Expert:  Raj replied 1 year ago.
I have made the solution in same 2010 version of Visual Studio.

Ok I will provide you step by step Solution how to run it.

STEP 1 : Download the compressed file I have sent you.
STEP 2 : Close Everything all the projects that you have kept opened.
STEP 3 : Extract the contents of Downloaded file in which you will get a FOLDER with name "Cos Function"
STEP 4 : When you go inside the Folder you will See three files named as follows:
a) Folder with name Cos Function
b) File with name Cos Function.sln
c) File with name CosFunction.suo
Among above three files Double Click Cos Function.sln file and the project will open in Visual Studio with two parts(1 is code part, Other is Form Design Part).
STEP 5 : Press F5 Key from the keyboard to RUN the code and get the OUTPUT
Customer: replied 1 year ago.

okay thankyou, I found the sln file but is it possible you could send the code just over a message here? sorry raj if im being quite difficult

Expert:  Raj replied 1 year ago.
Actually in GUI(Windows Form Project) the project gets divided into two parts:
1. CODE PART
2. FORM DESIGN PART

So We cannot complete the project when one part is missing and Form cannot be submitted in form of code.

So If I only provide you the code part it wont work alone.
And Form is made using drag and drop so even thats not possible to convert to code and provide.

Customer: replied 1 year ago.

the cos of an arbitrary angle x is
 cos x=1-(x^2/2!) +(x^4/4!) - (x^6/6!)+.....+(-1)^n (x^(2n)/(2n)!)
and, k! = 1x2x3x......x k
           
in which x is in radians. Write a program in VB that allows user to enter values x and n. Then the
program calculates cos(x) by above formula using n first terms of the series and a DO LOOP.

The console application for just this part... do you reckon you could just send the code just for this part of the question? ignoring the windows forms part?

Expert:  Raj replied 1 year ago.
Ok Give me 10 min and I will post the code for console version of the requirement.
Expert:  Raj replied 1 year ago.
CODE is as follows as a Console Application:

Module CosFunction

Sub Main()
Dim n As Integer
Dim x As Integer
Dim i As Integer
Dim j As Integer
Dim sign As Integer
Dim result As Double
Dim fact As Integer

i = 2
sign = -1
result = 1

Console.Write("n : ")
Console.Write("x : ")

Do While i <= (2 * n)
fact = 1
For j = 1 To i
fact = fact * j
Next
result = result + ((Math.Pow(sign, i - 1) * Math.Pow(x, i)) / fact)
i = i + 1
Loop

Console.WriteLine("cos (" + Convert.ToString(x) + ") : " + Convert.ToString(result))
End Sub

End Module
Expert:  Raj replied 1 year ago.
THIS ANSWER IS LOCKED!
You can view this answer by clicking here to Register or Login and paying \$3.
Raj, Engineer
Category: Homework
Satisfied Customers: 1267
Experience: 4 + Experiance in IT Industry
Raj and other Homework Specialists are ready to help you
Expert:  Raj replied 1 year ago.
Thank you for your Feedback

In Future to request any new Question to me just begin your Question with TO RAJ followed by the Question in the following format:

TO RAJ: Followed by the Question.

Have a Good Day.

### JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

### What Customers are Saying:

• Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Last | Next >
• Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
• This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
• Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
• I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
• Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
• Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
• He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX

• ### Manal Elkhoshkhany

#### Satisfied Customers:

4522
More than 5000 online tutoring sessions.
< Last | Next >

### Manal Elkhoshkhany

#### Satisfied Customers:

4522
More than 5000 online tutoring sessions.

### LogicPro

#### Satisfied Customers:

3458
Expert in Java C++ C C# VB Javascript Design SQL HTML

### Linda_us

#### Satisfied Customers:

3124
Post Graduate Diploma in Management (MBA)

### Chris M.

#### Satisfied Customers:

2385
Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)

### F. Naz

#### Satisfied Customers:

1988
Experience with chartered accountancy

### Bizhelp

#### Satisfied Customers:

1876
Bachelors Degree and CPA with Accounting work experience

### Seanna

#### Satisfied Customers:

1781
3,000+ satisfied customers, all topics, A+ work

## Related Homework Questions

Chat Now With A Tutor
Raj
SAP ABAP Consultant
351 Satisfied Customers
4 + Experiance in IT Industry