The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 2 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Good Luck, (5 points) Write a function called CheckPassFail which takes integer as a parameter and prints "PASS" if the int variable "mark" is more than or equal to 50; or prints "FAIL" otherwise. The program shall always print “DONE” before exiting. 2. (5 Points) Write a function called CheckOddEven which takes integer as a parameter and prints "Odd Number" if the int variable “number” is odd, or “Even Number” otherwise. The program shall always print “BYE!” before exiting. Hints: n is an even number if (n % 2) is 0; otherwise, it is an odd number. 3. (5 Points) Write a function called SumAndAverage to produce the sum of 1, 2, 3, ..., to 100. Also compute and display the average. The output shall look like: The sum is 5050 The average is 50.5 4. (5 Points) Write a function called GradesAverage, which prompts user for the number of students, reads it from the keyboard, and saves it in an int variable called numStudents. It then prompts user for the grades of each of the students and saves them in an int array called grades. Your program shall check that the grade is between 0 and 100. A sample session is as follow: Enter the number of students: 3 Enter the grade for student 1: 55 Enter the grade for student 2: 108 Invalid grade, try again... Enter the grade for student 2: 56 Enter the grade for student 3: 57 The average is: 56.0 Screenshots HAVE to be included in the answer!
OOOOOVerizon LTE 3:21 PM ‘1 54% I} )< HnalExaandf (D
IIIIIIIIIIIII-I-I-I-I-I-I-I-I-I-I- 1of2 This is the final Exam for this Course. It worth 20 percent of your final grade.
You should submit the code and the screen capture of you code. Please Create a Test cases for each question and test using the main function.
If you have any question you can call and email me. Good Luck,
Due Date: March 10, 2017 11:AM 1. (5 points) Write a function called CheckPassFail which takes integer as a
parameter and prints "PASS" if the int variable "mark" is more than or equal
to 50; or prints "FAIL" otherwise. The program shall always print “DONE”
before exiting. 2. (5 Points) Write a function called CheckOddEven which takes integer as a
parameter and prints "Odd Number“ if the int variable “number” is odd, or “Even
Number” otherwise. The program shall always print “BYE!” before exiting.
Hints: n is an even number if (n 0/o 2) is 0; otherwise, it is an odd number. 3. (5 Points) Write a function called SumAndAvetage to produce the sum of 1, 2, 3,
..., to 100. Also compute and display the average. The output shall look like: The sum is 5050
The average is 50.5 4. (5 Points) Write a function called GradesAverage, which prompts user for the
number of students, reads it from the keyboard, and saves it in an int variable
called numStudents. It then prompts user for the grades of each of the students and
saves them in an int array called grades. Your program shall check that the grade is
between 0 and 100. A sample session is as follow: Enter the number of students: 3
Enter the grade for student 1: 55
Enter the grade for student 2: 108
Invalid grade, try again... Enter the grade for student 2: 56
Enter the grade for student 3: 57
The average is: 56.0