Function InchesToFeet(float inchesToConvert) returns float totalFeet totalFeet = inchesToConvert / 12 // Calculate totalFeet: totalFeet = 0 Function Main() returns nothing float userInches float totalFeet userInches = Get next input totalFeet = InchesToFeet(userInches) Put userInches to output Put " inches are " to output Put totalFeet to output Put " feet." to output   The ismage uploaded is the result I am getting I am not sure what I am doing wrong

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.2: Returning A Single Value
Problem 13E
icon
Related questions
Question

Function InchesToFeet(float inchesToConvert) returns float totalFeet totalFeet = inchesToConvert / 12 // Calculate totalFeet: totalFeet = 0 Function Main() returns nothing float userInches float totalFeet userInches = Get next input totalFeet = InchesToFeet(userInches) Put userInches to output Put " inches are " to output Put totalFeet to output Put " feet." to output

 

The ismage uploaded is the result I am getting I am not sure what I am doing wrong

Check
Try again
X The first line of the function definition defines the return variable's type and name. A function may return one value by assigning
a return variable with the return value. Ex: MyFunction() returns integer totalCount defines a return variable called totalCount. The
statement totalCount = 100 assigns the return variable with 100. When the end of the function is reached, the value stored in
totalCount is returned.
Output differs. See highlights below.
Input
360
Your output
Expected output
Your output
Expected output
360.0 inches are 0.0 feet.
360.0 inches are 30.0 feet.
Output differs. See highlights below.
Input
45
45.0 inches are 0.0 feet.
45.0 inches are 3.75 feet.
Transcribed Image Text:Check Try again X The first line of the function definition defines the return variable's type and name. A function may return one value by assigning a return variable with the return value. Ex: MyFunction() returns integer totalCount defines a return variable called totalCount. The statement totalCount = 100 assigns the return variable with 100. When the end of the function is reached, the value stored in totalCount is returned. Output differs. See highlights below. Input 360 Your output Expected output Your output Expected output 360.0 inches are 0.0 feet. 360.0 inches are 30.0 feet. Output differs. See highlights below. Input 45 45.0 inches are 0.0 feet. 45.0 inches are 3.75 feet.
Expert Solution
steps

Step by step

Solved in 6 steps with 2 images

Blurred answer
Knowledge Booster
Concept of Parenthesis
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning