C Programming Engineering Worksheet

Problem 1 : Create a script that will convert Rectangular Form Complex number Z = a + jb into Polar FormZ = r or Polar Form Complex number into Rectangular Form. At the end of each computation, the user
should be prompted whether she/he wants to repeat or to stop the process and based on the user’s choice,
the whole process should be repeated or stopped. Please use the following screenshot for example.

Needed Equations (in case you do not know)
b
Z = a + jb = r , r = a 2 + b 2 ,  = tan −1 ( ), a = r  cos  b = r  sin 
a

Needed Functions : sqrt(value) or pow(value1, value2) Ex: r=sqrt(A*A+B*B); r= pow(A*A+B*B,0.5)
atan(value) for computing θ. Ex: Theta=atan(b/a);
sin(value) and cos(value) for sin θ or cos θ. Ex: a = r*cos(Theta);b=r*sin(Theta);
Angle_in_Degree*3.141592/180 to compute Angles in Radians
Angle_in_Radian*180/3.141592 to compute Angles in Degree (Do Radian Degree conversion for
2% extra points)
45 degree is 0.7853 radians. You do not need to compute
degrees. Compute degrees only for extra points.
Problem 2.
Create a script that will compute the slope of the line tangent of f ( x ) = Cx n over a range of x with an
interval. The user should be prompted to type in values for C, n, lower and upper bound of range for x, and
interval. *For the range and interval, the user should type in ONLY positive numbers. The computer should
check this and halt the process if user used a negative number(s) for the range or the interval. (The slope
of the line tangent of a function can be found by finding the derivative of the given function.)
Use the following screenshot for example.
1) When wrong input for range or interval is used (Example)
2) When everything went smoothly (Example)
Grading Rubrick
Problem 1.
1) Asking for choice between two options. (Conditional)
2) Asking for right variable values for the choices (Rectangular to Polar or Polar to Rectangular)
3) Using right functions
4) Asking for repetition. (Loop)
5) Display of correct messages.
6) Use of suitable variable types
7) Radians Degrees (Optional)
Problem 2.
1) Creating the f ( x ) = Cx n and its derivative correctly
2) Correct use of functions to find the derivative
3) Prompting for user input accurately
4) Ability on checking negative numbers on range and interval.
5) Using Loops accurately
6) Display of correct messages.
7) Use of Suitable variable types

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER