Question 1

Computer programmers need to solve problems and think critically. As part of this ability, they demonstrate proficiency in the use of arithmetic operators to create mathematical expressions, such as multiplication and subtraction. Write a Python program that will be part of the checkout system for a store. The user will enter the quantity of the item that they want. Then, the program will determine the cost of the order, assuming the item costs $19.99 and there is currently a $5 discount.

Question 2
In a history class, the final grade is the average of six homework assignments. Write a Python program that calculates the final grade if the homework grades are 100, 89, 93, 76, 95, and 92. You should demonstrate proficiency in the use of arithmetic operators to create mathematical expressions, such as addition and division.

Question 3
A community baseball league is setting up teams for spring. Write a program that asks the user how many people want to play baseball this year. Output how many teams there will be (assuming each team needs exactly 10 players assigned to it) and how many people are not assigned to a team. (Don’t worry about things like the user entering a negative number of people.) You should demonstrate proficiency in the use of arithmetic operators to create mathematical expressions, such as integer division and modulus division.

Question 4
Write a simple guessing game program. Ask the user to enter a number. If the number is equal to the number you’ve picked, send an appropriate message. If it’s too high or too low, send an appropriate message.

Question 5
Display an ability to solve problems and think critically by describing AT LEAST FOUR criteria or tests that you would need to apply to new software designed to order a pizza and have it delivered.

Critical Thinking Grading Rubric
Content
Full Credit
Completes all components of the questions.
Demonstrates in-depth understanding of the relevant concepts.
Answers in complete sentences.
Partial Credit
Completes some components of the questions.
Demonstrates some understanding of the relevant concepts.
Answers mostly in complete sentences.
Little Credit
Does not complete most components of the questions.
Demonstrates minimal understanding of the relevant concepts.
Answers in incomplete sentences.

1 answer

Sure! Here are the solutions to all five questions with Python code and descriptions:


Question 1: Checkout System for a Store

# Get the quantity of the item from the user
quantity = int(input("Enter the quantity of the item you want: "))

# Fixed values
item_cost = 19.99
discount = 5.00

# Calculate total cost and apply discount
total_cost = (item_cost * quantity) - discount

# Display the total cost
print(f"The total cost of your order is: ${total_cost:.2f}")

Description: This program asks the user for the quantity of an item they wish to purchase, calculates the total cost based on the price of the item and applies a discount of $5. The final cost is displayed to two decimal places.


Question 2: Final Grade Calculation

# Homework grades
grades = [100, 89, 93, 76, 95, 92]

# Calculate the average
average_grade = sum(grades) / len(grades)

# Display the final grade
print(f"The final average grade is: {average_grade:.2f}")

Description: This program stores the grades of six homework assignments in a list, calculates the average by summing the grades and dividing by the number of assignments, and then displays the final average grade formatted to two decimal places.


Question 3: Community Baseball League Teams

# Get the number of players from the user
num_players = int(input("How many people want to play baseball this year? "))

# Calculate teams and unassigned players
teams = num_players // 10
unassigned = num_players % 10

# Display results
print(f"There will be {teams} teams.")
print(f"There are {unassigned} players not assigned to a team.")

Description: This program prompts the user for the number of players interested in joining baseball. It then calculates the number of complete teams (each with 10 players) using integer division and determines how many players remain unassigned using modulus division.


Question 4: Simple Guessing Game

# Pick a number (for example, 7)
picked_number = 7

# Ask the user for their guess
user_guess = int(input("Guess a number (1-10): "))

# Check if the guess is correct, too high, or too low
if user_guess == picked_number:
    print("Congratulations! You've guessed the right number!")
elif user_guess > picked_number:
    print("Your guess is too high. Try again!")
else:
    print("Your guess is too low. Try again!")

Description: This program randomly selects a number (in this case, 7) and asks the user to guess it. Depending on whether the guess is correct, too high, or too low, an appropriate message is displayed.


Question 5: Criteria for New Pizza Ordering Software

When designing new software for ordering pizza, several criteria should be assessed to ensure its functionality and user satisfaction:

  1. User Interface Usability: The software should have an intuitive and user-friendly interface that allows customers to easily navigate through the menu, customize their orders, and complete the checkout process without confusion.

  2. Order Accuracy: The software must ensure that orders are accurately captured and transmitted to the kitchen. This includes correctly handling special requests or modifications (e.g., extra cheese, no onions).

  3. Payment Security: To protect customers' financial information, the software must implement secure payment gateways and comply with standards such as PCI DSS (Payment Card Industry Data Security Standard).

  4. Delivery Time Estimates: The software should provide users with an estimated delivery time when placing an order and update them if there are any delays. This enhances the user experience by setting proper expectations.


These programs and discussions demonstrate critical thinking and proficiency in utilizing arithmetic operators as required by the questions.