Lab6 - Tao Lin Lab#6 EE140/Lab#6 Question#1 Tao Lin/A program that ask users for velocity and angle The program calculate/time distance and height

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: Tao Lin Lab#6 EE140 //---------------------------------------------------------------- //Lab#6 Question#1 Tao Lin //A program that ask users for velocity and angle. The program calculate //time, distance, and height using functions and display the results //on the screen. //------------------------------------------------------------------ #include <stdio.h> #include <math.h> double const pi=3.1415926,g=9.8; //function time double time( double velocity, double angle) { double t; double radian=angle/180*pi; //covert degree into radian t=2*velocity*sin(radian)/g; return t; } //function distance double distance( double velocity, double angle) { double d; double radian=angle/180*pi; d=velocity*velocity*sin(2*radian)/g; return d; } //function height double height( double velocity, double angle) { double h; double radian=angle/180*pi; h=velocity*velocity*sin(radian)/g; return h; } int main( void ) { double velocity, angle,Time,Distance,Height; printf( "Enter velocity: " ); scanf( "%lf" ,&velocity);...
View Full Document

This note was uploaded on 09/04/2011 for the course EE 140 taught by Professor Lanxiang during the Spring '11 term at Montgomery College.

Page1 / 6

Lab6 - Tao Lin Lab#6 EE140/Lab#6 Question#1 Tao Lin/A program that ask users for velocity and angle The program calculate/time distance and height

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