Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help writing the following C Program. I will RATE your answer :) C Program For this program you will build a modular equation evaluator.

Please help writing the following C Program. I will RATE your answer :)

image text in transcribedimage text in transcribed

C Program For this program you will build a modular equation evaluator. All main and fuctions should be placed in a single project. Once again you will write a C program that evaluates the equations provided below. The program must prompt the user to select one equation (1 to 7), the inputs to the equations and evaluate them based on the inputs. All variables on the right-hand sides of the equations must be inputted by the user. All variables on the right-hand sides of the equations must be inputted by the user. All variables, except for the plaintext_character encoded_character, and variable a are floating-point values. The plaintext character and encoded character variables are characters, and the variable is an integer. PI, G must be defined as a constant macro (#de fined constants). Error checking is not required for your program. You do not need to check for faulty user input or dividing by zero 1. Newton's Second Law of Motion: force-mass acceleration 2. Volume ofa cylinder: volume-cylinder = PI * radius2 * height 3. Character encoding: encodedcharacter= (plaintextcharacter- 'a') - - + 'A' (note: whathappens if plaintext character is lowercase?) 4. Gravity: force = G * mass 1 * mass 2 / distance2, where Gis the gravitational constant with value 6.67 10-11 5. Resistive divider: vout-r2 / (rl + r2) * vin 6. Distance between two points: distancesqare root of ((x1 - x2)2 + (yl - y2)2) (note: you will need to use sqrt() out of 7, General equation: y = (89 / 27) -z * x + a / (a % 2) (recall: a is an integer; the 89 and 27 constants in the equation should be left as integers initially, but explicitly type-casted as floating-point values) For this assignment you are required to define, at a minimum, the functions provided below (note these are your required prototypes!) double calculate_newtons_2nd_law (double mass, double acceleration) double calculate_volume_cylinder (double radius, double height) char perform character encoding (char plaintext character) double calculate_gravity force (double massl, double mass2, double distance) . double calculate resistive divider (double resistancel, double resistance2, double vin) double calculate_distance_between_2pts (double xl, double x2, double yl, double y2) double calculate general equation (int a, double x, double z) A function must be defined for each of the above function signatures. The task that is performed by each function corresponds directly to the equations defined under the Equations section. For example, the newtons 2nd law ( ) function should evaluate the equation defined as force-mass acceleration and return the resultant force, etc. You must print the results to

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Which point designates the optimal portfolio of risky assets? p-936

Answered: 1 week ago