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
Marina CMI [18]
3 years ago
10

Write a second ConvertToInches() with two double parameters, numFeet and numInches, that returns the total number of inches.

Computers and Technology
1 answer:
Westkost [7]3 years ago
3 0

Answer:

Answered in C++

double ConvertToInches(double numFeet, double numInches){

   return numFeet*12 + numInches;

}

Explanation:

A foot is equivalent to 12 inches. So, the function converts feet to inches by multiplying the number of feet by 12.

The question is answered in C++

This line defines the method with two parameters

double ConvertToInches(double numFeet, double numInches){

This line converts the input parameters to inches and returns the number of inches

   return numFeet*12 + numInches;

}

To convert 9 feet and 12 inches to inches, the main method of the program can be:

<em>int main(){</em>

<em>    cout<<ConvertToInches(9,12);</em>

<em>    return 0;</em>

<em>}</em>

This above will return 120 because: 9 * 12 + 12 = 120 inches

You might be interested in
Consider the following code: String word [] = {"algorithm", "boolean", "char", "double"}; for ( int i =0; i &lt; word.length/2;
KiRa [710]

Answer:

{"double", "char", "char", "double"} will be stored in word.

Explanation:

Given the word is an array of four strings,  {"algorithm", "boolean", "char", "double"}. Hence, the length of the word array is 4.

The for-loop will only run for two iterations due to i < word.length/2, with i = 0 (first loop) and i = 1 (second loop).

In the first loop,  

  • word[word.length - 1 - i]  =  word[4 - 1 - 0]  = word[3]  = "double"
  • Hence, the string "double" will be assigned to word[0] and overwrite "algorithm"

In the second loop,

  • word[word.length - 1 - i]  =  word[4 - 1 - 1]  = word[2]  = "char"
  • Hence, the string "char" will be assigned to word[1] and overwrite "boolean"

At last, the word array will hold {"double", "char", "char", "double"}

8 0
4 years ago
Read 2 more answers
Python Coding:
leva [86]

Answer:

# Here we are asking the user for a number two times

userInput1 = input("Enter any #: ")

userInput2 = input("Enter any # again: ")

# We compare if userInput1 is greater than userInput2

if(userInput1 > userInput2):

   # Print userInput1 if userInput1 is greather than userInput2

   print("First Number: " + userInput1)

   # Otherwise, print userInput2

else:

   print("Second Number: " + userInput2)

# Initiate a while-loop

while(True):

   # The lines below are from above

   userInput1 = input("\nEnter any #: ")

   userInput2 = input("Enter any # again: ")    

   if(userInput1 > userInput2):

       print("First Number: " + userInput1)

   else:

       print("Second Number: " + userInput2)

   # We ask the user whether they would like to stop

   stop = input("\nWould you like to stop? (Yes or No)")

   # Compare the String stop with "Yes"

   if(stop == "Yes"):

       # If true then break

       break

Explanation:

The use of \n is unnecesary, but it skips a line and provides more readability.

5 0
2 years ago
Describe the difference between information poor and information rich society?​
Nadya [2.5K]

Answer:

The “Information poor” are consumers who use traditional mass media information such as television, DVDs, radios and magazines. ... On the opposite “information rich” stands for a new elite within the information society.

7 0
3 years ago
Read 2 more answers
All of the following are search operators EXCEPT _______________. a. AND b. OR c. NOT d. GET
ella [17]
D is ur answer. Hope this helps
5 0
4 years ago
Read 2 more answers
While troubleshooting a connectivity issue in your network, you did a Ping from Host A to Host B, and the Ping was successful. F
xeze [42]

Answer:

Above OSI Layer 3

Explanation:

5 0
3 years ago
Other questions:
  • Which is the last step in conducting a url research
    11·1 answer
  • What should you keep in mind when installing hard drives?
    5·1 answer
  • Which signal types are represented by a continuous waveform?
    10·1 answer
  • As the team leader, John ensures that all his teammates are clear in the team goals they need to achieve. He demonstrates the qu
    12·2 answers
  • What method of heat transfer is used when the sun heats the earth?
    14·1 answer
  • Create a do-while loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop shou
    5·1 answer
  • Select all the correct answers.
    7·2 answers
  • You have a large text file of people. Each person is represented by one line in the text file. The line starts with their ID num
    5·1 answer
  • PAGE<br>DATE<br>0 What types of information should be there internet?​
    5·1 answer
  • When you click on what will happen?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!