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
timofeeve [1]
3 years ago
11

#include using namespace std;class RunnerInfo { public: void SetTime(int timeRunSecs); // Time run in seconds void SetDist(doubl

e distRunMiles); // Distance run in miles double GetSpeedMph(); // Speed in miles/hour __(A)__ int timeRun; double distRun;};void __(B)__::SetTime(int timeRunSecs) { timeRun = timeRunSecs; // timeRun refers to data member}void __(C)__SetDist(double distRunMiles) { distRun = distRunMiles;}double RunnerInfo::GetSpeedMph() const { return distRun / (timeRun / 3600.0); // miles / (secs / (hrs / 3600 secs))}int main() { RunnerInfo runner1; // User-created object of class type RunnerInfo RunnerInfo runner2; // A second object runner1.SetTime(360); runner1.SetDist(1.2); runner2.SetTime(200); runner2.SetDist(0.5); cout << "Runner1's speed in MPH: " << runner1.__(D)__ << endl; cout << "Runner2's speed in MPH: " << __(E)__ << endl; return 0;}Complete the missing parts of the figure above.(b) -> Ru?(c) -> Ru?::(d) -> Get?()(e) -> runner2.?

Computers and Technology
1 answer:
Softa [21]3 years ago
5 0

Answer:

Here is the complete program:

#include <iostream>

using namespace std;  

class RunnerInfo {

  public:                                

     void SetTime(int timeRunSecs);       // Time run in seconds

     void SetDist(double distRunMiles);   // Distance run in miles

     double GetSpeedMph();                // Speed in miles/hour

   private:

     int timeRun;

     double distRun;  };    

void RunnerInfo::SetTime(int timeRunSecs) {

  timeRun = timeRunSecs;  // timeRun refers to data member

}  

void RunnerInfo::SetDist(double distRunMiles) {

  distRun = distRunMiles; }

double RunnerInfo::GetSpeedMph()  {

  return distRun / (timeRun / 3600.0); // miles / (secs / (hrs / 3600 secs))  }

int main() {

  RunnerInfo runner1; // User-created object of class type RunnerInfo

  RunnerInfo runner2; // A second object

  runner1.SetTime(360);

  runner1.SetDist(1.2);

  runner2.SetTime(200);

  runner2.SetDist(0.5);

  cout << "Runner1's speed in MPH: " << runner1.GetSpeedMph() << endl;

  cout << "Runner2's speed in MPH: " << runner2.GetSpeedMph() << endl;  

  return 0;  }

Explanation:

(A):

private:

The variables timeRun and distRun are the data members of class RunnerInfo so they should be set to be private in order to prevent access from outside the class. So they are set to private which is an access specifier.

(B):

RunnerInfo  

Here the name of the class RunnerInfo is used with double colon operator (::) which is used to qualify a C++ member function. This is used to define a function outside a class. So here the function name is SetTime() and it is defined outside class RunnerInfo. So we use resolution operator to define this function. The basic syntax is:

class_name :: function_name (args)

(C):

RunnerInfo::

This is missing in the above code. This works the same as (B).

:: double colons are called resolution operator :: and it is used  to define a function outside a class.

(D):

GetSpeedMph()

runner1 is the object of class RunnerInfo which represents Runner 1. So in order to display the Runner 1's speed in Mph, the method GetSpeedMph() is called using the object runner1. The object is basically used to access the method of class RunnerInfo. This method GetSpeedMph() computes the speed using formula distRun / (timeRun / 3600.0);  and returns the computed speed in MPH.

(E):

 runner2.GetSpeedMph()

If we see the print statement:

Runner2's speed in MPH:

This shows that the speed of 2nd Runner is required. So for this purpose, the object runner2 is used. So using this object we can call the method that computes the speed of the 2nd runner. This method is GetSpeedMph(). So using runner2 for 2nd runner we access the method GetSpeedMph() to compute the Runner2's speed in MPH.

The entire program after correction gives the following result:

Runner1's speed in MPH: 12                                                                                                                    Runner2's speed in MPH: 9

You might be interested in
Which option allows you to customize the order of your data ?
Digiron [165]

✧・゚: *✧・゚:*    *:・゚✧*:・゚✧

                  Hello!

✧・゚: *✧・゚:*    *:・゚✧*:・゚✧

❖ The correct answer choice is B) sorting. When you sort, you can order your sheet however you'd like.

~ ʜᴏᴘᴇ ᴛʜɪꜱ ʜᴇʟᴘꜱ! :) ♡

~ ᴄʟᴏᴜᴛᴀɴꜱᴡᴇʀꜱ

3 0
3 years ago
Read 2 more answers
I really need help with this question, I can’t fail this please :) tysm
Maurinko [17]

Answer:

i think its the third one, i hope this helps

Explanation:

4 0
4 years ago
_____ (without parity) means spreading the data among multiple (at least two) drives. Group of answer choices Parity
Llana [10]

Answer:

"Disk Striping" would be the right choice.

Explanation:

  • Disk stripping has become a methodology where certain numerous small external drives consist of a single massive disk. This same classification turns huge information into single blocks but instead disperses them over numerous different storage media.
  • Disk stripping retail outlets instead of every data unit through a single place and doesn't provide disk failure safeguards.
3 0
3 years ago
Does this mean that the radius is the input aka 3 ? what about the PI ?
strojnjashka [21]

Explanation:

In  this question

d is known as diameter

r is known as radius

c is known as circumference

pi is known as π

a is known as area

Now, In Maths

Area of circle = π×r×r

Circumference of circle = 2×π×r

Radius (r) = diameter(d)÷2

Given diameter is 6

then, r = 6 ÷2

r = 3

so, diameter = 6

radius = 3

circumference = 2×π×r

                        = 2×3.14×3 ( the value of π is equal to 3.14)

                        = 18.84

Area = π×r×r

= 3.14×3×3 ( the value of π is equal to 3.14)

 = 28.26

6 0
3 years ago
Which are the benefits of leveraging web technologies?
allsm [11]

Lower cost - You can leverage web technologies like FB and Google which allow you to advertise and reach billions of users relying on their services at a very low cost as compared to other mediums.  

Security – Data stored with web technology companies offers more security because it is stored in huge data centers that have high-end protection

Increase business efficiency – Web technologies can increase business efficiency and unlock value in your business functions. They can reduce time, provide critical analytics and help your business grow.

4 0
4 years ago
Read 2 more answers
Other questions:
  • While configuring a new 802.11g wireless network, you discover another wireless network within range that uses the same channel
    13·1 answer
  • What is print media?
    14·1 answer
  • A cpu with an external clock speed of 2 ghz and a 64-bit data bus can (theoretically) transfer how much data per second?
    8·1 answer
  • Which presidential race has been called “the dirtiest in American history”
    10·1 answer
  • True or False. A modern programming EXE provides a text editor, a file manager, a compiler, a linker and loader, and tools for d
    9·1 answer
  • Describe how you could obtain a statistical profile of the amount of time spent by a program executing different sections of its
    10·1 answer
  • What is an example of static we page?
    7·1 answer
  • Zack is taking a survey that contains questions about his future plans. Which question would most likely be on the survey?
    9·2 answers
  • Https://forms.gle/eP8F5eKC2AUaCsB67
    14·1 answer
  • A market-product strategy that requires no change in the basic product but instead seeks new buyers is known as ______
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!