Concept explainers
The following
#include <iostream>
using namespace std;
// You must write definitions for the two functions qualify
// and noQualify.
int main()
{
double salary;
int years;
cout ≪ "This program will determine if you qualify\n";
cout ≪ "for our credit card.\n";
cout ≪ "What is your annual salary? ";
cin ≫ salary;
cout ≪ "How many years have you worked at your ";
cout ≪ "current job? ";
cin ≫ years;
if (salary >= 17000.0 && years >= 2)
qualify();
else
noQualify();
return 0;
}
Learn your wayIncludes step-by-step video
Chapter 6 Solutions
Starting Out with C++ from Control Structures to Objects (8th Edition)
Additional Engineering Textbook Solutions
C Programming Language
Starting out with Visual C# (4th Edition)
Programming in C
Concepts of Programming Languages (11th Edition)
Artificial Intelligence: A Modern Approach
Software Engineering (10th Edition)
- Complete the function quarts_to_liters() that has one parameter as a volume in quarts. The function returns the volume converted to liters, given that 1 quart = 0.946353 liters. Ex: If the input is 69, then the output is: The number of liters is 65.298arrow_forwardUsing the Concepts of functions and function prototypes, write a program using C++ that accepts thegross pay and computes both the tax amount and the net pay.arrow_forwardThis is a c programming question. Please solve with functions. Question The function that returns letter grade according to midterm and final grade: The function turn_to_letter decides on the letter grade of the student according to the table below from the visa and final grades sent into it and returns it, write it together with a main function which the turn_to_letter function is called and prints the letter equivalent on the screen. -Success score = 40% of midterm + 60% of final, -F for the success score below 50, D for between 50 and 59, C for between 60 and 69, B for between 70 and 79, A for 80 and above.arrow_forward
- This is c programming question. Use function please for solving. Question: (The function that returns letter grade according to midterm and final grade) : The function turn_to_letter decides on the letter grade of the student according to the table below from the visa and final grades sent into it and returns it, write it together with a main function which the turn_to_letter function is called and prints the letter equivalent on the screen. - Success score = 40% of midterm + 60% of final, - F for the success score below 50, D for between 50 and 59, C for between 60 and 69, B for between 70 and 79, A for 80 and above.arrow_forwardin C++ Complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 2, print "Too small". If greater than 10, print "Too large". Otherwise, compute and print 6 * bagOunces followed by " seconds". End with a newline. Example output for ounces = 7:42 secondsarrow_forwardWrite a function prototype to calculate the volume of a cube. The function receives a long type variable that stores one of the side of the cube and returns the long type volume of the cubearrow_forward
- Write a program in C++ that computes and displays the charges for a customer's mechanic fees. The company charges $12 per hour for labor. First, the program should ask if the car is under warranty or not. If the car is under warranty, the following data should be entered: Warranty expiration date Car mileage Cost of Parts (if applicable, enter 0.00 if no cost) The program should call a function to ask for the following data if the car is not under warranty and return the total charges. Car Mileage Number of labor hours Cost of Parts Display the information entered for the vehicle. Input Validation: Do not accept a negative value for any data element.arrow_forwardThe language is C++. Can someone write a function for each these three bullet points. One function for each. Conference or seminar registration fees Hotel expenses. (The company allows up to $90 per night for lodging. Anything in excess of thisamount must be paid by the employee.) The cost of each meal eaten. On the first day of the trip, breakfast is allowed as an expense if the time of departure is before 7 a.m. Lunch is allowed if the time of departure is before noon. Dinner is allowed if the time of departure is before 6 p.m. On the last day of the trip, breakfast is allowed if the time of arrival is after 8 a.m. Lunch is allowed if the time of arrival is after 1 p.m. Dinner is allowed if the time of arrival is after 7 p.m. The program should only ask for the costs of allowable meals. (The company allows up to $18 for breakfast, $12 for lunch, and $20 for dinner. Anything in excess of this must be paid by the employee.)arrow_forwardusing C-programming; Write the following functions that compute the volume and surface of a sphere with radius r; a cylinder with circular base with radius r and height h; and a cone with circular base with radius r and height h. Place these functions in appropriate class. Define π (PI) as a constant variable equals to 3.14 then use it in the functions. float sphereVolume(float r)float sphereSurface(float r)float cylinderVolume(float r, float h)float cylinderSurface(float r, float h)float coneVolume(float r, float h)float coneSurface(float r, float h) Now, prompt the user for the values of r and h, call the 6 functions, and print the result.arrow_forward
- Asymptotic function relationships. Verify each of the following statements by the definitions to see if they are true or false 1. If ?(?) = Θ(?), then ??(?) = Θ(?2 ) 2. If ?(?) = ?(?2 ) and ?(?) = Ω(?(?)), then ?(?) = ?(?2) 3. If ?(?) = ?(0. 5?2 ) and ?(?) = Ω(7?2 + ?????), then ?(?) = Θ(?2 ) 4. If ?(?) = ?(?3 ), then ?(?) = Ω(2?3 ) 5. If ?(?) = Θ(?3 ), then ?(?) = ?(2n )arrow_forwardWrite a function prototype to calculate the volume of a cube. The function receives a long type variable that stores one of the side of the cube and returns the long type volume of the cube in c++arrow_forward17. A function should determine the average of x and y. What should be the function's parameters and return value(s)? A.Parameters: none Return values: X,y B.Parameters: ×, y, average Return value: none C.Parameters: average Return values; X, y D.Parameters: X, y Return value: averagearrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning