Asked by Jennifer

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.

without no plagiarism

All Answers 1

Answered by GPT-5 mini AI
Question 1 — Checkout cost with a $5 discount
Program (assumes the $5 discount applies to the whole order):
quantity = int(input("Enter the quantity you want: "))
item_price = 19.99
discount = 5.00

total = quantity * item_price - discount
if total < 0:
total = 0.0

print(f"Total cost: ${total:.2f}")

Explanation: multiplies quantity by 19.99, subtracts a $5 discount, prevents a negative total, and prints the result with two decimal places.

Question 2 — Average of six homework grades
Program:
grades = [100, 89, 93, 76, 95, 92]
final_grade = sum(grades) / len(grades)
print(f"Final homework average: {final_grade:.2f}")

Explanation: sums the six grades and divides by 6 to compute the average, printed to two decimal places.

Question 3 — Teams of 10 players and leftovers
Program:
players = int(input("How many people want to play this year? "))
team_size = 10

num_teams = players // team_size
leftover = players % team_size

print(f"Number of full teams (10 players each): {num_teams}")
print(f"People not assigned to a team: {leftover}")

Explanation: uses integer division (//) to compute full teams and modulus (%) to compute unassigned people.

Question 4 — Simple guessing game
Program (example uses a fixed secret number; you can change it or randomize):
secret = 7 # change this number or use random.randint(1,10)
guess = int(input("Guess a number: "))

if guess == secret:
print("Correct! You guessed the number.")
elif guess < secret:
print("Too low. Try a higher number.")
else:
print("Too high. Try a lower number.")

(Optional: to let the user guess repeatedly, wrap in a loop until they guess correctly.)

Question 5 — At least four criteria/tests for pizza-ordering-and-delivery software
1) Order correctness and customization
- Test that all order options (size, crust, toppings, extras, quantity) are recorded correctly and reflected in the final bill.
- Verify multiple combinations (no toppings, max toppings, special instructions) and that modifiers (extra cheese, half-and-half pizzas) compute prices properly.

2) Payment and security
- Test payment flows for credit card, mobile wallets, and cash-on-delivery; verify authorization, receipt generation, and secure handling of payment data.
- Confirm PCI compliance or that sensitive card data is not stored and that HTTPS and tokenization are used.

3) Availability, inventory, and business rules
- Verify the system prevents ordering items that are out of stock or unavailable for the selected time/area.
- Test business rules like minimum order value for delivery, delivery fees, promotions, and discount codes, including combinations and expiration.

4) Delivery and tracking
- Test address validation, delivery area checks (geofencing), and calculation of estimated delivery times.
- Verify real-time tracking updates, driver assignment logic, and status transitions (order placed → preparing → out for delivery → delivered).

5) Robustness and error handling
- Validate input sanitization (invalid addresses, malformed phone numbers), network failure handling, retry logic, and clear user-facing error messages.
- Test concurrent orders, race conditions (e.g., two users ordering the last item), and consistent inventory updates.

6) Performance and scalability
- Load-test peak scenarios (multiple simultaneous orders, promotions) to ensure acceptable response time.
- Test degradation behavior and queuing under heavy load.

7) Usability and accessibility
- Test the UI flow for clarity and speed, mobile responsiveness, and accessibility (screen reader compatibility, keyboard navigation).
- Validate that modifying/canceling orders is straightforward and documented.

8) Security, privacy, and legal compliance
- Test authentication, authorization (user account protections), and data retention policies (GDPR/CCPA considerations).
- Verify logging/auditing for fraud detection and dispute resolution while protecting user privacy.

For each criterion, create specific test cases (normal, boundary, and error cases) and include automated tests where feasible.