Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Introduction to Computer Programming

Spring 2022

Programming Assignment 01

Input - Output

Instructions

This programming assignment consists of 2 programming exercises.

You have to:

1.  create Python files on your computer (be careful of filenames)

2.  edit them according to the assignment

3.  verify on your computer that it works (run them and check the ouput in the shell)

4.  upload the files to Gradescope (upload directly the .py files, not a .zip file)

5.  check the autograder report on Gradescope

6.  go back to step 2 if necessary

The autograder will evaluate your code for a few testcases.   If some testcases fail, the autograder should show you what is your code output, and what is the expected output.

The autograder will give you a score based on the testcases, but a grader will manually evaluate your coding style after the deadline. Style represents 30% of the coding assignment grade.


Exercise 1 -   Print a greeting message

Write a program (in the file exercise1 .py) that does the following (in the specified order):

1.  asks the user to input his family name

2.  asks the user to input his given name

3. then, prints the message  Hello  <given name>  <family name>  !!!

Sample example (the user input is in red, the printed output is in blue):


What  is  your  family  name:  Simon

What  is  your  given  name:  Daniel

Hello  Daniel  Simon  !!!


Exercise 2 -   Grade average

Write a program (in the file exercise2 .py) that does the following (in the specified order):

1.  asks the user to input the first grade (int between 0 and 100)

2.  asks the user to input the second grade (int between 0 and 100)

3.  asks the user to input the third grade (int between 0 and 100)

4.  then, prints the average grade (keep it as an integer, choose the closest integer)

Sample example (the user input is in red, the printed output is in blue):


1st  grade:  89

2nd  grade:  95

3rd  grade:  97

Average  grade:  94