WHAT'S NEW?
Loading...

List of programming exercises

Here are the list of programming exercises.

1. Write a program that will compute the sum of two integers and determine the highest number based on the input of a user.

2. Write a program that will compute for the sum, difference, average, and product based on the input of a user.

3. Make a program that prints the sum, difference, product, quotient, and remainder of two integers that are inputted interactively.

4. Write a program that computes for the area, circumference, and volume of a sphere if A, C, and V is pressed respectively. The user should enter first the radius of a sphere to solve for the unknowns.
     Formula:
         Area pie * radius2
         Volume = (4/3) * pie * radius2
         Circumference = 2*( pie * radius2)

5. Write a program that print A for grades greater than or equal to 90, B for the grades in the range of 80 to 89, C for the grades in the range of 70 to 79, D for the grades in the range of 60 to 69, and F for all other grades.

6. Write a program that will ask for a person name and gender. If the gender is equal to ‘m’ or ‘M’ then display “You are a male”. If the gender is equal to ‘f’ or ‘F’ then display “You are a female”. And if the user input aside from ‘m’, ’M’,’f’, and ’F’, error will display.

7. Write a program that will computes the volume of a cylinder.
     Formula:
         Volume pie * radius2 * h

8. Write a program that will computes the perimeter and area of a rectangle.
     Formula:
         Perimeter = 2 * (length + width)
         Area = length * width

9. Create a program that will input the location, destination, distance in kilometers and average time travelled. Compute for the speed, where ‘S’ denotes speed, ‘D’ for the distance and ‘T’ for the time. Make sure to include the concatenation space between strings.
     Formula:
        S = D/T

10.Write a program that computes the prelim quizzes, activity, class participation, and PRELIM exam. Do the same procedure for MIDTERM, PRE-FINAL, and FINAL. The program must be flexible in any users. The users can input their appropriate percentage like quizzes, activity, and class participation with the total of 50% and half of 50% is the periodic exam in every period such as prelim, midterm, pre-final, and final, and the total of 100%.

  The output includes name, course, prelim, midterm, pre-final, and final. The program can determine passed or failed in the total grade.

Formula:
  PRELIM = ((((sum of quizzes/total quizzes) * 40 + 60) * given percentage) + (((sum of activity/total activity)* 40 + 60) * given percentage) + ((class participation) * given percentage) + (((exam/total exam) * 40 + 60) * 50%))

  MIDTERM = ((1/3 * (PRELIM)) + (2/3) * ((((sum of quizzes/total) * 40 + 60) * given percentage) + (((sum of activity/total activity)* 40 + 60) * given percentage) + ((class participation) * given percentage) + (((exam/total exam) * 40 + 60) * 50%))))

  PRE-FINAL = ((1/3 * (MIDTERM)) + (2/3) * ((((sum of quizzes/total) * 40 + 60) * given percentage) + (((sum of activity/total activity)* 40 + 60) * given percentage) + ((class participation) * given percentage) + (((exam/total exam) * 40 + 60) * 50%))))

  FINAL = ((1/3 * (PRE-FINAL)) + (2/3) * ((((sum of quizzes/total) * 40 + 60) * given percentage) + (((sum of activity/total activity)* 40 + 60) * given percentage) + ((class participation) * given percentage) + (((exam/total exam) * 40 + 60) * 50%))))
  Note: The total average takes in every period like quizzes, activity, and class participation does not more than 50 percent. If the problems arise, it depends how you are going to handle.

0 comments:

Post a Comment