Skip to content

This is the 5th homework assignment for structured problem solving class

Notifications You must be signed in to change notification settings

sasloan/sps_hw5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

CIS 2110 Homework Assignment #5

Learning Objectives:  To demonstrate the student's ability to write simple Python code and perform basic input, output, and mathematical functions in Python Assignment:  Install and run a Python development environment. I suggest you use Spyder (which is part of the Anaconda suite.) You can install the software from the link below: o https://www.spyder-ide.org/  Create a header for the user interactions with your file. The header should that state your name, the assignment name/number, the date the assignment is due, and a brief description of the program.  Create a Python program that takes in 5 numbers from a user, one number at a time.  After the 5th number has been input, return to the user the value of each number they input, as well as the sum and average of the numbers that the user input.
 To test your file, I will input 5 random numbers (they might be integer or float), and examine the output.  When you output the value for each number, it should show exactly 2 decimal places  When you output the values for the sum and average, it should show exactly 2 decimal places  When you ask the user for input, you should provide prompts. (eg: “Please enter a number:”)  When you output a number, you should output strings that appropriately inform the user what they are looking at: (eg: “The sum is: “)  If you want to use functions, ifs, whiles, etc., that’s fine, but if this is your first experience with coding, I suggest you just stick with basic code.
 ALL of your code must always be within this file- you will lose points if you attempt to import libraries or code that is external to the file (I’m happy if you can do this, but for now let’s keep it simple, k?)
 I suggest you use comments liberally Below is the output of a test program I wrote. I tested it using the values 1, 2, 3, 4, and 5

Welcome! This is homework 3n for Joe Hasley

Please enter a number: 5 Please enter a number: 4 Please enter a number: 3 Please enter a number: 2 Please enter a number: 1

You input the values: 5.00, 4.00, 3.00, 2.00, 1.00 The sum of the values you input is: 15.00 The average of the values you input is: 3.00 Guidelines:  For each program, create a header that prints when you run the rile. The header should state your name, the assignment number, the program number, and a brief description of what the program does.  ALL of your code must always be within this file- you will lose points if you attempt to import libraries or code that is external to the file (I’m happy if you can do this, but for now let’s keep it simple, k?)  I give priority to writing CODE THAT WORKS. If you can’t get part of the code to run, comment out that part and tell me (in the comment) what you were trying to do so I can give you partial credit. I will take off points for code that doesn’t run- I shouldn’t have to debug your code just to get it to run.
 I suggest you use comments liberally

About

This is the 5th homework assignment for structured problem solving class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages