1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lorasvet [3.4K]
3 years ago
10

Write and run a Python program that asks the user for a temperature in Celsius and converts and outputs the temperature in Fahre

nheit. (Use the formula given in the example above and solve for tempF in terms of tempC.)
Computers and Technology
1 answer:
adelina 88 [10]3 years ago
6 0

Answer:

Program :

celsius_input= float(input("Enter the value of celcius"))#It is used for the input from the user.

print((celsius_input * 1.8) + 32) # it prints the value of fahrenheit for the user.

Output:

  • If the user gives the input as 23.6, then the output is 74.48.
  • If the user inputs is 45, then the output is 113.

Explanation:

  • The above code is in python language, in which the first line is used to generate the message for the user, take the input from the user and store it into the "celsius_input" variable after converting it into float data type.
  • Then the second line will print the value of Fahrenheit by the help of formula "(celsius_input * 9/5) + 32". The 9/5 will become 1.8. hence we used 1.8 in the place of 9/5.
You might be interested in
A collision between gas atoms and electrons raises the energy levels of oxygen and nitrogen in the _________.
Gala2k [10]
Ionosphere i hope this helps
4 0
3 years ago
Read 2 more answers
Which operating system might cause the desktop background to change unexpectedly?
Hunter-Best [27]
I used computers for 3 years now and i think its B
4 0
2 years ago
Explain the differences between copyright, fair use, and trademark?
ValentinkaMS [17]

A trademark is an easily recognizable symbol, phrase, or word that denotes a specific product. It legally differentiates a product or service from all others of its kind and recognizes the source company's ownership of the brand.

"Copyright" literally means the right to copy but has come to mean that body of exclusive rights granted by law to copyright owners for protection of their work. Copyright protection does not extend to any idea, procedure, process, system, title, principle, or discovery.

Fair use is a doctrine in United States law that permits limited use of copyrighted material without having to first acquire permission from the copyright holder.

7 0
2 years ago
__________ can collect information about credit card numbers.
saveliy_v [14]

Answer:

<h3><u>Spyware</u></h3>

  • Spyware collects your personal information and passes it on to interested third parties without your knowledge or consent. Spyware is also known for installing Trojan viruses. Adware displays pop-up advertisements when you are online.

Explanation:

<h2>Hope this helps !! </h2>
5 0
2 years ago
Read 2 more answers
This program is to compute and write to a file the GPA for student scores read from an input file. The point values of the grade
VARVARA [1.3K]

Answer:

#Take input from the user

filename=input('Enter name of input file: ')

total_units=0#Total number of units for a student

total_score=0#Total score of a student

#Assign a score to each grade. I have reduced 0.33 for each grade. Change here if you need to

grade={'A':4.0,'A-':3.67,'B+':3.34,'B':3.01,'B-':2.68,'C+':2.35,'C':2.02,'C-':1.69,'D+':1.36,'D':1.03}

try:

with open(filename,"r") as input_file:#Open the file for input(reading)

output_file=open("GPA_output.txt","w") #Create and open GPA_output.txt if it doesn't exist for writing

for student_record in input_file:#read from input file

if("," in student_record):#if there is a , that means this is the student name

student_name=student_record.strip('\n')#Remove \n from student name

continue

else:

if(" " in student_record):#If a line contains spaces then its the student's grades for a course

student=student_record.split(" ")#Split to find the coursename, units and grade

#student[0]=coursename student[1]=units student[2]=grade

total_units+=int(student[1])#Calculate total units for 1 student

total_score+=int(student[1])*grade[student[2].strip('\n')]#Find the total score of a student

#grade[student[2]] will lookup for the score that we initialized earlier

#if student has a grade as A then this will look up as grade['A'] which will return 4

#Find the total score as product of this grade and units for this course

continue

else:

if(total_units>0):#Check if score has been calculated for a student earlier

print("in")

GPA=total_score/total_units#Calculate the GPA

output_file.write("%-26s%.2f\n" % (student_name, GPA))#Write the GPA and Student Name in the required format

total_units=0#reset the units

total_score=0#reset the score

if(total_units>0):#Essential for the case when the file doesn't end with a new line(Check if total_units is not 0) which means a record is pending

#to be written to the file

GPA=total_score/total_units#Calculate the GPA

output_file.write("%-26s%.2f\n" % (student_name, GPA))#Write the GPA and Student Name in the required format

total_units=0#reset the units

total_score=0#reset the score

input_file.close()#Close the input file

output_file.close()#Close the output file

except IOError as e:

print("Problem in Opening the required file")#Print a message if file cannot be opened

Explanation:

The program has been tested for all 3 scenarios mentioned i.e.

a. If the file ends without \n

b. If the file ends with 2 \n

c. If the file ends with 1 \n

PS: The Program will run irrespective of how it ends. Even if there are many \n at the end of file, the program will be fine.

3 0
3 years ago
Other questions:
  • Suppose alice, with a web-based e-mail account (such as hotmail or gmail), sends a message to bob, who accesses his mail from g
    10·1 answer
  • All of the following are recommended to secure a wireless network EXCEPT:
    5·2 answers
  • A trench is a narrow excavation in which the depth is greater than the width and the width does not exceed 15 feet. A. False B.
    13·2 answers
  • The picture that graphically since the items you use in windows is called
    7·1 answer
  • Describe the dynamic Network Address Translation (NAT).
    9·1 answer
  • __________ intelligence is an approach to boundary spanning which results from using sophisticated software to search through in
    15·1 answer
  • Select the tips you should follow when writing a business report.
    12·1 answer
  • Identify the correct sequence of steps to change the font from Verdana to Arial.
    10·1 answer
  • Calvin needs to design a simple yet professional interface for his users. Which option should he implement?
    9·2 answers
  • In this image, which feature did we most likely use to quickly change the background, fonts, and layout?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!