The following
#include <iostream>
#include <iomanip>
using namespace std;
void showDollars(double pay); // Function prototype
int main()
{
double payRate, hoursWorked, wages;
cout << "How many hours have you worked? "
cin >> hoursWorked;
cout << "What is your hourly pay rate? ";
cin >> payRate;
wages = hoursWorked * payRate:
showDollars(wages);
return 0;
}
// Write the definition of the showDollars function here.
// It should have one double parameter and display the message
// "Your wages are $" followed by the value of the parameter.
Want to see the full answer?
Check out a sample textbook solutionChapter 6 Solutions
STARTING OUT WITH C++ MPL
Additional Engineering Textbook Solutions
Starting Out with C++ from Control Structures to Objects (8th Edition)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Database Concepts (7th Edition)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Starting Out with C++ from Control Structures to Objects (9th Edition)
- 14. What is the value of a and b after the function call myfunction1(a,b) in the main function? void myfunction1(int a, int &b) { a+t; b++; int main() { int a=5,b=53; myfunction1(a,b): } a) a=5,b=5 b) a=5,b=6 c) a=6,b=5 d) a=6,b=6arrow_forwardThe following program skeleton asks for the number of hours you’ve worked and your hourly pay rate. It then calculates and displays your wages. The function showDollars, which you are to write, formats the output of the wages. #include <iostream> #include <iomanip> using namespace std;void showDollars(double pay); // Function prototype int main(){ double payRate, hoursWorked, wages;cout << "How many hours have you worked? " cin >> hoursWorked;cout << "What is your hourly pay rate? "; cin >> payRate;wages = hoursWorked * payRate; showDollars(wages);return 0; }// Write the definition of the showDollars function here.// It should have one double parameter and display the message // "Your wages are $" followed by the value of the parameter.arrow_forwardC program: complete the calculator function to make the main program workarrow_forward
- C++ Programming Pleasearrow_forwardTopic: Recursive Function A bank increases the interest rate it gives to its customers by 1% every month the money stays in the bank. Write the recursive function that calculates the total amount of money at the end of the maturity date, based on the condition below. The parameters of the function: capital, initial interest rate and maturity date(months) Note: Codes should be written in C programming language.arrow_forwardFruit Juice Machine Using Development C++ In this programming example, there are one function available which is main() class andstored in fruit.cpp.The program should do the following;1. Show the customer the different product sold by the juice machine.2. Let the customer make the selection.3. Show the customer the item selected.4. Accept money from customer.5. Release the item.Input – the selected item, quantityOutput – the selected item and customer receipt.QuestionExecute the files by using Dev C++. Understand the flow of the program. Next, manipulate oradd appropriate functions in the existing files to:1. Add coffee in the machine which has several types (minimum of 4 types). Allocates theprice and types for the customer. (Now, user can choose screen to buy juice or coffee.With each have different menu).2. Show the customer the cost for each.3. Let the customer choose more than one drink (iterate till the customer request to endchoosing the drink).4. Prompt user to enter more…arrow_forward
- C++ Languagearrow_forwardc++ computer language given the following class definition, write the definition of the function 'inc' such that it increases the variable 'tmp' by the amount received passed to the function. class temp { public: float inc(float); float dec(float); private: float tmp; };arrow_forwardFunctions With Parameters and No Return Values Quiz by CodeChum Admin Create a program that accepts an integer N, and pass it to the function generatePattern. generatePattern() function which has the following description: Return type - void Parameter - integer n This function prints a right triangular pattern of letter 'T' based on the value of n. The top of the triangle starts with 1 and increments by one down on the next line until the integer n. For each row of in printing the right triangle, print "T" for n times. In the main function, call the generatePattern() function. Input 1. One line containing an integer Output Enter·N:·4 T TT TTT TTTTarrow_forward
- struct date{ int day; int month; int year; }; Write a function named void increaseDay(struct date *d) that increases the value of a variable of struct date type with integer year, month, and day members by one day. Write a function named void decreaseDay(struct date *d) that decreases the value of a variable of struct date type with integer year, month, and day members by one day. Write a C program that reads from the user a date in d/m/y format and the amount of increase or decrease as an integer. Display the new date in d/m/y format. You may call related functions as many as given increase or decrease value. Note 1: You do not need to consider leap years. Use always 28 days for month February. Note 2: Do not modify the function prototypes. Sample Input1: Sample Output1: 12/8/1990 -5 7/8/1990 Sample Input2: Sample Output2: 26/2/2005 5 3/3/2005 Sample Input3: Sample Output3: 29/12/1998 7 5/1/1999…arrow_forwardAdmission Write a C++ program that: Define a void function named Admission() with two parameters. The function accepts two arguments: a student’s high school grade point average (for example, GPA is 3.2) and an admission test score (for example, 83). The function then displays a message “Accepted” if the student has any of the following: A GPA of 3.6 or above and an admission test score of at least 60. A GPA of 3.0 or above and an admission test score of at least 70. A GPA of 2.6 or above and an admission test score of at least 80. A GPA of 2.0 or above and an admission test score of at least 90. If the student does not meet any of the qualifications, the function should display a message “Rejected”. //for example, here is the function header: void admission (double gpa, int score) Write a function prototype statement for function Admission before the main function, and add function definition after the main function in the program. In the main function, prompts user to enter a…arrow_forwardC++ pleasearrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr