Write a Python program that: Asks the user to input their name and stores it in an appropriately typed variable. Input prompt should be clear and explain what the user should enter.

Homework Help: Questions and Answers: Part A: Write a Python program that Asks the user to input their name and stores it in an appropriately typed variable. Input prompt should be clear and explain what the user should enter

Write a Python program that: Asks the user to input their name and stores it in an appropriately typed variable. Input prompt should be clear and explain what the user should enter

Part B: Write a Python program that (assume for this program that student gets in state tuition and is on the Macon campus):
1. Greets the user with the name entered for Part A.
2. Asks the user to input how many credit hours they are registered for at MGA and stores it in an appropriately typed variable.
3. Input prompt should be clear and explain what the user should enter.
4. Calculates the amount of tuition based on the credit hours registered ($174 per credit hour).
5. Displays the additional fees ($45 activity fee, $45 athletic fee, $20 health fee, $10 parking fee, $180 Rec and Wellness fee and $46 technology fee) which should be stored in a tuple.
6. Displays the amount of tuition calculated in step 2.
7. Displays the total for the semester (step 2 + step 4).
8. Outputs should clearly label what is being displayed.

Answer:

Lets solve this problem step by step, creating two separate Python programs as per question. Let’s start with Part A:

Part A: Python Program for User Input

Objective: Write a program that asks the user for their name and stores it in a variable.

Steps:

  • Use the input() function to ask the user to enter their name.
  • Store the input in a string variable, since the name is textual data.

Code for Part A:

Part B: Python Program for Tuition Calculation

Objective: Extend the program to greet the user, calculate tuition based on the number of credit hours, and display additional fees.

Step by Step Programing:

  • Greet the user using the name from Part A.
  • Ask the user to input the number of credit hours they are registered for and store it as an integer.
  • Calculate the tuition by multiplying the credit hours by $174 (cost per credit hour).
  • Define the additional fees in a tuple.
  • Display the tuition and the additional fees.
  • Calculate the total amount by adding the tuition and the sum of the additional fees.
  • Display the total amount.

Code for Part B:

Conclusion:

Part A: The user is prompted to enter their name, which is stored and used later.

Part B: The user is greeted, asked for their registered credit hours, and then the program calculates the tuition, displays the additional fees, and finally calculates and displays the total amount for the semester.

This program is complete, ensuring clarity and proper labeling of inputs and outputs.

Learn More: Homework Help

Q. Even though it hasn’t been maintained over the years Monks Mound looks very much as it did when it was built.

Q. The topics in the Content area are set up at the discretion of your instructor?

Q. What is a common reason for being marked as spam that could prevent authorization of a third-party application?

Q. Which of the following actions should be taken if Office add-ins are automatically disabled due to causing program crashes?

Q. Which of the following steps should be taken if you encounter an error related to ‘disableapitermination’ in a software application?

    Leave a Comment

    Comments

    No comments yet. Why don’t you start the discussion?

      Comments