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
Lelechka [254]
3 years ago
11

CHALLENGE ACTIVITY 7.3.1: Functions: Factoring out a unit-conversion calculation. Write a function so that the main() code below

can be replaced by the simpler code that calls function MphAndMinutesToMiles(). Original main(): int main() { double milesPerHour; double minutesTraveled; double hoursTraveled; double milesTraveled; cin >> milesPerHour; cin >> minutesTraveled; hoursTraveled
Computers and Technology
1 answer:
77julia77 [94]3 years ago
4 0

Answer:

See Explaination

Explanation:

#include <stdio.h>

MphAndMinutesToMiles()

{

double milesPerHour;

double minutesTraveled;

double hoursTraveled;

double milesTraveled;

scanf("%lf", &milesPerHour);

scanf("%lf", &minutesTraveled);

hoursTraveled = minutesTraveled / 60.0;

milesTraveled = hoursTraveled * milesPerHour;

printf("Miles: %lf\n", milesTraveled);

}

int main()

{

MphAndMinutesToMiles();

return 0;

}

You might be interested in
.Statements using the ___________ class are explicit conversions.
USPshnik [31]

Answer: Explicit

Explanation:

 The statement which used the explicit class are the explicit conversion, as  it is type of the conversion which uses the conversion keyword. These type of the keywords act as a function in the explicit conversion and compiler generating the code in the given inline function.  

Explicit conversion basically require the cast operator in its function when, the information is lost during explicit conversion.

Conversion of base class into the derives class is one of the typical example of the explicit conversion.

3 0
3 years ago
Write a recursive method called, doMyMath, which takes as input any positive integer and calculates the factorial (use comments
gulaghasi [49]

Answer:

def doMyMath(n):  

    if n == 1:  

         return n  

    else:  

         return n*doMyMath(n-1)  

Explanation:

This line defines the function

def doMyMath(n):  

This line checks if n is 1. If yes, it returns n (1)

    if n == 1:  

         return n  

If otherwise, it calculates the fibonacci recursively

    else:  

         return n*doMyMath(n-1)  

To call the function from main, you can use:

print(doMyMath(5))

or

num = int(input("Number: "))   --- This gets the number from user

print("Result: ",doMyMath(num)) --- This calculates the factorial

<em>This question is answered in Python</em>

6 0
3 years ago
Which of the following restricts the ability for individuals to reveal information present in some part of the database?
Anni [7]

Answer:

it would have to be flow control which would be C.

Explanation:

8 0
3 years ago
Corinne is taking a chemistry class in college. A lab assignment asks students to track the melting point of ten different subst
Dmitrij [34]

Answer:

a spreadsheet

Explanation:

The data is of statistical type and is experimentally based. And hence, the spreadsheet is the best kind of software that can be used to register the record. And we can save 10 such experient results with the same format of tables on 10 different worksheets, and if we want we can adjust the readings of the 10 similar experiments at one time. And hence, we can quite effectively record as well as analyze this data on the spreadsheet. Hence, the spreadsheet is the correct option.

4 0
3 years ago
Use the AND function with appropriate arguments in cell H11 to determine if there is a force out at third base. There is a force
Pie

Answer:

=AND($C11 = "Yes", $D11 = "Yes")

Explanation:

The AND function takes conditional inputs and tests if each of them are TRUE. If all of the inputs are TRUE, the function will output TRUE but if any one of them are not the function will output FALSE. This scales to multiple inputs but this example only has two conditions. It is important to remember that we want to compare a string so our condition must be "Yes", not just Yes.

We also use a relative cell reference, "$", on the columns C and D since we always want to use the "Runner on 1st" and "Runner on 2nd" columns.

6 0
4 years ago
Other questions:
  • Point mode allows you to select cells for use in a formula by using your finger or the pointer
    7·1 answer
  • TRUE OR FALSE!!!!!
    6·2 answers
  • The Maui coffee shop sells coffee at $10.50 a pound plus the cost of shipping. Each order ships for $0.86 per pound + $1.50 fixe
    14·1 answer
  • Write an algorithm that receives 500 numbers from the user and prints out the maximum of the numbers.
    9·1 answer
  • The main workplace of a Windows computer is called the
    14·1 answer
  • Write a program to read 10 integers from an input file and output the average, minimum, and maximum of those numbers to an outpu
    14·1 answer
  • What does "scanf(\"%d\" mean?
    13·2 answers
  • Question #2
    5·1 answer
  • True or false<br>Y axis is also known as the value X.​
    9·2 answers
  • A.1111+1011. b. 10111+11111 c. 1111*1011 d. 1110*1101 perform the binary calculations.​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!