Programming C Language

662 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
662
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Programming C Language

  1. 1. The Best<br />Team Leader: Brian Byrd <br />Team Members: Heather Garn, Diane Joyner<br />Natara Fonseca, Derek Ricks<br />David Au <br />
  2. 2. Introduction<br />Reason for the program<br />Process to make the program<br />Each team members part<br />Limitations of the program<br />
  3. 3. First Function<br />inteasyadd(int a, int b);// prototype for easy add<br /> if (easyadd(num1, num2)== answer)// function call<br />printf("Wrong! The correct answer is %dn", easyadd(num1, num2));// function call to tell the right answer<br />inteasyadd(int a, int b)// easyadd function definition<br />{<br />int sum1=0;//declare and intilize sum1<br /> sum1= a+ b;// equation to add two numbers<br /> return sum1;// return the sum1<br />}//end function<br />
  4. 4. Second Function<br />inthardadd(int c, int d);// prototype for hard add<br /> if (hardadd(num3, num4)== answer)// call function to check their answer<br />printf("Wrong! The correct answer is %dn", hardadd(num3, num4));// call function for correct answer<br />inthardadd(int c, int d )// hardadd function definition<br />{<br />int sum2=0;//declare and intilize sum2<br /> sum2= c+ d;// equation to add two numbers<br /> return sum2;// return the sum2<br />}// end function<br />
  5. 5. Third Function<br />inteasysub(int e, int f);// prototype for easy subtract<br />if (easysub(num5, num6)== answer)// call function to check their answer <br />printf("Wrong! The correct answer is %dn", easysub(num5, num6));// call function to give correct answer<br />inteasysub(int e, int f)//easy subtract function definition<br />{<br />int sum3=0;//declare and intilize sum3<br /> sum3= e-f;// equation to subtract two numbers<br /> return sum3;// return the sum3<br />}// end function<br />
  6. 6. Fourth Function<br />inthardsub(int g, int h);// prototype for hard subtract<br /> if (hardsub(num7, num8)== answer)// call function to check their answer <br />printf("Wrong! The correct answer is %dn", hardsub(num7, num8));// call function to output the correct answer <br />inthardsub(int g, int h)//hard subtract function definition<br />{<br />int sum4=0;//declare and intilize sum4<br /> sum4= g-h;// equation to subtract two numbers<br /> return sum4;// return sum4<br />}// end function<br />
  7. 7. Fifth Function<br />int grade(int number);// prototype for number grade<br />printf("You got %d percent correctn", grade(correct));// call function for the number grade<br />int grade(int number)// grade number function definition<br />{<br />int grade;// declare variable grade<br /> grade=number*10;// equation to turn the number of correct answers to a number grade<br /> return grade;// return grade<br />}// end function<br />
  8. 8. Sixth Function<br />char lgrade(int number);// prototype for letter grade<br />printf("You got an %c", lgrade(correct));// call letter grade function to tell what their grade is<br />
  9. 9. Sixth Function- Continue<br />char lgrade(int number)//letter grade function definition<br />{<br />int grade;// declare variable grade<br /> grade=number*10;// equation to turn the number of correct answers to a number grade<br /> if(grade>=90)//if grade is 100-90<br /> return 'A';// return an A grade letter<br /> else if (grade>=80)// if grade is 89-80<br /> return 'B';// return an B grade letter<br /> else if (grade>=70)// if grade is 79-70<br /> return 'C';// return an C grade letter<br /> else if (grade>=60)// if grade is 69-60<br /> return 'D';// return an D grade letter<br /> else// if grade is 59 or lower<br /> return 'F';// return an F grade letter<br />}// end of function<br />
  10. 10. Conclusion<br />Helpful to Elementary School Students<br />What we could include in the future<br />Any Questions?<br />

×