CSC/BIF 243 Introduction to Object Oriented Programming LAB07

$40.00

Category: You will Instantly receive a download link for .zip solution file upon Payment

Description

5/5 - (4 votes)

Problem 1

Create a function that takes two lists having the same length as parameters and then does the multiplication of the two lists and return it.

Original list 1 : [1, 3, 4, 6, 8]

Original list 2 : [4, 5, 6, 2, 10]

Resultant list is : [4, 15, 24, 12, 80]

Write a program to read two lists invoke the function and print the results.

 

Problem 2

 

Using functions in your implementation, write a program that reads integers directly from the user place them in a list, print the list, then removes duplicate elements in it and prints it out again.

 

Problem 3

 

Using functions in your implementation, write an Eggy-peggy program that reads a string from the user and converts it to a new string by placing egg in front of every vowel (aA, eE,iI,oO,uU).

For example, the string Python becomes Pytheggon.

Sample Output

Enter your message: I LOVE YOU

The Encrypted message is: eggI LeggOVeggE YeggOeggU

 

Problem 4

Write a function that takes as arguments two positive integers, finds and returns their greatest common divisor.

Write a program to invoke and test the functions on several pairs of numbers.

 

Problem 5

Students can calculate their Grade Point Average (GPA) if they know the following information:

  • Credits attempted – These are the total number of credits for the courses you’ve taken.
  • Letter grades earned – A letter grade is assigned for every course.
  • Assume that the possible Letter Grades for courses are A, B, C, D or F (No + or -). Point values for those grades – Each grade is assigned a point value as follows:

 

The basic formula for calculating GPA is to divide the total points earned in a program by the total number of credits attempted. The resulting figure is the GPA for that program.

Here’s an example student’s transcript with credit hours, grade earned, and grade points:

In this example, our student has attempted 16 credits in total and earned 33 total grade points. Referring back to the basic formula above, use the student’s total grade points earned (33) divided by the 16 credits attempted means the student has a GPA of 2.06.

Write a Python program that helps students compute their one semester Grade Point Average (GPA). Assume that the possible Letter Grades for courses are A, B, C, D or F.

  • Use comments to explain your code
  • Use at least one function.
  • Make sure that you Validate user Input.

 

 

 

 

 

 

 

 

 

 

 

 

 

Attention!

 

Policy on Cheating and Plagiarism:

Plagiarism on assignments and project work is a serious offense. If plagiarism is detected, a student will be subject to penalty, which ranges from receiving a zero on the assignment concerned to an “F” in the course.