Skip to main content

Posts

Showing posts from August, 2018

Day 2

1. inches to feet /* This program will estimate height of person */ /* based on femur and humerus length */ #include < stdio.h > #include < math.h > int main( void ) { /* Declare variables. */ double femur, femur_ht_f, femur_ht_m, humerus, humerus_ht_f, humerus_ht_m, femf,humf,femm,humm; /* Get user input from the keyboard. */ printf( "Enter Values in Inches. \n" ); printf( "Enter femur length: \n" ); scanf( "%lf" ,&femur); printf( "Enter humerus length: \n" ); scanf( "%lf" ,&humerus); /* Compute height estimates. */ femur_ht_f = femur* 1.94 + 28.7 ; femur_ht_m = femur* 1.88 + 32 ; humerus_ht_f = humerus* 2.8 + 28.2 ; humerus_ht_m = humerus* 2.9 + 27.9 ; femf=(femur_ht_f/ 12 ); femm=(femur_ht_m/ 12 ); humf=(humerus_ht_f/ 12 ); humm=(humerus_ht_m/ 12 ); /* Print height estimates. */ printf( "\nHeight Estimates in Feet \n" ); printf( "Femur F...

LED Lab

void setup() { pinMode(10,OUTPUT); //Initialize Pin pinMode(9,OUTPUT); // Initialize Pin pinMode(8,OUTPUT); // Initialize Pin pinMode(7,OUTPUT); // Initialize Pin } void loop() { digitalWrite(10,HIGH); //Set the LED On delay(35); //Wait for 1000 ms digitalWrite(10,LOW); //Set the LED Off delay(35); //Wait for 1 second digitalWrite(9,HIGH); //Set the LED On delay(40); //Wait for 1000 ms digitalWrite(9,LOW); //Set the LED Off delay(40); //Wait for 1 second digitalWrite(8,HIGH); //Set the LED On delay(40); //Wait for 1000 ms digitalWrite(8,LOW); //Set the LED Off delay(40); //Wait for 1 second digitalWrite(7,HIGH); //Set the LED On delay(25); //Wait for 1000 ms digitalWrite(7,LOW); //Set the LED Off delay(25); //Wait for 1 second digitalWrite(7,HIGH); //Set the LED On delay(40); //Wait for 1000 ms digitalWrite(7,LOW); //Set the LED Off delay(40); //Wait for 1 second digitalWrite(8,HIGH); //Set the LED On delay(40); //Wait for 1000 m...

Day 1

/* This program will convert meters to miles */ #include < stdio.h > #include < math.h > int main( void ) { /* Declare and initialize variables. */ double x1= 0.00062137 , y1= 5000 , converter, meters, miles; /* Compute sides of a right triangle. */ converter =x1; meters =y1; miles = (converter*meters); /* Print distance. */ printf( "The distance in miles is " "%5.2f \n" ,miles); return 0 ; } /* This program will convert degrees Celcius to degrees Rankine */ #include < stdio.h > #include < math.h > int main( void ) { /* Declare and initialize variables. */ double x1= 273.15 , x2= 0 , y1= 1.8 , converter, celcius,mul,rankine; /* Compute degrees Renkine. */ converter =x1; celcius =x2; mul=y1; rankine =((converter+celcius)*(mul)); /* Print distance. */ printf( "The temperature in rankine is " "%5.2f \n" ,rankine); return 0 ; } /* This program wil...