Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

To assist the organizers of a new program where students, faculty, and staff will earn rewards for riding a bike to campus, you are

 imageimageimageimage

To assist the organizers of a new program where students, faculty, and staff will earn rewards for riding a bike to campus, you are tasked with calculating how many points someone has earned based on the number of rides they have completed. rewardPoints.cpp contains several functions. runProgram is a void function with no parameters. It is simply the function that the main function will call. printResult will take one argument: the number of points earned. It will print the result of the given calculation. calculatePoints will take one argument: the number of bike rides taken to campus, and return one value: the number of rewards points earned based on the number of bike rides. Table I shows how points are calculated. Rides Completed Points Earned 0 3 0 1 2 3 4 > 5 Table 1: Bike Reward Points 10 15 30 50 2.1 Sample Run Sample Run ./reward Points .out How many rides did you complete? 4 You have earned 30 points. #include "reward Points.h" #include #include #include #include #include using namespace std; /* Purpose: Functions to calculate reward points earned based on bike rides completed */ int main(int argc, char* argv [] ) { runProgram (); return 0; } void runProgram () { } void printResult(int points ) { } return; } return; int calculatePoints(int rides ) { return -1; #ifndef REWARDPOINTS H #define REWARDPOINTS H using namespace std; Purpose: Functions to calculate reward points earned based on bike rides completed void runProgram (); void printResult(int points ); int calculatePoints(int rides); #endif

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Statistics The Exploration & Analysis Of Data

Authors: Roxy Peck, Jay L. Devore

7th Edition

0840058012, 978-0840058010

More Books

Students also viewed these Algorithms questions