Question

Print air_temperature with 1 decimal point followed by C.


8.2.2: Format temperature output. 


Print air_temperature with 1 decimal point followed by C.


 Sample output with input: 36.4158102 

36.4C

11 0
Add a comment Improve this question Transcribed image text
✔ Recommended Answer
Answer #1
air_temperature = float(input())

print("{:.1f}C".format(air_temperature))

Add a comment
Know the answer?
Add Answer to:
Print air_temperature with 1 decimal point followed by C.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • implement two functions in c++ format 1.Convert decimal number to floating point representation (hexa decimal) 2.Convert...

    implement two functions in c++ format 1.Convert decimal number to floating point representation (hexa decimal) 2.Convert floating point representation (hexa decimal) to decimal number Note: We only care about the floating point number in IEEE754 Encoding table below (i.e., exponent 1 – 254).   ----------------------------------------------------------------------------------------------------------------- void from_decimal_to_floating(){ char number[10]; float decimal = 0; cout << "Input decimal to convert a hexa decimal number (e.g., 0.4375): "; cin >> decimal; //write the code here //end of code cout << decimal << "'s...

  • To write a C program (not C++) that converts numbers between Decimal and IEEE-754 format and...

    To write a C program (not C++) that converts numbers between Decimal and IEEE-754 format and vice versa. Inputs: Number in Decimal format (including special case of 0) Number in IEEE-754 format (including special cases) Output: Equivalent number in IEEE-754 format Equivalent number in Decimal Specification: The program converts a number based on choosing from a menu of choices, where each choice calls the appropriate procedure, where the choices are: Decimal to IEEE-754 conversion IEEE-754 to Decimal conversion Quit program...

  • C++ Write a program that takes in 3 inputs [players (int type), expected game time (double...

    C++ Write a program that takes in 3 inputs [players (int type), expected game time (double type), team (char type) and calculates actual game time (double) based on the following conditions: if the number of players or the expected game time is less than or equal to ZERO, it should output Wrong input if the number of players is greater than 0 and less than or equal to 6 and if they are on the 'R' or 'r' team, their...

  • The utility department of Brentwood City needs you to write a C++ program that will print...

    The utility department of Brentwood City needs you to write a C++ program that will print out a customer's bill. The program should input the following items from the file named "utility.txt" (which you may copy from the class data share or Blackboard): The customer number (6-digit integer) The number of gallons of water used (floating-point, no more than 999.99) The number of kilowatts of electricity used (integer, no more than 999) The number of cubic feet of natural gas...

  • Integer division is division that ignores remainder. All digits behind the decimal point are discarded. In...

    Integer division is division that ignores remainder. All digits behind the decimal point are discarded. In other words, decimal point division reports 4/2 = 2.0 and 4/3 = 1.33. In integer division, 4/2 = 2 and 4/3 = 1. Similarly, in integer division, 6/2 = 3 and 7/2 = 3. Create the truth table. Implement an IDIV4 component that completes integer divisionby-4 on a 4-bit input using a VHDL with-select architecture. (Think about the maximum 4-bit input value 15. What...

  • PLEASE ANSWER IN C++! Given the starting point in a maze, you are to find and...

    PLEASE ANSWER IN C++! Given the starting point in a maze, you are to find and mark a path out of the maze, which is represented by a 20x20 array of 1s (representing hedges) and 0s (representing the foot-paths). There is only one exit from the maze (represented by E). You may move vertically or horizontally in any direction that contains a 0; you may not move into a square with a 1. If you move into the square with...

  • C++ program to convert between decimal, hexadecimal, and octal. Please Help!!

    Hi, I need help writing a program that reads in data (hex, octal or decimal values) from an input file and outputs the values in to another base form (hex, octal,decimal) one line at a time depending on the formatting characters provided by the input file. I am posting the code requirements below and an example of what theinput file will look like and what should be output by the program. I only need the one .cpp program file. Thanks...

  • C++ Write a program that reads students’ names followed by their test scores from the given...

    C++ Write a program that reads students’ names followed by their test scores from the given input file. The program should output to a file, output.txt, each student’s name followed by the test scores and the relevant grade. Student data should be stored in a struct variable of type StudentType, which has four components: studentFName and studentLName of type string, testScore of type int and grade of type char. Suppose that the class has 20 students. Use an array of...

  • USING C# 1. Write a program that takes outputs a string, an integer and a floating-point number s...

    USING C# 1. Write a program that takes outputs a string, an integer and a floating-point number separated by commas. Sample output: Bob Marley, 20, 5.2 2. 2. Write a program that asks the user for a string of letters of any size (no spaces), and finally a special character (values 33 to 47 in the Ascii table, or ‘!’ to ‘/’). Generate a random number of any size, integer or floating point, and combine those three pieces of information...

  • C++ question Input Format You are given two strings, a and b, separated by a new...

    C++ question Input Format You are given two strings, a and b, separated by a new line. Each string will consist of lower case Latin characters ('a'-'z'). Output Format In the first line print two space-separated integers, representing the length of a and b respectively. In the second line print the string produced by concatenating a and b (a+b). In the third line print two strings separated by a space, a' and b'. a' and b' are the same as...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT