Advertisement
Guest User

Untitled

a guest
Mar 26th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. Hi, I need 3 programs written, can this be done for 3 gigs ($15)?
  2.  
  3. To begin, all programs should have the following form:
  4.  
  5. #! /usr/bin/env python3
  6.  
  7. # Name
  8. # Date
  9. # Description
  10.  
  11. import libraries here
  12.  
  13. def yourFunction(param):
  14. return value
  15.  
  16. def main():
  17. program goes here
  18.  
  19. if __name__ == '__main__':
  20. main()
  21.  
  22. (Just leave the name/date/description etc blank ill fill that in)
  23.  
  24. Program 1:
  25.  
  26. Write a program which prompts the user for two sentences, and then prints out whichever sentence is shorter (by number of characters).
  27.  
  28. Should end up like this:
  29.  
  30. lab07$ shorterSentence.py
  31. Sentence 1: This is a short sentence.
  32. Sentence 2: This is a very very very very long sentence.
  33. This is a short sentence.
  34.  
  35. Program 2:
  36.  
  37. Write a program which prompts the user to enter a phrase, and then prints that sentence back out with all of the vowels (a, e, i, o, and u) turned into capital letters, and all other letters turned into lower-case letters.
  38.  
  39. lab07$ capitalVowels.py
  40. Phrase: The quick brown fox JUMPS over the lazy dog
  41. thE qUIck brOwn fOx jUmps OvEr thE lAzy dOg
  42.  
  43.  
  44.  
  45. Program 3:
  46.  
  47. SUNY Plattsburgh determines a student's class level (whether the student is considered a Freshman, a Sophomore, a Junior, or a Senior) by the number of credits that student has earned toward their graduation.
  48.  
  49. Credits Level
  50. 1-27 Freshman
  51. 28-56 Sophomore
  52. 57-84 Junior
  53. 85+ Senior
  54. Write a program which reads in a list of usernames and credits earned from a file, and prints out a list of the Freshmen, the Sophomores, the Juniors, and the Seniors.
  55.  
  56. For example, given the following data file:
  57.  
  58. "tstud001 17
  59. tstud002 68
  60. jsmit001 57
  61. bjoe001 97
  62. asmit001 72"
  63.  
  64. The program would generate the following output:
  65.  
  66. lab07$ byClass.py
  67. Input file: students.txt
  68.  
  69. FRESHMEN
  70. tstud001
  71.  
  72. SOPHOMORES
  73.  
  74.  
  75. JUNIORS
  76. tstud002
  77. jsmit001
  78. asmit001
  79.  
  80. SENIORS
  81. bjoe001
  82.  
  83. __
  84. Please don't print the header of any group which has no students in it. So, for example, the above output would not display the "SOPHOMORES" header.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement