Starting Out with C++ from Control Structures to Objects (9th Edition)
9th Edition
ISBN: 9780134498379
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 2.6, Problem 2.7CP
Which of the following are illegal variable names, and why?
X
99bottles
july97
theSalesFigureForFiscalYear98 r&d
grade_report
Expert Solution & Answer
Learn your wayIncludes step-by-step video
schedule05:25
Students have asked these similar questions
QUESTION 3
Which of the following statement is false regarding the assignment statement?
O a. The right value might be a constant, a variable, an expression or any combination of these
O b. The left value must be a variable
OC. The assignment always takes place from right to left and never the other way
O d. The assignment always takes place from left to right and never the other way
3. Which of the following statements is TRUE about passing parameters by reference and by value?
A. Passing by reference requires more space and time.
B. Passing by reference guarantees the integrity of the data.
C. Passing by value requires less space but more time.
D. Passing by value is preferred if the integrity of the original data is the priority.
E. None of the above
Which of the following is false?
a. The position of the arguments listed in the Call statement should agree with the position of the parameters listed in the receiving procedure’s parameterList.
b. The data type of each argument in the Call statement should match the data type of its corresponding parameter in the receiving procedure’s parameterList.c. The name of each argument in the Call statement should be identical to the name of its corresponding parameter in the receiving procedure’s parameterList.
d. When you pass information to a procedure by value, the procedure stores the value of each item it receives in a separate memory location.
Chapter 2 Solutions
Starting Out with C++ from Control Structures to Objects (9th Edition)
Ch. 2.1 - The following C++ program will not compile because...Ch. 2.3 - The following C++ program will not compile because...Ch. 2.3 - Study the following program and show what it will...Ch. 2.3 - Write a program that will display your name on the...Ch. 2.4 - Prob. 2.5CPCh. 2.4 - What will the following program display on the...Ch. 2.6 - Which of the following are illegal variable names,...Ch. 2.6 - Prob. 2.8CPCh. 2.6 - Prob. 2.9CPCh. 2.6 - Prob. 2.10CP
Ch. 2.8 - Prob. 2.11CPCh. 2.8 - Which of the following is a character literal? B BCh. 2.8 - Prob. 2.13CPCh. 2.8 - Write a program that has the following character...Ch. 2.8 - What is wrong with the following program...Ch. 2.8 - Prob. 2.16CPCh. 2.8 - Write a program that stores your name, address,...Ch. 2.11 - Prob. 2.18CPCh. 2.11 - Prob. 2.19CPCh. 2.11 - Prob. 2.20CPCh. 2.14 - Is the following assignment statement valid or...Ch. 2.14 - How would you consolidate the following...Ch. 2.14 - What is wrong with the following program? How...Ch. 2.14 - Prob. 2.24CPCh. 2.16 - Prob. 2.25CPCh. 2 - How many operands does each of the following types...Ch. 2 - How may the double variables temp, weight, and age...Ch. 2 - Prob. 3RQECh. 2 - Write assignment statements that perform the...Ch. 2 - Is the following comment written using single-line...Ch. 2 - Is the following comment written using single-line...Ch. 2 - Modify the following program so it prints two...Ch. 2 - What will the following programs print on the...Ch. 2 - Multiple Choice 9. Every complete statement ends...Ch. 2 - Prob. 10RQECh. 2 - Every C++ program must have a ________. A) cout...Ch. 2 - Preprocessor directives begin with ________. A) #...Ch. 2 - The following data 72 'A' Hello World" 2.8712 are...Ch. 2 - A group of statements, such as the contents of a...Ch. 2 - Which of the following are not valid assignment...Ch. 2 - Which of the following are not valid cout...Ch. 2 - Assume w = 5, x = 4, y = 8, and z = 2. What value...Ch. 2 - How would each of the following numbers be...Ch. 2 - The negation operator is ________. A) unary B)...Ch. 2 - A(n) ___________ is like a variable, but its value...Ch. 2 - Prob. 21RQECh. 2 - T F A variable must be defined before it can be...Ch. 2 - T F Variable names may begin with a number.Ch. 2 - T F Variable names may be up to 31 characters...Ch. 2 - T F A left brace in a C++ program should always be...Ch. 2 - T F You cannot initialize a named constant that is...Ch. 2 - Prob. 27RQECh. 2 - Convert the following pseudocode to C++ code. Be...Ch. 2 - There are a number of syntax errors in the...Ch. 2 - Sum of Two Numbers Write a program that stores the...Ch. 2 - Sales Prediction The East Coast sales division of...Ch. 2 - Sales Tax Write a program that will compute the...Ch. 2 - Restaurant Bill Write a program that computes the...Ch. 2 - Average of Values To get the average of a series...Ch. 2 - Annual Pay Suppose an employee gets paid every two...Ch. 2 - Ocean Levels Assuming the oceans level is...Ch. 2 - Total Purchase A customer in a store is purchasing...Ch. 2 - Cyborg Data Type Sizes You have been given a job...Ch. 2 - Miles per Gallon A car holds 15 gallons of...Ch. 2 - Distance per Tank of Gas A car with a 20-gallon...Ch. 2 - Land Calculation One acre of land is equivalent to...Ch. 2 - Circuit Board Price An electronics company sells...Ch. 2 - Prob. 14PCCh. 2 - Triangle Pattern Write a program that displays the...Ch. 2 - Diamond Pattern Write a program that displays the...Ch. 2 - Stock Commission Kathryn bought 750 shares of...Ch. 2 - Energy Drink Consumption A soft drink company...Ch. 2 - Annual High Temperatures The average July high...Ch. 2 - How Much Paint A particular brand of paint covers...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
The spreadsheet in Microsoft Excel file Ch01Ex01_U10e.xlsx contains records of employee activity on special pro...
Using MIS (10th Edition)
Write Java statements that will cause the following to be written to the screen; Onetwobuckleyourshoe.Threefour...
Absolute Java (6th Edition)
(De Morgans Laws)In this chapter, we discussed the logical operators **&, Ó� Ó�, and !. De Morgan’s Laws can so...
C How to Program (8th Edition)
Write a program to print the value of EOF.
C Programming Language
Bond Yield One measure of a bond's performance is its Yield To Maturity (YTM). YTM values for government bonds ...
Introduction To Programming Using Visual Basic (11th Edition)
Write an SQL statement to display the pet ID, breed, and type for all pets having a four-character name startin...
Database Concepts (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
- Which of the following is a condition(s) that causes deadlock? a. Mutual exclusion b. Hold and wait Oc. Circular Wait d. Coffman's Conditionsarrow_forwardBelow is the code for a procedure that will accept a Customer ID as an input parameter and display the Customer ID, Customer Surname and Customer Address. Review the code, then answer the questions that follow. create or replace procedure sp_customer_details (c_id IN CUSTOMER.cust_id%TYPE,customer_details out VARCHAR2)ISBEGINSELECT 'CUSTOMER ID:' || c.cust_id || ', Surname:'|| c.cust_sname || ',ADDRESS:' ||c.cust_addressinto customer_detailsfrom CUSTOMER cwhere c.cust_id = c_id;END; Q.1 Briefly discuss the advantages of using the %TYPE attribute in the code. Q.2 Create the code to execute the procedure with exception handling if no customer data is found. Use customer ID C115 in your code.arrow_forwardQUESTION 1 Which of the following is NOT an inout mode of parameter passing? pass by reference pass by value-result pass by result pass by namearrow_forward
- Which program created the following output? (Only a partial listing of output is displayed.) Obs, Vars Label File Last Modified # Name Member Туре Entries Size or Indexes 1 FRAM30 DATA 27MB 06/01/2000 5209 607 09:05:36 2 FRAM40 DATA 5209 707 27MB 01/10/2011 15:35-26 3 FRAMBMISBP DATA 56223 змв о6 302011 17:03:15 4 FRAMEXAMSSUBSET DATA 3752 14 361KB 04/02/2012 09:20:11 proc contents data=fram._all_ nods details; O run; proc contents data=fram._all_; run; proc contents data=fram._all_ nods; run; proc contents data=fram._al1_ details; O run;arrow_forwardWhich of the following is false? a. The order of the arguments listed in the calling statement should agree with the order of the parameters listed in the receiving procedure’s header. b. The data type of each argument in the calling statement should match the data type of its corresponding parameter in the procedure header. c. When you pass an item to a procedure by value, the procedure stores the item’s value in a separate memory location. d. The name of each argument in the calling statement should be identical to the name of its corresponding parameter in the procedure header.arrow_forwardWhich of the following statements declares an object to represent the pseudo-random number generator in a procedure? a. Dim randGen As New RandomNumber b. Dim randGen As New Generator c. Dim randGen As New Random d. Dim randGen As New RandomObjectarrow_forward
- Case 3 and 4 : How can I search by name or Birthday from the file and not from the compiler . Thanks. To understand my question the best to try it by compiler and press 3 or 4. and then enter Name Helena for exampel and the output is not found and there Helena in the file. ContactsBook.txt: Name: AdamDate of Birth: 671231Address GöteborgEmail: gadfl@outlook.comPhone Number: 765432 Name: JosefDate of Birth: 960607Address SkövdeEmail: hbcs@gmail.comPhone Number: 7230173 Name: HelenaDate of Birth: 560124Address HalmstadEmail: helena@outlook.comPhone Number: 7321745 The program: #include<iostream>#include <fstream>#include<string>using namespace std;#define M 100int count=0;struct AddressBook{string FullName;int Birthday;string Address;string Email;int PhoneNumber;}Person [M];void WriteToFile();void add();void browse();void searchByName();void searchByBirthday();void removeContact();void order();int main(){fstream file;file.open("Contact'sBook.txt");int…arrow_forwardCreate a simple Monitoring System of Vaccinated and Unvaccinated Students using python Programming. The user can add, delete, and update the data inputted. Data should contains the ff. (name, age, address, type of vaccine and status of vaccine(fully vaccinated or partially vaccinated))arrow_forwardTeacher has prepared the result of a class containing n number of students. He wants togive the award to 3 toppers of the class. Display the Result for 3 toppers as reflected as percentageform in floating type dataarrow_forward
- Programming langauge: Python Prompt: Pick a genre of your choice and provide average movie’s ratings by the following four time intervals during which the movies were released withiin 10 years group (i.e. 1970 to 1979, 1980 to 1989, 1990 to 1999, 2000 to 2009) Mock dataframe: *attached screenshot*arrow_forwardYou Need to Find the Location of Procedure forWhich You Only Know Part of the NameThe Problem: You "sort of " know the name of the procedure you want tofind? This is a common problem for Microsoft Windows programmers because ofthe extremely inconsistent naming convention of the procedures in the WindowsAPI. UNIX programmers fare no better. Only the inconsistency in namingconversions is consistent; the only problem is that UNIX likes to leave letters outof system call names (for example, creat).arrow_forwardIn python, To get in complete access to a global variable named student_data use... A. global student_data # in the function where you want access B. global student_data # in the main program C. global (student_data) # in the function where you want access D. global:student_data # in the function where you want accessarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
- New Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Linux - Tutorial for Beginners in 13 MINUTES! [ UPDATED ]; Author: bai;https://www.youtube.com/watch?v=BMGixkvJ-6w;License: Standard YouTube License, CC-BY
What is Linux?; Author: Techquickie;https://www.youtube.com/watch?v=zA3vmx0GaO8;License: Standard YouTube License, CC-BY
Introduction to Linux and Basic Linux Commands for Beginners; Author: sakitech;https://www.youtube.com/watch?v=IVquJh3DXUA;License: Standard Youtube License