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
What kind of device is a cpu input or output?
Rina8888 [55]
Correct answer: Neither

The CPU<span> is also known as the </span>processor<span> or microprocessor. The </span>CPU<span> is responsible for executing a sequence of stored instructions called a program. This program will take </span>inputs<span> from an </span>input<span> device, process the </span>input<span> in some way and </span>output<span> the results to an </span>output<span> device.</span> It is neither an input nor an output device, but it is usually connected to both kinds of devices.

Output devices like your monitor, speaker, and printer does not process anything fo it to be categorized as a processing device like your CPU and so as input devices like your mouse, microphone, and keyboard.

3 0
3 years ago
What are at least three tips to taking photographs of insects? Why would following the tips help create better photographs?
Ber [7]

1) Use a good cam 2) Make sure you focus on it 3) Make sure you snap it at the right time....    I hope this helps!!!!!

7 0
3 years ago
You decide to buy some stocks for a certain price and then sell them at another price. Write a program that determines whether o
ser-zykov [4K]

Answer:

#here is code in python.

#read number of shares

num_share = int(input("Enter number of shares:"))

#read purchase price

buy_p = float(input("Enter purchase price:"))

#read sell price

sell_p = float(input("Enter sale price:"))

#total buying cost

buy_cost=buy_p*1.03*num_share

#total selling cost

sell_cost=sell_p*0.97*num_share

#if net profit

if(sell_cost>buy_cost):

   print("After the transaction, you made " +str(sell_cost-buy_cost)+ " dollars.")

#if net loss

else:

   print("After the transaction, you lost " +str(buy_cost-sell_cost)+ " dollars.")

Explanation:

Read the total number of shares from user.Then read buying price of a share and selling price of a share.Then calculate total buying cost including commission.Calculate total selling cost excluding the commission.If total buying cost is greater than total selling cost the print the profit else print the loss in the transaction.

Output:

Enter number of shares:10

Enter purchase price:10

Enter sale price:10

After the transaction, you lost 6.0 dollars.

4 0
3 years ago
2.8 Code Practice: Question 1
-BARSIC- [3]

Answer:

The program to this question can be given as:

Program:

#include <stdio.h> //define header file

int main() //define main method.

{

int a1,b1,c1; //define variable

printf("Enter three numbers:\n"); //message

scanf("%d",&a1); //input numbers.

scanf("%d",&b1);//input numbers.

scanf("%d",&c1);//input numbers.

if (a1>b1) //check condition

{

//check condition

if(a1>c1)//inner if block

{

printf("The largest number: %d", a1); //message

}

else  //inner else block

{

printf("The largest number: %d", c1);//message

}

}

else //else block

{

//check condition

if(b1>c1) //inner if block.

{

printf("The largest number: %d", b1);//message

}

else //else block

{

printf("The largest number: %d",c1);//message

}

}

return 0;  //return 0.

}

Output:

Enter three numbers:

22

44

11

The largest number: 44

Explanation:

The description of the above program can be given as:

  • In the C language program firstly we define the header file. Then we define the main function. In the main function, we define three variables that are "a1, b1 and c1". In this variable, we take input from the user.
  • Then we define the conditional statements. In the if block we check if the value of a1 is greater then the value of b1 if this condition is true so we use another condition that if the value of a1 is greater then the value of c1. so, it will print the largest value. If the above condition is not true then it will go to else section.
  • In the else part we check the condition that if the value of b1 is greater then the value of c1. if it is true it will print the largest number value.  
4 0
3 years ago
Read 2 more answers
What is Converting digital data and see information to display screen can use to create an image?
aksik [14]

Answer:

Most displays in current use employ cathode ray tube ( CRT ) technology similar to that used in most television sets. The CRT technology requires a certain distance from the beam projection device to the screen in order to function.

4 0
3 years ago
Other questions:
  • 1. Which of the following are considered CAD powerhouses?
    6·1 answer
  • From the Start screen, you can A. access recently opened Excel workbooks. B. create a document from a template. C. create new bl
    12·2 answers
  • The INC and Dec instruction do not effect the__________ flag
    6·1 answer
  • When a computer is booted the checks the computer's components?
    7·1 answer
  • . One of the vulnerabilities the Morris worm used was a networking service called finger. The purpose of the finger service is t
    11·1 answer
  • Why is it a good idea to leave an interview being courteous and polite?
    10·1 answer
  • What does it mean to compact and repair your database? What is the difference between a single
    15·1 answer
  • Nonverbal communication includes _____.
    9·2 answers
  • In this lab, you use the flowchart and pseudocode found in the figures below to add code to a partially created C++ program. Whe
    9·1 answer
  • What is meant by index of an element?​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!