Only use the code in Objectives and write the code in Python
python code for question1
##################################################
import pandas as pd
data = [['Journal of Commodity Markets', '$21', '$50'],['Journal of
Sustainable Mining', '$22', '$60'],['Journal of Asia-Pacific
Biodiversity', '$27', '$75']] # data for table
df = pd.DataFrame(data) # converting data into dataframe
df.columns = ['Journals', 'Student', 'Non-student'] # inserting
columns name into dataframe
print(df)
option1 = input("Are you a student?")
option2 = input("subscribe to Journal of Commodity Markets? (Y/N):
")
option3 = input("subscribe to Journal of Sustainable Mining? (Y/N):
")
option4 = input("subscribe to Journal of Asia-Pacific Biodiversity?
(Y/N): ")
print("Your selection:")
if option2 == 'Y':
print(" - Journal of Commodity Markets")
if option3 == 'Y':
print(" - Journal of Sustainable Mining")
if option4 == 'Y':
print(" - Journal of Asia-Pacific Biodiversity")
if option2 == 'N' and option3 == 'N' and option4 == 'N':
print(" - None")
cost = 0 # cost variable is initialized to 0 and is updated furthur
according to journals choosen
if option1 == 'Y':
if option2 == 'Y':
cost += 21
if option3 == 'Y':
cost += 22
if option4 == 'Y':
cost += 27
else:
if option2 == 'Y':
cost += 50
if option3 == 'Y':
cost += 60
if option4 == 'Y':
cost += 75
print("Total Cost $",cost)
#############################################
output:
Journals Student Non-student 0 Journal of Commodity Markets $21 $50 1 Journal of Sustainable Mining $22 $60 2 Journal of Asia-Pacific Biodiversity $27 $75
Are you a student?Y subscribe to Journal of Commodity Markets? (Y/N): Y subscribe to Journal of Sustainable Mining? (Y/N): N subscribe to Journal of Asia-Pacific Biodiversity? (Y/N): Y Your selection: - Journal of Commodity Markets - Journal of Asia-Pacific Biodiversity Total Cost $ 48
Are you a student?N subscribe to Journal of Commodity Markets? (Y/N): N subscribe to Journal of Sustainable Mining? (Y/N): N subscribe to Journal of Asia-Pacific Biodiversity? (Y/N): Y Your selection: - Journal of Asia-Pacific Biodiversity Total Cost $ 75
Are you a student?Y subscribe to Journal of Commodity Markets? (Y/N): N subscribe to Journal of Sustainable Mining? (Y/N): N subscribe to Journal of Asia-Pacific Biodiversity? (Y/N): N Your selection: - None Total Cost $ 0
Write the code in Python. The output should be exact the same as the given. Question 1. Study the examples below carefully and write a program for journal subscription Your program should work exactly as the following examples The text in bold indicates user input. Example 1: The user is a student, and the user subscribes to 2 journals Question 1 - Journal of Commodity Markets Journal of Sustainable Mining Journal of Asia-Pacific Biodiversity Student $21 $22 $27 Non-student $50...
Write the code in python, if you cannot answer all the question please dont anser, thanx very much. Please gimme a screen shot for code. Write clear code with comments and follow coding convention. Comments should include your name, student number and subject code on top of your code Question 1 Create a list to store all the subject codes that you are currently doing at UOW Then use for loop to display it in a table as in the...
(PYTHON) Write a program that displays the following menu:. , Write Algorithm for Code Geometry Calculator 1. Calculate the Area of a Circle 2. Calculate the Area of a Rectangle 3. Calculate the Area of a Triangle 4. Quit Enter your choice (1 - 4): If the user enters 1, the program should ask for the radius of the circle and then display its area. If the user enters 2, the program should ask for the length and width of...
Use Java program Material Covered : Loops & Methods Question 1: Write a program to calculate rectangle area. Some requirements: 1. User Scanner to collect user input for length & width 2. The formula is area = length * width 3. You must implement methods getLength, getWidth, getArea and displayData ▪ getLength – This method should ask the user to enter the rectangle’s length and then return that value as a double ▪ getWidth – This method should ask the...
In Jgrasp(Java) Thanks! This solution must use methods. It is recommended to use methods for this solution. Write a program that reads an integer and displays, using asterisks, a filled and hollow square, placed next to each other. For example, if the side length is 5. the program should display: ***** ***** You can assume that the user will enter a side length that is at least 2. If user enters a number smaller than 2, and your program has...
Java only please Write a program that displays the following menu: Geometry Calculator 1. Calculate the Area of a Circle 2. Calculate the Area of a Triangle 3. Calculate the Area of a Rectangle 4. Quit Enter your choice (1-4): If the user enters 1, the program should ask for the radius of the circle and then display its area. Use the formula: area = ∏r2 Use 3.14159 for ∏. If the user enters 2 the program should ask for...
Problem 1 Write a Python program to do the following: (A) Ask the user to enter as many integers from 1 to 10 as he/she wants. Store the integers entered by the user in a list. Every time after the user has entered an integer, use a yes/no type question to ask whether he/she wants to enter another one. (B) Display the list. (C) Calculate and display the average of the integers in the list. (D) If the average is...
Python Language Only!!!! Python Language Only!!!! Python Language Only!!!! Python 3 is sued. Write a Python code that gets a string containing a person’s first, middle, and last name, and print her/his last name, followed by comma and the first name initial. For example, if the user enters Randy Rick Gomez, the program should display Gomez, R. Please note that in the output, the first character of each name should be capital. Please see the outcomes below: Outcome: Enter your...
Geometric calclator use python to do this program. Write a program that displays the following menu: 1. Calculate the area of circle 2. calculate the area of rectangle 3. calculate the area of triangle 4. Quit Enter your choice (1-4). if the user enters 1, your program should ask for the radius of the circle and then display its area. Use the formula to calculate the circle's area: Area = pi*r^2 Use 3.14149 for Pi and the radius of the...
Write a Python program to prompt the user for an integer number. Assign this integer to a variable X. Then assign a variable Y to the X**3 (X to the power 3). Finally, assign the variable Z to the square root of Y and print the values of X, Y, and Z as shown in the example below. Use main() function to define and call the program. Example: Enter an integer number: 3 X = 3 if Y=X**3 then Y...