# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     name: python3
# ---

# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab.research.google.com/github/KATE-ABIGAIL/CPEN-21A-CPE-1-2/blob/main/Final_Exam.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

# + [markdown] id="ab7GPGB0OJOM"
# ###PROBLEM STATEMENT 1.

# + colab={"base_uri": "https://localhost:8080/"} id="3CdC_QsbOSos" outputId="a76f2f44-f756-4820-c406-477e7ec9e7d0"
#Create a Python program that will produce an output of sum of 10 numbers less than 5 using FOR LOOP statement. (30 points)

num = [ 0, 1, 2, 3, 4, -1, -2, -3, -4, -5 ]
for x in num:
  sum = x + 0
print("The sum of 10 numbers less than 5 is", sum)

# + [markdown] id="L8KMv-_BW8fJ"
# ###PROBLEM STATEMENT 2.

# + colab={"base_uri": "https://localhost:8080/"} id="aywNLLVvkOfS" outputId="80f101cd-09e0-4ae5-db7d-34026848cb78"
#Create a Python program that will produce accept five numbers and determine the sum of first and last number among the five numbers entered using WHILE LOOP (35 points)

num = []

while len(num) is not 5:
    user = int(input("Input number: "))
    num.append(user)

print(num)
summ = num[0] + num[-1]
print(summ)

# + [markdown] id="Ggc1kI72YmTG"
# ###PROBLEM STATEMENT 3.

# + colab={"base_uri": "https://localhost:8080/"} id="PmdpGuAjYo_G" outputId="02e1652c-7463-4c2f-f3b0-175014e1034f"
#Create a Python program to calculate student grades. It accepts a numerical grade as input and it will display the character grade as output based on the given scale: (Use Nested-IF-Else statement) (35 points)

grade = x = ( int(input("Insert Your Grade: ")))

if x >= 90:
  print ("A")
elif x >= 80:
  print ("B")
elif x >= 70:
  print ("C")
elif x >= 60:
  print ("D")
else:
  print ("F")

StarcoderdataJupyterScriptsDedupFiltered