Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

Orange County Community College Create a Program Code Python Coding Task

Orange County Community College Create a Program Code Python Coding Task

Requirements—Part 1 

You will write your programs for this course using Python 3 in the code editor of your choice (Idle or Visual Studio Community are recommended).

Below is a link to where you can download Microsoft Visual Community for free.

downloads

For your first Python program, you will take the given statements below about Python and Python history and combine them into one paragraph, correctly formatted and corrected as noted below. The correct output is also given as an example below. 

The following statements are to be included in your program as separate strings. When adding them to your program, be sure to include any leading or trailing spaces shown. If you copy and paste the string from this document, remove the quotes and retype them in manually to be sure you get the correct set of quotes in the character set. You can also copy these statements from the text file provided to avoid this issue (see IT244_Module_1_Data.txt file).
“ Python was created in the 1890’s by Guido van Rossum. “
“ Python is maintained as an ‘open source’ project by a group that is called the Python Software Foundation. “
“ He is affectionately known as Python’s “Benevolent Dictator for Life.” “
You will concatenate the three strings above into one string formatted correctly with standard spacing. You will need to programmatically correct “1890’s” to “1990’s” in the first statement. Your output should appear as shown below. Note the order of the text.
Instructions—Part 1
define three variables to hold each sentence string.
Hint: Note that the third sentence mixes single and double quotes. You will need to use the backward slash () character ahead of the double quotes. For more on this, reference section 3.1.2. Strings in the Python 3 documentation.
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 2: Four Types of Data / Assignment Statements / Variable Names.
Apply the appropriate string functions to each string variable as needed to strip leading spaces and replace 1890 with 1990.
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 8: Built-In String Operations.
Print the concatenated sentences as a single paragraph to produce the expected output.
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 2: Print Statements; Chapter 3: Built-In Functions / Concatenation.
EXPECTED OUTPUT—Part 1
Python was created in the 1990’s by Guido van Rossum. He is affectionately known as Python’s “Benevolent Dictator for Life.” Python is maintained as an ‘open source’ project by a group that is called the Python Software Foundation.Module 1 Assessment Part 2

Requirements—Part 2

You will create a Python program that will accept user input of an English color value from a given range of colors and will return the Spanish equivalent. You will use IF, ELIF, and ELSE statements along with comparison operators to evaluate the entered value and display the appropriate results to the user.

Instructions—Part 2

1. Print a string statement with a list of acceptable colors to the screen:

“Your color choices are red, blue, green, white or yellow.” 

Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 2: Print Statements.

2. Prompt the user to enter a color value from the list. Assign the user input to a variable (i.e., userColor).

“Enter a color from the list above: “

Reference: Refer back to your readings in Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 3: Built-In Functions / Getting Input From the User.

3. Convert the color value entered to all lowercase for easier evaluation. Use the string function lower and store the lowercase color in a new variable (i.e., color).

Reference: Refer back to your readings in Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 8: Built-In String Operations.

4. Create a variable named validColor and set it to a value of true.

5. Using a series of IF/ELIF statements, evaluate the color and set a new variable (i.e., spanishColor) to the appropriate Spanish equivalent. Use a final else statement if a valid color was not entered, and assign the validColor flag to a value of false.

red = rojo

blue = azul

green = verde

white = blanco

yellow = amarillo

Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 5: The if Statement / Comparison Operators / The elif Statement / Using Many elif Statements.

6. Create a final IF/ELSE statement to evaluate the validColor flag. If a valid color was entered, use string concatenation to display the English color (color) and its Spanish equivalent (spanishColor). If not, display a message indicating a valid color was not entered.

Reference: Refer back to your readings in Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 2: Print Statements; Chapter 3: Built-In Functions / Concatenation.

EXAMPLE OUTPUT—Part 2

Your color choices are red, blue, green, white or yellow.

Enter a color from the list above: rEd

The color red in Spanish is rojo 

Your color choices are red, blue, green, white or yellow.

Enter a color from the list above: black

That is not a valid color for this program. Ese no es un color válido.

Module 1 Assessment Part 3

Requirements—Part 3

Write a Python program that will incorporate conditional looping to average a given number of assignment grades for a student. The program will calculate and display the average.

Pseudocode:

Enter number of grades to process.

             Enter a student name

             While loop counter is less than number of grades to process

                            Enter assignment grade

                            Add grade to grade tally

                            Increment loop counter

             Calculate student average

             Display student average

Instructions—Part 3

1. Initialize variables as needed (i.e., numGrades = 0).

Reference: Refer back to Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 2: Booleans.

2. Prompt the user to input the number of grades to be processed. Store this value in a variable (i.e., numGrades).

Hint: This value will determine how many repetitions are performed. 

Reference: Refer back to your readings in Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 3: Built-In Functions / Getting Input From the User.

3. Prompt the user to enter a student name. Store that name in a variable (i.e., studentName).

4. Create a conditional loop and continue processing grade values for this student until the given number of assignments have been processed.

Within this loop:

a. Prompt to get a numeric grade value from the user.

b. Add that grade to a numeric variable to keep a tally of the grades. Each time through the loop (for a given student), a new grade value will be entered and added to this tally.

c. Increment the loop counter.

Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 6: Loops / The While Statement / Increment and Decrement

5. Once grades for the conditional loop have been entered, average the grades using the total tally divided by the number of grades to be entered given at the start of the program. Store the average in a variable (i.e., studentAverage).

Reference: Refer back to your readings in Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 2: Simple Math.

6. Display the name of the student and their average.

EXAMPLE OUTPUT—Part 3 

Enter number of grades to process: 2

Enter student name: Bob

Enter assignment grade: 90

Enter assignment grade: 80

Bob has an average of:  85.0

Module 1 Assessment Part 4

Requirements—Part 4

For this assessment, you will plan and create a program for a small ice cream shop that will allow a customer to see the flavors available, select a cone size, and see the price for their order. Planning and prioritizing before creating a usable program is extremely important. To achieve your identified goals, you should first develop detailed models for a program that you will then create that fulfills requirements. Your models and program should be well organized and tested for correct output before customer usage.

  • Create a list to hold seven ice cream flavors.
  • Modify the name of one flavor.
  • Add one new flavor to the end of the list.
  • Sort the list.
  • Display the number of flavors and number and name of each flavor in the list.
  • Create two dictionaries: one to hold the cone sizes and prices and another to hold the size descriptions.
  • Prompt the user to enter a size and flavor.
  • Validate that a correct size and flavor value were entered.
  • Display the price, size description, and flavor.

Instructions—Part 4: 

PART A – PLANNING 

Using an IPO chart and pseudocode, plan the input and output data and model your processing prior to creating the code in Python for this programming scenario.

Reference supplemental videos for three previous programs for examples of IPO charts and pseudocode.

PART B – PROGRAMMING FROM THE MODELS

1. Display a welcome message on the screen:

“Welcome to The Ice Creamery”

Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 2: Print Statements.

2. Create a new list variable for storing seven ice cream flavors (i.e., flavorsList).

flavorsList = [“Vanilla”, “Chocolate”, “Strawberry”, “Pistachio”, “Butter Pecan”, “Cookie Dough”, “Neapolitan”]

Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 7: Lists.

3. Change the name of one flavor in the list of flavors just created.

Hint: Use the index value for the position of the flavor in the list and assign it a new value.

Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd Edition, Chapter 7: Lists / Changing a Value in a List.

4. Use a built-in list operation to append a new flavor to the end of the list. You should now have eight flavors in the list.

Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 7: Lists / Table 7-1: The Built-In List Operations.

5. Use a built-in list operation to sort the flavors list in alphabetical order.

Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 7: Lists / Table 7-1: The Built-In List Operations.

6. Store the number of flavors in the list in a variable and display the number of flavors.

Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 7: Lists / Determining the Number of Elements in a List: The len Function.

7. Loop through each flavor in the list using a FOR loop to display the number and name for each item in the list.

  1. Create FOR loop to process each flavor in flavorsList list.
  2. With each iteration, display the flavor # using the index value in the flavors list and the name of the flavor.

Hint: Remember index positions in lists start with zero. To make this more customer friendly, add one to the index value before displaying it. 

Reference: Refer back to your readings in Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 2: Simple Math; Chapter 7: Lists / Position of an Element in a List: Index / Accessing an Element in a List / for Statements and for Loops. 

8. Define dictionaries to hold the prices and descriptions for each cone size.

conePrices={“S”:”$1.50″,”M”:”$2.50″,”L”:”$3.50″}

coneSizes={“S”:”smallish”,”M”:”more for me”,”L”:”lotta lickin”}

Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 11: Data Structures, Dictionary.

9. Prompt the user to enter a cone size (S, M, or L). Store their choice in a variable (i.e., customerSize).

OPTIONAL VALIDATION: Use an IF statement to ensure a valid value was entered. Display an error message if an invalid value was entered.

Reference: Refer back to your readings in Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 3: Built-In Functions / Getting Input from the User; Chapter 5: The if Statement / Comparison Operators.

10. Prompt the user to enter a flavor number. Store their choice in a number variable (i.e., customerFlavor).

Hint: Placing int ahead of the input statement will store the user input as a number. You will be using this number as the index to find the flavor value from the list.

OPTIONAL VALIDATION: Use an IF statement to ensure a valid value was entered. Display an error message if an invalid value was entered.

11. Display the price, size description, and flavor for their choice. Use your conePrices dictionary to match the size value entered to the price. Use your coneSizes dictionary to match the size to the description of the size.

Hint: Remember that index positions in lists start with zero. To make this more customer friendly, we added one to the index value before displaying it. You will need to do the same here to display the appropriate value from the list.  

Use print () to print blank lines as necessary for readability.

Reference: Refer to Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 7: Lists / Position of an Element in a List: Index / Accessing an Element in a List; Chapter 11: Data Structures, Dictionary.

EXAMPLE PROGRAM OUTPUT—Part 4 

Welcome to The Ice Creamery

These are the 8 flavors we are serving today at The Ice Creamery:

Flavor #:  1   Blueberry Crunch
Flavor #:  2   Butter Pecan
Flavor #:  3   Chocolate
Flavor #:  4   Cookie Dough
Flavor #:  5   Neapolitan
Flavor #:  6   Strawberry
Flavor #:  7   Vanilla
Flavor #:  8   Very Berry Strawberry

Please enter the cone size of your choosing: S, M, or L: S
Please enter your flavor number: 5

Your total is:  $1.50
Your smallish sized cone of The Ice Creamery’s Neapolitan will arrive shortly.

Thank you for visiting the Ice Cream Creamery

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: School Assignment only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by School Assignment are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. School Assignment is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At School Assignment, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.