Create fundamental programs using concepts such as declaring and initializing variables and constants.
Purpose
The purpose of this assessment is to demonstrate your knowledge of defining variables and constants, converting data between data types, and performing basic mathematical operations on those variables.
Assessment Instructions
In this assessment, you will complete a program to demonstrate the skills presented in this module using the Python programming language.
In this hypothetical scenario, you will create a program that will allow a student to register for certification classes in HVAC. The school offers a $150 discount if the student signs up for 20 or more unit hours. Students may also pay the tuition costs over a 12-month period.
Assessment Requirements
- Your program should declare variables to store the following string values.Name: John SmithAddress: 101 N. Main StreetCity: AnyTownState: TXZIP: “11111”Units Taken: 19
- For the price per unit, declare a constant numeric variable to contain the decimal value 100.50.
- For the 20-unit-hour discount, declare a constant numeric variable to contain the whole number 150.
- Convert the string value for Units Taken to an integer data type and place the converted numeric value into a separate numeric variable.Hint: Use the same name, but add the prefix int, such as intUnitsTaken.
- Increment the variable above by 1 so that the value 19 will now be 20.
- Multiply the constant variable for price per unit by the units taken and place the answer in a variable named tuition.
- Subtract the constant discount value from tuition and store the answer in a variable named afterDiscount.
- Divide the discounted tuition by 12 and store the answer in a variable named monthlyPayment.
- Finally, your program will display the following data using the respective variables for each item:NameAddressCityStateZIP codeNumber of units taken (numeric value that was incremented)Tuition before discountTuition after discountMonthly paymentInclude labels for each item as shown in expected output. Format the tuitionvalues and monthly payments as currency.EXPECTED OUTPUTName: John SmithAddress: 101 N. Main StreetCity: AnytownState: TXZIP code: 11111The number of units taken is: 20The tuition before discount is $2,010.00The tuition after 20-unit discount is $1,860.00Your monthly payment is $155.00
Directions for Submitting Your Assessment
The source code file is the file in your project that contains the code you wrote. You will only need to submit the source code file for your program and not the entire project folder or any additional project files. The source code file for a Python program ends in .py.
Naming Your Project and Source Code File
While you can change your file name later, it will be simpler with less chance of confusion if you name your new project and code file with the following naming convention when you create it. The code files should be saved as IN250_YourLastName_M1. The source code file and the project name can be the same.
Leave a Reply
You must be logged in to post a comment.