Although the following code segments are syntactically correct, each contains an error. Locate the error and indicate what is wrong.
A) hours = 12;
if (hours> 40);
cout <<hours<<" hours qualifies for over-time .\n";
B) interestRate = .05;
if (interestRate = .07)
cout << "This account is earning the maximum rate. \n";
C) interestRate = .05;
if (interestRate > .07)
cout << "This account earns a $10 bonus. \n";
balance += 10.0;
Trending nowThis is a popular solution!
Chapter 4 Solutions
Starting Out with C++: Early Objects (9th Edition)
Additional Engineering Textbook Solutions
Starting Out with C++ from Control Structures to Objects (9th Edition)
Starting Out with Programming Logic and Design (4th Edition)
Starting Out with Java: From Control Structures through Objects (6th Edition)
Starting Out With Visual Basic (7th Edition)
C++ How to Program (10th Edition)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
- L et D= { s, d, b}, E= { c, k}, G= { a, k }, U={a, b, c, d, k, s} DUE=arrow_forwardLecture Note Form : F = ±(0.d₁d2d3... dm) ße, Normalized Form : F= ±(1.d₁d2d3 ... dm) B Be Denormalized Form : F= ±(0.1d₁d2d3 ·dm) 3 ße ... Let ß = 2, m = 4, emin = -1 and emax = 2. Answer the following questions: (a) Compute the minimum of r for normalized form. (b) Compute the Machine Epsilon value for the normalized form. Compute the maximum delta value for the form given in Eq. (1). (c) .(i) .(ii) .(iii)arrow_forward1. Look at the following partial code. function checker(x) { var got_an_A = true; if (x >= 90) { got_an_A = true; } else { got _an_A = false; if (got_an_A != true) { document.getElementById("tbx1").value = "Did not get the A"; } else { document.getElementByld("tbx1").value = "Got the A"; } a. What will be the value of the textbox with the id: thxl if we have the following function call: checker(95); b. What will be the value of the textbox with the id: thxl if we have the following function call: checker(85);arrow_forward
- What is the opposite of greater than?arrow_forwardBook (ISBN, Category, BTitle, Quantity,CID) Sales (SalesNo, Month_Year, TotalSales, ISBN) Shop (RegNo, Location, SalesNo) Customer (CID, CName, TelNo, Age) (ii)What was the title and category of the book that the customer Emekabought? (iii)Who purchased the book in the Coding category,or the quantity is greater than two? (iv)What isthe total sales and location of the shop with the registration number "REG KL 100" in the month ofApril 2021? (v)Display the identification number, name, age together with the total salesof the customers who purchasedthe Computer Fundamentals title book.arrow_forward"IS MARRIED_TO" Relationship is known as Recursive relationship? IS MARRIED_TO 1 1 wife husband PERSON Select one: O True O Falsearrow_forward
- Problem 2 Concert Tickets 8 points There are three tickets for a concert. The VIP tickets cost $120, premium tickets cost $80, and regular tickets cost $40. Prompt the user how many tickets of each category he would like. Then print an invoice with overview of the order and total price. Include a sales tax of 9.25%. How many tic kets would you like to order? VIP Tickets ($120): 0 Premium Tickets ($80) : 4 Regular Tickets ($40): 2 Invoice: $120 x 0= $ 0.00 $ 80 X 4 = $320.00 $ 40 x 2 = $ 80.00 9.25% $ 37.00 VIP: Premium: Regular: Sales Tax: Total Price: $437.00arrow_forwardassign(self, assignment:Assignment) -> AssignmentResult: """ This function is to simulate the process of the student receiving an assignment, then working on the assignment, then submitting the assignment and finally receiving grade for the assignment. This function will receive an assignment then a grade should be calculated using the following formula: grade = 1 - (Student's current energy X Assignment difficulty level). The min grade a student may receive is 0% (0) After the grade is calculated the student's energy should be decreased by percentage difficulty. Example if the student has 80% (.8) energy and the assignment is a difficultly level .2 there final energy should be 64% (.64) = .8 - (.8 * .2). The min energy a student may have is 0% (0) Finally the grade calculated should be stored internally with in this class so it can be retrieved later. Then an Assignment Result object should be created with the student's ID, the assignment…arrow_forwardLanguage is Carrow_forward
- Book Club Points Serendipity 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 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. Create an application that lets the user enter the number of books that he or she has purchased this month and displays the number of points awarded.arrow_forwardc++ taskarrow_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
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT