answer.
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
tekilochka [14]
2 years ago
5

Write a function so that the main() code below can be replaced by the simpler code that calls function MphAndMinutesToMiles(). O

riginal main():
int main() {
double milesPerHour;
double minutesTraveled;
double hoursTraveled;
double milesTraveled;

cin >> milesPerHour;
cin >> minutesTraveled;

hoursTraveled = minutesTraveled / 60.0;
milesTraveled = hoursTraveled * milesPerHour;
cout << "Miles: " << milesTraveled << endl; return 0;
}
#include
using namespace std;
//please write your answer here.
int main() {
double milesPerHour;
double minutesTraveled;

cin >> milesPerHour;
cin >> minutesTraveled;

cout << "Miles: " << MphAndMinutesToMiles(milesPerHour, minutesTraveled) << endl;
return 0;
}
Computers and Technology
1 answer:
babymother [125]2 years ago
6 0

Answer:

The program to this question can be given as:

Program:

#include <iostream> //header file

using namespace std; //using namespace

double MphAndMinutesToMiles(double milesPerHour, double minutesTraveled) //defining method

{

return (minutesTraveled/ 60.0)*milesPerHour; //return value.

}

int main() //defining main method

{

double milesPerHour,minutesTraveled; //define variable

cout<<"Enter miles per hour :";  

cin >> milesPerHour;  

cout<<"Enter travelling minutes :";

cin >> minutesTraveled;

cout << "Miles: "<< MphAndMinutesToMiles(milesPerHour, minutesTraveled)<< endl;

return 0;

}

Output:

Enter miles per hour :12

Enter travelling minutes :20

Miles: 4

Explanation:

The explanation of the above C++ program can be given as:

  • In the first header file is include the function is define that is "MphAndMinutesToMiles". This function accepts two parameters that are "milesPerHour and minutesTraveled".
  • Both parameter datatype is double and the function return type is also double. Inside a function calculate miles and return its value.
  • In the main method, two variable defines that takes value from the user side and pass into the function. To print function return value we use "cout" function that prints function return value.
You might be interested in
Arrays are described as immutable because they are two dimensional. are arranged sequentially. can be reordered. cannot be chang
Vlada [557]

Answer:

Arrays are described as immutable because they cannot be changed once they are defined.  (D on Edge)

Explanation:

It's in the notes and I just took the test (2020)

6 0
2 years ago
The elements in a string type array will be initialized to ____.?
ivanzaharov [21]
The elements in a string type array will be initialized to "Null".
7 0
2 years ago
If a user was complaining about a "slow computer" due to a program that uses a significant amount of memory, what part or parts
Sedaia [141]

Answer:

The Random-Access Memory (RAM) should be upgraded.

Explanation:

Since the particuar apllication is taking alot of memory space it means that an ugrade/ installation of a bigger RAM would help the system work better while using the program

6 0
2 years ago
You have been employed as a technical consultant to a computer shop chain. You are given the task of creating a short consumer b
brilliants [131]

Answer:

The five factors to consider when trying to choose between a Solid State Drive, a Hard Disk Drive and, an External Hard Disk Drive are:

  1. Read/Write Speed
  2. Weight
  3. Power Consumption
  4. Cost
  5. Storage Capacity

  • Solid State Drives (SSDs) are typically lighter in weight, faster and do not consume much power.
  • Hard Disk Drives are relatively cheaper than SSDs. They also come with higher storage capacities but are more power-hungry and slower because they rely on mechanical/moving parts to read and write data.
  • External HDDs are the cheapest of the three. They are not internal which is a major drawback given the additional weight. However, they come with gargantuan storage capacities that make you want to rethink having one. Besides, unlike SSDs, you can easily get them in computer accessories shops offline or online.

Cheers!

3 0
2 years ago
E-mail is an efficient means of disseminating information quickly and inexpensively. However, HIPAA regulations affect e-mail us
oksano4ka [1.4K]

Sending potentially sensitive information by email

Potentially sensitive information can be sent via Email only if the Email is encrypted

Explanation:

No doubt Email is an inexpensive efficient means of communicating quickly. But it is prone to hacking and it is not a secure mechanism. In order to add security ,the Email needs to be sent in an encrypted form. Banking and HIPAA regulations require the emails to be sent in encrypted form as it is a secure mechanism. Even if one has the consent from the client , the Email has to be in encrypted. Even if the Organization's e-mail system has appropriate firewalls and related infrastructure , the golden rule is to send encrypted format Emails.

7 0
2 years ago
Other questions:
  • The term load is often used to describe opening a page in a ____. Answer
    11·1 answer
  • A(n) ______close to a cover letter leads to more interviews because you are contacting the employer. a. passive b. lengthy c. ac
    11·2 answers
  • Column, bar, pie, line, and scatter are all types of_____
    9·1 answer
  • Have you ever tried to teach a class full of restless, active sixth-graders? I have. I taught sixth-grade students for 12 years.
    15·1 answer
  • Who are the founders of video-sharing site Dailymotion?
    7·1 answer
  • . Write a function wordscramble that will receive a word in a string as an input argument. It will then randomly scramble the le
    10·1 answer
  • Consider the following relationship involving two entities, students and classes:A student can take many classes. A class can be
    9·1 answer
  • During the name resolution process, which technique is used to avoid congestion when querying a server
    8·1 answer
  • When do images or graphics in Microsoft Word hurt the document rather than help
    9·1 answer
  • Members of the sales team use laptops to connect to the company network. While traveling, they connect their laptops to the inte
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!