lynes_tony_lab3.c - *Tony Lynes*Lab3 CSCI 112#include...

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

View Full Document Right Arrow Icon
/*Tony Lynes *Lab3, CSCI 112 *2/22/16 */ #include <stdio.h> /* must include math.h for trig functions*/ #include <math.h> /*pi and the loop limit should be defined*/ #define PI 3.14159 #define LOOP_LIMIT 90 /*list of related identifiers are listed in our enum*/ typedef enum{ Sine, Cosine, Tangent, QUIT } trig_t; /*New data type 'trig'*/ /*the function will prompt user for a value assigned to a trig function *if user enters invalid number, give error message *print values of the prompted trig function, using desired increment *exit running of program when quit is selected */ int main(void) { /*'range' is the variable for the values of the trig functions we want to evaluate*/ int range; trig_t choice; /*while statement allows the program to only run if an expected number is entered, otherwise the user will be propted with an error message*/ while (choice!=3){ printf("Please choose an option: (0) Sine (1) Cosine (2) Tangent (3) QUIT\n"); printf("Enter your choice > "); /* u is used to take the input from the user and find which choice it is*/ scanf("%u", &choice);
Image of page 1

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern