Question

In: Computer Science

Q.1 Write a python program that will take in basic information from a student, including student...

Q.1 Write a python program that will take in basic information from a student, including student name, degree name, number of credits taken so far, and the total number of credits required in the degree program. The program will then calculate how many credits are needed to graduate. Display should include the student name, the degree name, and credits left to graduate.

Write two print statements in this program. In the first one, use the .format method with pre-specified order of the displayed outputs.

In the second print, using different % operators to display the output. Make sure to display the output in an aligned format (look into a sample of the output below..).

Student name: xyz xyz

Degree name: comp. engineering

Credit taken so far:                                       13

Total number of credits required: 33

Number of credits needed to graduate: 20

Q.2  Write a python program that will take in the number of call minutes used. Your program will calculate the amount of charge for the first 200 minutes with a rate of $0.25; the remaining minutes with a rate of $0.35. The tax amount is calculated as 13% on top of the total. The customer could have a credit that also has to be considered in the calculation process. Finally, the program displays all these information. Below is a sample run:

Customer account number:                                        12345

Minutes used:                                                                (you provide)

Charge for the first 200 minutes@ 0.25:                (you provide)

Charge for the remaining minutes@ 0.35:             (you provide)     

Taxes:                                                                              (you provide)

Credits:                                                                            (you provide)

Total bill:                                                                         (you provide)

please provide .py program file screenshot and output.

Solutions

Expert Solution

In case of Multiple question we have to answer one question due to time constraint, please ask second question as a separate question

QUESTION 1)

CODE:

Using .format:

name = input("Student Name: ")
deg = input("Degree Name: ")
cr = input("Credit taken so far: ")
total = input("Total number of Credits required: ")

need = int(total)- int(cr)

#print using .format

print("Student Name: {}".format(name))
print("Degree Name: {}".format(deg))
print("Credit taken so far: {}".format(cr))
print("Total number of Credits required: {}".format(total))
print("Number of Credits required: {}".format(need))

CODE SNIPPET AND OUTPUT:

Print USING % sign:

CODE:

name = input("Student Name: ")
deg = input("Degree Name: ")
cr = input("Credit taken so far: ")
total = input("Total number of Credits required: ")

need = int(total)- int(cr)

#print using % sign
#%s for string %d for integer
print("Student Name: %s" %name)
print("Degree Name: %s" %deg)
print("Credit taken so far: %s"%cr)
print("Total number of Credits required: %s"%total)
print("Number of Credits required: %d"%need)

CODE SNIPPET AND OUTPUT:

Ask doubts if any, upvote if you liked it.


Related Solutions

Q-1) Write a program that mimics a calculator. The program should take as input two integers...
Q-1) Write a program that mimics a calculator. The program should take as input two integers and the operation to be performed. It should then output the numbers, the operator, and the result. For division, if the denominator is zero, output an appropriate message. Some sample outputs follow: 3 + 4 = 7 13 * 5 = 65
In PYTHON : as basic as possible Write a program that acts as a cash register....
In PYTHON : as basic as possible Write a program that acts as a cash register. The program will prompt how many items they are buying. Then they will input the price of each item (these should be decimal numbers). The program will display the SUBTOTAL, TAX ADDED (13%), and the TOTAL (with tax). Make sure you include $ signs and round to two decimal places ] Sample Output: How many items are you buying? 3 Enter in a price:...
Write a python program that will take in the number of call minutes used. Your program...
Write a python program that will take in the number of call minutes used. Your program will calculate the amount of charge for the first 200 minutes with a rate of $0.25; the remaining minutes with a rate of $0.35. The tax amount is calculated as 13% on top of the total. The customer could have a credit that also has to be considered in the calculation process. Finally, the program displays all this information. Below is a sample run:...
PYTHON Program Problem Statement: Write a Python program that processes information related to a rectangle and...
PYTHON Program Problem Statement: Write a Python program that processes information related to a rectangle and prints/displays the computed values. The program will behave as in the following example. Note that in the two lines, Enter length and Enter width, the program does not display 10.0 or 8.0. They are values typed in by the user and read in by the program. The first two lines are text displayed by the program informing the user what the program does. This...
----------------------------------------------------------------------------------------------------------------IN PYTHON-----------------------------------------------------------------------------------------------------------------------------write a Q
----------------------------------------------------------------------------------------------------------------IN PYTHON-----------------------------------------------------------------------------------------------------------------------------write a Quiz Generator. This program is expected to generate questions for a student, record student answers, displays the answers correctly entered and reports the total time taken by the student to finish the quiz. a) The program should initialize three variables, one called correct that starts with an int of 0, second called count that also starts with an int of 0 and third called totalquestions that starts with an int of 5 (Hint: Typecast all the initialized...
Using the Python program: a/ Write a program that adds all numbers from 1 to 100...
Using the Python program: a/ Write a program that adds all numbers from 1 to 100 to a list (in order). Then remove the multiples of 3 from the list. Print the remaining values. b/ Write a program that initializes a list with ten random integers from 1 to 100. Then remove the multiples of 3 and 5 from the list. Print the remaining values. Please show your work and explain. Thanks
Write a program to take input of scores for Chemistry, Biology and English for a student...
Write a program to take input of scores for Chemistry, Biology and English for a student and display the average with 2 decimal places if all of the three scores are in the range between 1 and 100 inclusive. Program should also display the course name for which scores are entered out of range telling Average couldn't be calculated. Following is a sample run: Enter scores for Chemistry, Biology and English between 1 and 100: 45 89 96 Avg score...
Write a Python program that takes information from the user about a spider seen in North...
Write a Python program that takes information from the user about a spider seen in North America and returns whether it is likely to be a dangerous spider. The only two spiders in North America that are actually dangerous are the widow and recluse. The program will ask the user for the following information: color and special markings. printWelcome – prints program information printColorMenu – Color menu options should be brown, black, other printSpecialMarkingsMenu – Special markings options should be...
write a Python program that takes information from the user about a spider seen in North...
write a Python program that takes information from the user about a spider seen in North America and returns whether it is likely to be a dangerous spider. The only two spiders in North America that are actually dangerous are the widow and recluse. The program will ask the user for the following information: color and special markings. printWelcome – prints program information printColorMenu – Color menu options should be brown, black, other printSpecialMarkingsMenu – Special markings options should be...
Create a program in visual basic that allows the user to manage vehicle information including: •...
Create a program in visual basic that allows the user to manage vehicle information including: • License plate number • Owner name • Owner phone number The user interface will be GUI-based providing the following capabilities: • Add up to 100 vehicles • Remove specified vehicles • View a sorted list of all known license plates • View the data for a specified vehicle • Save the database contents into a file • Load a saved database from a file
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT