Assignment 3 - Assignment 3: 1). Create pico file...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Assignment 3: 1). Create pico file a3_input.txt List the following numbers in a single column 10.0 5.0 13.2 2.0 22 2). Create pico file math_functions.c /*Program name: Math Functions Author: Michelle Abercrombie Date Created: 02/12/2008 This file converts an input from degrees to radians, calculates the distance between two points, and how many digits it takes to represent a number in base b notaion, and prints the results into an output file a_3output.txt.*/ #include <stdio.h> #include <math.h> double degrees_to_radians(double x) /*This is the function which converts an input, x from degrees to radians*/ { double angle; angle = x*0.0174532925; return angle; } double compute_distance(double x1, double y1, double x2, double y2)/*This function computes the distance between two points (x1,y1), (x2,y2).*/ { double distance; distance = sqrt(((x1-x2)*(x1-x2)) + ((y1-y2)*(y1-y2))); return distance; } double num_to_digits_in_base(int x, int b)/*This function conputes the number of digits needed to represent a number, x, in base b notation*/ {
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/03/2008 for the course ECE 175 taught by Professor Grubbs during the Spring '08 term at University of Arizona- Tucson.

Page1 / 3

Assignment 3 - Assignment 3: 1). Create pico file...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online