subject

For this program you will build a modular equation evaluator (you may want to start from your solution to programming assignment 1). Once again, you will write a C program that evaluates the equations provided below. The program must prompt the user for inputs for the equations and evaluate them based on the inputs. All equations should be placed into a single .c file. This means you should NOT have 7 Visual Studio projects or 7 .c files. 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, variable a, shift, R1, R2, and R3 are floating-point values. The plaintext_character and encoded_character variables are characters, and the a, shift, R1, R2, and R3 variables are integers. PI should be defined as a constant macro (#defined constant). Error checking is not required for your program. You also do NOT need to check for faulty user input. However, please consider inputs that could cause your program to work incorrectly. Newton’s Second Law of Motion: force = mass * acceleration
Volume of a cylinder: volume_cylinder = PI * radius2 * height
Character encoding: encoded_character = (plaintext_character - 'A') + 'a' - shift; shift is an integer (note: what happens if plaintext_character is uppercase? What happens with various shift keys?)
Distance between two points: distance = square root of ((x1 - x2)2 + (y1 - y2)2) (note: you will need to use sqrt ( ) out of )
Tangent: tan_theta = sin (theta) / cos (theta) (recall: find the appropriate functions in )
Total resistance of resistors in paralell: total_resistance = 1 / (1 / R1 + 1 / R2 + 1 / R3), for 3 resistors. R1, R2, and R3 are integers.
General equation: y = (2 / 3) - y + z * x / (a % 2) + PI (recall: a is an integer; the 2 and 3 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: the first 5 are your required prototypes for those functions!):

*double calculate_newtons_2nd_law (double mass, double acceleration)

*double calculate_volume_cylinder (double radius, double height)

*char perform_character_encoding (char plaintext_character, int shift)

*double calculate_distance_between_2pts (double x1, double x2, double y1, double y2)

*double calculate_tangent_theta (double theta)

*A function for calculating total parallel resistance (you must decide on a name, return type, and parameter list!)

*A function for calculating the general equation (once again, you must decide on a name, return type, and parameter list!)

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 calculate_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 the hundredths place. Also, the functions should not prompt the user for inputs. Prompts should be performed in main ( ) directly.

For this assignment you will need to define three different files. One file, called a header file (.h) needs to be defined which will store all #includes, #defines, and function prototypes. Name the header file for this assignment equations. h. The second file that needs to be defined is just a C source file. This file should be named equations. c and include all function definitions for the above functions. The last file that should be defined is the main. c source file. This file will contain the main ( ) function or driver for the program.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
Business professionals of america, and future business leaders of america – phi beta lambda are both open to business students at which levels? check all that apply. elementary school middle school high school college
Answers: 1
question
Computers and Technology, 22.06.2019 14:00
Which database model is best used for data warehouse and data mining
Answers: 3
question
Computers and Technology, 22.06.2019 19:20
1)consider the following code snippet: #ifndef book_h#define book_hconst double max_cost = 1000.0; class book{public: book(); book(double new_cost); void set_cost(double new_cost); double get_cost() const; private: double cost; }; double calculate_terms(book bk); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_cost should be removed since header files should not contain constants.c)the definition of book should be removed since header files should not contain class definitions.d)the body of the calculate_terms function should be added to the header file.
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
You know the right answer?
For this program you will build a modular equation evaluator (you may want to start from your soluti...
Questions
question
Mathematics, 08.04.2021 18:20
question
Mathematics, 08.04.2021 18:20
question
Mathematics, 08.04.2021 18:20
question
Mathematics, 08.04.2021 18:20
question
Mathematics, 08.04.2021 18:20
Questions on the website: 13722360