Programming and Problem Solving With C++
Programming and Problem Solving With C++
6th Edition
ISBN: 9781449694265
Author: Nell Dale
Publisher: Jones & Bartlett Learning
bartleby

Concept explainers

Question
Book Icon
Chapter 4, Problem 5PWE
Program Plan Intro

Program Plan:

To prompt the output to input the three floating values and print their average.

The program should be detailed for the user.

Program Description:

To input the three floating values, three float variables (f1, f2, and f3) are declared.

The sum and the average of the floating values must be floating, so the variables sum and avg are declared as a float.

Then, the values of the variables are inputted, then the average is calculated in the variable avg.

Blurred answer
Students have asked these similar questions
In this variable, the number of source-level statements and the number of I/O operations are both kept track of.
5.20 LAB: Step counter   A pedometer treats walking 2,000 steps as walking 1 mile. Write a program whose input is the number of steps, and whose output is the miles walked. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('{:.2f}'.format(your_value))
Calculate the average of the variables a , b , and c , and assign the result to a variable named avg . Assume that the variables a , b , and c have already been assigned a value, but do not assume that the values are all floating-point. Make sure the value that you assign to avg is a floating-point value.
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning