Homework5-2 - Homework #5 /* * Program: HW5_2 * Written by:...

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

View Full Document Right Arrow Icon
Homework #5 /* * Program: HW5_2 * Written by: Justin Waters * inputs: 4 letters representing resistor color codes * Outputs: Resistor ohm value * Description: User enters 4 letters representing color codes of a resistor and the program determines the ohms for the given color code and prints the results * */ #include <stdio.h> #include <math.h> #include <ctype.h> //declaration of functions: void color_letters(char colorCode[]); //gets users letter code inputs long ohm_convert( char colorCode[], int r_value ); //converts colors to numbers void description(void); //tells user about the program int main (void) { long r_value = 0; char colorCode[4]; description(); //calls ddescription function color_letters(colorCode); //calls function to collect user inputs color codes r_value = ohm_convert(colorCode, r_value); //converts colors to numbers and returns final value //prints color code and calculated resistor value printf("\n\nThe resistor with color code %c %c %c %c has a value of %d Ohms.\n",
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 08/06/2008 for the course EGR 261 taught by Professor Parikh during the Spring '08 term at Grand Valley State University.

Page1 / 5

Homework5-2 - Homework #5 /* * Program: HW5_2 * Written by:...

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