
a)
To prove whether the given statement is true or false.
a)

The given statement is True.
Explanation of Solution
Explanation:
The flow of control in
In procedural programming, the flow of control is same as the sequence in which the instructions and statements are written.
But in an object-oriented programming language, the flow of control differs due to function calls.
Conclusion:
Hence, in object-oriented programming paradigm also, the flow of control indicates the order in which statements execute in a program.
b)
To prove that the given statement is true or false.
b)

The given statement is False.
Explanation of Solution
Explanation:
The equality operator in C++ comprises of two equal symbols, that is, ==. The equality operator is used together with if statement in order to verify whether the values of two variables are equal or not.
The single equal symbol, =, is called the assignment operator which is used to assign values to variables.
Conclusion:
Hence, the given statement is False.
c)
To prove that the given statement is true or false.
c)

The given statement is False.
Explanation of Solution
Explanation:
When an if statement is written, the expression is written inside a pair of round brackets that does not ends with a semicolon. Whereas if the semicolon is placed after the expression in the if statement, it will not generate an expected result. Ending an if statement with a semicolon means ending the condition. It will check the condition but will end it in the same line and the logic will not be applied to the further statements.
Conclusion:
Hence, the given statement is False.
(d)
To prove that the given statement is true or false.
(d)

The given statement is False.
Explanation of Solution
Explanation:
An if statement should have a corresponding else or not is decided by the requirements of the program. If the program requires, then every if statement will have a corresponding else statement. Otherwise, if the program does not require, the if statement will not have a corresponding else part.
Whether an if statement will have a corresponding else part or not, is only decided by the program requirements and is not mandatory. A program will execute properly if only an if statement is written.
Conclusion:
Hence, the given statement is False.
(e)
To prove whether the given statement is true or false.
(e)

The given statement is False.
Explanation of Solution
Given statement:
The expression in the if statement:
if(score=30)
grade = ‘A’;
Explanation:
The expression inside the if statement assigns the variable score with a value of 30. The assignment statement is always True. Hence, in all the scenarios, the if statement will always evaluate to True and the grade variable will be assigned value ‘A’.
Conclusion:
Thus, the given statement is True.
(f)
To prove whether the given statement is true or false.
(f)

The given statement is True.
Explanation of Solution
Given statement:
The expression:
if(ch>=’A’ && ch<=’Z’)
Explanation:
The given if statement contains two conditions that are combined by “&&” operator. That is, when both the conditions are satisfied only then the if statement will evaluate to True.
For input ch<’A’, the first condition is not satisfied hence the if statement evaluates to False.
For input ch>=’Z’, both the conditions are satisfied only and only if ch=’Z’ but not for ch>’Z’.
Thus, for either of the inputs, the if statement evaluates to False.
Conclusion:
Hence, the given statement is True.
g)
To prove whether the given statement is true or false.
g)

The given statement is True.
Explanation of Solution
Given statement:
The given code is as follows.
cin >> num; if(num > 5) cout << num; num=0; else cout << “Num is zero” << endl;
Explanation:
In the given code, the if statement will be executed only when the input is greater than 5, otherwise the else statement will be executed.
The input for the given code is 5. Since the input is not greater than 5, the if statement will not be executed.
Here, for the input of 5, the else statement will be executed, and the output will be “Num is zero”.
Conclusion:
Hence, the given statement is True.
(h)
To prove whether the given statement is true or false.
(h)

The given statement is True.
Explanation of Solution
Explanation:
The result of a logical expression is either True or False. That is, a logical expression will always give a Boolean result.
A Boolean value can only be assigned to a Boolean variable but not to an int variable.
Conclusion:
Hence, the given statement is True.
(i)
To prove whether the given statement is true or false.
(i)

The given statement is True.
Explanation of Solution
Explanation:
The given expression is a combination of two statements. The first statement is x>0 which checks if the value of x is greater than 0. The second statement is “!” which inverts the result of the expression, x>0. It means that the “!” operator makes the expression as x<0.
Hence, the expression, x<0, can only be true for negative numbers.
Conclusion:
Thus, the given statement is True.
(j)
To prove whether the given statement is true or false.
(j)

The given statement is False.
Explanation of Solution
Explanation:
In C++, there are three logical operators. They are “&&”or AND operator, “||” or OR operator, and “!” or NOT operator.
The “!” operator is a logical operator.
The “!=” operator is an equality operator since it checks if one value is not equal to another value.
Conclusion:
Hence, the given statement is False.
(k)
To prove whether the given statement is true or false.
(k)

The given statement is True.
Explanation of Solution
Explanation:
In C++, there are four types of simple data types. They are integer, float, string, and boolean.
The expression in the switch statement is usually a variable. A variable can have any one of the simple data types.
In some cases when the switch contains an expression, the result of the expression can only evaluate to a value of the simple data type.
Conclusion:
Hence, the given statement is True.
Want to see more full solutions like this?
Chapter 4 Solutions
C++ Programming: From Problem Analysis to Program Design
- Using R language. Here is the information link. http://www.cnachtsheim-text.csom.umn.edu/Kutner/Chapter%20%206%20Data%20Sets/CH06PR18.txtarrow_forwardUsing R languagearrow_forwardHow can I type the Java OOP code by using JOptionPane with this following code below: public static void sellCruiseTicket(Cruise[] allCruises) { //Type the code here }arrow_forward
- Draw a system/level-0 diagram for this scenario: You are developing a new customer relationship management system for the BEC store, which rents out movies to customers. Customers will provide comments on new products, and request rental extensions and new products, each of which will be stored into the system and used by the manager for purchasing movies, extra copies, etc. Each month, one employee of BEC will select their favorite movie pick of that week, which will be stored in the system. The actual inventory information will be stored in the Entertainment Tracker system, and would be retrieved by this new system as and when necessary. Example of what a level-0 diagram looks like is attached.arrow_forwardWhat is the value of performing exploratory data analysis in designing data visualizations? What are some examples?arrow_forwardDraw a level-0 diagram for this scenario: You are developing a new customer relationship management system for the BEC store, which rents out movies to customers. Customers will provide comments on new products, and request rental extensions and new products, each of which will be stored into the system and used by the manager for purchasing movies, extra copies, etc. Each month, one employee of BEC will select their favorite movie pick of that week, which will be stored in the system. The actual inventory information will be stored in the Entertainment Tracker system, and would be retrieved by this new system as and when necessary.arrow_forward
- Draw a context diagram for this scenario: You are developing a new customer relationship Management system for the BEC store, which rents out movies to customers. Customers will provide comments on new products, and request rental extensions and new products, each of which will be stored into the system and used by the manager for purchasing movies, extra copies, etc. Each month, one employee of BEC will select their favorite movie pick of that week, which will be stored in. the system. The actual inventory information will be stored in the Entertainment Tracker system, and would be retrieved by this new system as and when necessary.arrow_forwardWrite a complete Java program named FindSumAndAverage that performs the following tasks in 2-D array: Main Method: a. The main() method asks the user to provide the dimension n for a square matrix. A square matrix has an equal number of rows and columns. b. The main() method receives the value of n and calls the matrixSetUp() method that creates a square matrix of size n and populates it randomly with integers between 1 and 9. c. The main method then calls another method named printMatrix() to display the matrix in a matrix format. d. The main method also calls a method named findSumAndAverage() which: • Receives the generated matrix as input. • Calculates the sum of all elements in the matrix. • Calculates the average value of the elements in the matrix. • Stores these values (sum and average) in a single-dimensional array and returns this array • e. The main method prints the sum and average based on the result returned from findSumAndAverage()). Enter the dimension n for the square…arrow_forwardThe partial sums remain the same no matter what indexing we done to s artial sum of each series onverges, * + s of each series to the series or show 12. (1)+(0)+(0)+(+1)+ 17, " (F) + (F) + (F)(F)(- 18. 19. 1 #20. (三)+(三)-(三)+(3) 20 (9)-(0)-(0)-- 10 +1 2.1+(男)+(男)+(罰)+(鄂 9 T29 x222-끝+1-23 + -.... Repeating Decimals 64 Express each of the numbers in Exercises 23-30 as the m integers. 23. 0.23 = 0.23 23 23... 24. 0.234 = 0.234 234 234. 25. 0.7 = 0.7777... 26. 0.d = 0.dddd... where d is a digit natio of own s converges or * 27. 0.06 = 0.06666.. 28. 1.4141.414 414 414... 29. 1.24123 = 1.24 123 123 123... 30. 3.142857 = 3.142857 142857. Using the ath-Term Test In Exercises 31-38, use the ath-Term Test for divergence to show that the series is divergent, or state that the test is inconclusive 8arrow_forward
- CPS 2231 Computer Programming Homework #3 Due Date: Posted on Canvas 1. Provide answers to the following Check Point Questions from our textbook (5 points): a. How do you define a class? How do you define a class in Eclipse? b. How do you declare an object's reference variable (Hint: object's reference variable is the name of that object)? c. How do you create an object? d. What are the differences between constructors and regular methods? e. Explain why we need classes and objects in Java programming. 2. Write the Account class. The UML diagram of the class is represented below (10 points): Account id: int = 0 - balance: double = 0 - annualInterestRate: double = 0.02 - dateCreated: java.util.Date + Account() + Account(id: int, balance: double) + getId(): int + setId(newId: int): void + getBalance(): double + setBalance(newBalance: double): void + getAnnualInterestRate(): double + setAnnualInterest Rate (newRate: double): void + toString(): String + getDataCreated(): java.util.Date +…arrow_forwardTHIS IS NOT A GRADING ASSIGNMENT: Please only do lab 2.2 (bottom part of the first picture) For that Lab 2.2 do: *Part 1 (do the CODE, that's super important I need it) *Part 2 *Part 3 I also attached Section 2.5.2 which is part of the step 1 so you can read what is it about. Thank you!arrow_forwardTHIS IS NOT A GRADING ASSIGNMENT: Please only do lab 2.2 (bottom part of the first picture) For that Lab 2.2 do: *Part 1 *Part 2 *Part 3 I also attached Section 2.5.2 which is part of the step 1 so you can read what is it about. Thank you!arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,




