Starting Out with C++ from Control Structures to Objects (8th Edition)
8th Edition
ISBN: 9780133769395
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 10, Problem 27RQE
The following if statement determines whether choice is equal to 'Y' or 'y':
if (choice == 'Y' || choice == 'y')
Simplify this statement by using either the toupper or tolower function.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Logical variables: On Time or Delayed?
Complete the function WhatlsIt such that:
The output logical variable on Time is true only if no Traffic is true and gasEmpty is false.
The output logical variable delayed is false only if no Traffic is true and gasEmpty is false.
Restriction: Logical expressions must be used. Do not use if statements.
Function >
1 function [onTime, delayed] = WhatIsIt (noTraffic, gasEmpty)
2
onTime =
3
delayed =
4
5
end
Save
C Reset
MATLAB Documentation
Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awareded as follows:
If a customer purchases 0 books, he or she earns 0 points.
If a customer purchases 1 book, he or she earns 5 points.
If a customer purchases 2 books, he or she earns 15 points.
If a customer purchases 3 books, he or she earns 30 points.
If a customer purchases 4 or more books, he or she earns 60 points.
Creat an application in C# that lets the user enter the number of books that he or she has purchased this month and displays the number of points awarded.
5. Write an efficient if statement to assign x the value 1 if x ≤ 1.5, 2 if 1.5
Chapter 10 Solutions
Starting Out with C++ from Control Structures to Objects (8th Edition)
Ch. 10.2 - Write a short description of each of the following...Ch. 10.2 - Prob. 10.2CPCh. 10.2 - Write an if statement that will display the word...Ch. 10.2 - What is the output of the following statement?...Ch. 10.2 - Write a loop that asks the user Do you want to...Ch. 10.4 - Write a short description of each of the following...Ch. 10.4 - Prob. 10.7CPCh. 10.4 - Prob. 10.8CPCh. 10.4 - Prob. 10.9CPCh. 10.4 - When complete, the following program skeleton will...
Ch. 10.5 - Write a short description of each of the following...Ch. 10.5 - Write a statement that will convert the string 10...Ch. 10.5 - Prob. 10.13CPCh. 10.5 - Write a statement that will convert the string...Ch. 10.5 - Prob. 10.15CPCh. 10.6 - Prob. 10.16CPCh. 10 - Prob. 1RQECh. 10 - Prob. 2RQECh. 10 - Prob. 3RQECh. 10 - Prob. 4RQECh. 10 - Prob. 5RQECh. 10 - Prob. 6RQECh. 10 - Prob. 7RQECh. 10 - Prob. 8RQECh. 10 - Prob. 9RQECh. 10 - Prob. 10RQECh. 10 - The __________ function returns true if the...Ch. 10 - Prob. 12RQECh. 10 - Prob. 13RQECh. 10 - The __________ function returns the lowercase...Ch. 10 - The _________ file must be included in a program...Ch. 10 - Prob. 16RQECh. 10 - Prob. 17RQECh. 10 - Prob. 18RQECh. 10 - Prob. 19RQECh. 10 - Prob. 20RQECh. 10 - Prob. 21RQECh. 10 - Prob. 22RQECh. 10 - Prob. 23RQECh. 10 - Prob. 24RQECh. 10 - The ________ function returns the value of a...Ch. 10 - Prob. 26RQECh. 10 - The following if statement determines whether...Ch. 10 - Assume input is a char array holding a C-string....Ch. 10 - Look at the following array definition: char...Ch. 10 - Prob. 30RQECh. 10 - Write a function that accepts a pointer to a...Ch. 10 - Prob. 32RQECh. 10 - Prob. 33RQECh. 10 - T F If touppers argument is already uppercase, it...Ch. 10 - T F If tolowers argument is already lowercase, it...Ch. 10 - T F The strlen function returns the size of the...Ch. 10 - Prob. 37RQECh. 10 - T F C-string-handling functions accept as...Ch. 10 - T F The strcat function checks to make sure the...Ch. 10 - Prob. 40RQECh. 10 - T F The strcpy function performs no bounds...Ch. 10 - T F There is no difference between 847 and 847.Ch. 10 - Prob. 43RQECh. 10 - char numeric[5]; int x = 123; numeri c = atoi(x);Ch. 10 - char string1[] = "Billy"; char string2[] = " Bob...Ch. 10 - Prob. 46RQECh. 10 - Prob. 1PCCh. 10 - Prob. 2PCCh. 10 - Prob. 3PCCh. 10 - Average Number of Letters Modify the program you...Ch. 10 - Prob. 5PCCh. 10 - Prob. 6PCCh. 10 - Name Arranger Write a program that asks for the...Ch. 10 - Prob. 8PCCh. 10 - Prob. 9PCCh. 10 - Prob. 10PCCh. 10 - Prob. 11PCCh. 10 - Password Verifier Imagine you are developing a...Ch. 10 - Prob. 13PCCh. 10 - Word Separator Write a program that accepts as...Ch. 10 - Character Analysis If you have downloaded this...Ch. 10 - Prob. 16PCCh. 10 - Prob. 18PCCh. 10 - Check Writer Write a program that displays a...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Modify the temperature conversion program to print a heading above the table.
C Programming Language
Write an if statement that sets the variable hours to 10 when the boolean flag variable minimum is equal to tru...
Starting Out with Java: From Control Structures through Objects (6th Edition)
A single alternative decision structure tests a condition and then takes one path if the condition is true, ano...
Starting Out with Python (4th Edition)
Consider the adage Never ask a question for which you do not want the answer. a. Is following that adage ethica...
Experiencing MIS
We can improve the Beer class from the previous Practice Program by using principles of information hiding. The...
Java: An Introduction to Problem Solving and Programming (8th Edition)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- You may only use 'not' and 'or' to solve this along with parenthesesarrow_forwardComputer Sciencearrow_forwardFunction Name: compliments Parameters: answer1 - a boolean (True or False) representing whether the user is "smart" answer2 - a boolean (True or False) representing whether the user is "awesome" answer3 - a boolean (True or False) representing whether the user is "fun" Description: Write a function that outputs a string of compliments based on the adjectives selected by the inputs. Use the inputs True and False. The function should return the string “You are” concatenated with the compliments that are true. The three compliments should be: "smart" "awesome" and "fun". If none of the compliments are true, print the string “Goodbye.” instead. Test Cases: >>>compliments(True, True, True) You are smart awesome fun. >>>compliments(False, True, False) You are awesome. >>>compliments(False, False, False) Goodbye.arrow_forward
- C Language - Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west.arrow_forwardC++ Mobile Service ProviderModify the program in Problem 5 so that it also displays how much package A customers would save if they purchased package B or C, and how much money Package B customers would save if they purchases Package C. If there would be no savings, no message should be printed. calculate the cost of all plans (A, B, and C) based on the number of minutes the user-entered. Then based on the plan user chose, compare, and calc. the difference among the plans.arrow_forwardC++ Mobile Service ProviderModify the program in Problem 5 so that it also displays how much package A customers would save if they purchased package B or C, and how much money Package B customers would save if they purchases Package C. If there would be no savings, no message should be printed. calculate the cost of all plans (A, B, and C) based on the number of minutes the user-entered. Then based on the plan user chose, compare, and calc. the difference among the plans. this one has some errorarrow_forward
- Computer Fundamentals and Programming 2 Write a program that determines a student’s grade. The program will accept 3 scores and computes the average score. Determine the grade based on the following rules: - If the average score is equal or greater than 90, the grade is A. - If the average score is greater than or equal to 70 and less than 90, the grade is B. - If the average score is greater than or equal to 50 and less than 70, the grade is C. - If the average score is less than 50, the grade is F. Source Codes and Print Screen of the Outputarrow_forwardIn what situation should you overload the = operator?arrow_forwardSerendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awarded as follows: If a customer purchases no books, he or she earns 0 points If a customer purchases 1 through 5 books, he or she earns 5 points for each book. If a customer purchases 6 through 10 books, he or she earns 10 points for each book. If a customer purchases 11 or more books, he or she earns points equal to 20 points for each book. (Use Python) Use the Design Recipe to write the function customer_rewards which consumes the number of books purchased, and returns the total points. Include a docstring! Write 3 assert_equal statements to test your function.arrow_forward
- Variables father and child contains ages of a father and his child.Which if statement checks if father's age is more than 4 times his child's age? Lütfen birini seçin: a. if father // 4 > child: b. if father > 4 * child: c. if father > 4 * child d. if f > 4 * c: e. if father >= 4 * child:arrow_forwardq → r r Therefore, q. -- This is an example of a _______ statement.arrow_forwardThe Problem__: Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions: ⚫ void getScore() should ask the user for a test score, store it in a reference param- eter variable, and validate it. This function should be called by main once for each of the five scores to be entered. ⚫ void calcAverage() should calculate and display the average of the four highest scores. This function should be called just once by main and should be passed the five scores. ⚫int findLowest() should find and return the lowest of the five scores passed to it. It should be called by calcAverage, which uses the function to determine which of the five scores to drop. Input Validation: Do not accept test scores lower than 0 or higher than 100. YOU MUST USE THE STATED FUNCTIONS AND COMPLETE Input VALIDATION. **DO NOT use an ARRAY OR GLOBAL VARIABLES!!. you MUST USE function prototyping TEST THE FUNCTION TWICE.…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Control Structure in Data Structure - Data Structures - Computer Science Class 12; Author: Ekeeda;https://www.youtube.com/watch?v=9FTw2pXLhv4;License: Standard YouTube License, CC-BY