Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Quadratic Write a C program to read three real number as a, b and c. Considera quadratie (a second-order polynomial) equation as ax? +bx+c=0

image text in transcribed
1. Quadratic Write a C program to read three real number as a, b and c. Considera quadratie (a second-order polynomial) equation as ax? +bx+c=0 The equation can be solved by the formulas as _-bvb2 - 4ac Za Print two solutions xl and X2. Note that the solutions can be complex numbers. Show enough test cases to show equal roots, real roots, and imaginary roots. 2. Haversine GPS coordinates are well established to position a place at geographic coordinate system. You can get easily a GPS coordinate from any online maps. The GPS consists of latitude and longitude. You will survey online to write a C program for a so-called Haversine formula to calculate the distance between two GPS coordinates. The program will read two positions as position name and GPS coordinates, and print the distance between those two positions. For example, $ my_haversine program Position 1: ET GPS1: 39.774260 -86.172585 Position 2: Home GPS2: 39.920430 -86.179518 Distance between ET and Home is 16.24 km Use the program to find the distances among top 10 cities in the world. What to learn: degree vs. radian, mathematical functions available in standard libraries. 3. Epsilon We know that C data types float and double can not represent all real data. We can intuitively recognize that there are some small value epsilon that make x to be same as x + epsilon. We know the epsilon is not a constant but depending on the data type and value. Write a C program to find the epsilon as 2" for some integer n when the base x is 0.1, 1.0, 10., 100.0, 1000. and when the base x is in float type or double type. For example, consider what you will get by adding 7.0E-15 to 100.0. You will print a right-aligned table to show the epsilons depending on the base value (row) and data type (column)

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

Recommended Textbook for

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions