Develop a program that reads students’ grades from a file named “studentdata.txt’, and writes their names and average into a new file named “studentaverage.txt’. Round the numbers to the closest integer.
The following sample file called studentdata.txt contains one line for each student in an imaginary class. The student’s name is the first thing on each line, followed by some exam scores. The number of scores might be different for each student.
- Please develop a program to help you crack the following secret message. For the encryption we have used simple Caesar cipher. You can find more information on https://en.wikipedia.org/wiki/Caesar_cipher.
After you develop your program, read the mystery.txt and output the original message into message.txt
Hint: use % operator where needed. Don’t encrypt punctuation marks.
mystery.txt file content:
Write a program that has three functions: sepia(), remove_all_red(), and gray_scale().
Sepia Tone images are those brownish colored images that may remind you of times past. The formula for creating a sepia tone is as follows:
newR = (R × 0.393 + G × 0.769 + B × 0.189)
newG = (R × 0.349 + G × 0.686 + B × 0.168)
newB = (R × 0.272 + G × 0.534 + B × 0.131)
Red removal from an image:
Simply set the R component to 0.
Gray scale conversion:
newR = (R × 0.289 + G × 0.587 + B × 0.114)
newG = (R × 0.289 + G × 0.587 + B × 0.114)
newB = (R × 0.289 + G × 0.587 + B × 0.114)
You can get each pixel by using p = img.getPixel(col, row)
Components of each pixel can be retrieved by p.getRed(), p.getGreen(), p.getBlue()