A restaurant gives a discount for children under 0 hey als gue the discunt for aduts over 55. Which expression evaluates to true if discount should be given? O nge 10) 64 O e10 & ) 10
Q: Clunker Motors Inc. is recalling all vehicles from model years 2001-2006. Given a variable modelYear…
A: EXPLANATION: The given problem can be solved with the help of a ternary operator. The ternary…
Q: CHALLENGE 3.2.3: Basic if-else. ACTIVITY Write an if-else statement for the following: If…
A: user_tickets=int(input()) #take input from userif user_tickets<5: #if number of tickets are less…
Q: ruru_rave(pavlovás, is_holiday) should return True if (pavlovas is between 30 and 70 inclusively) or…
A: The given problem is related to creating a function where the requirement is to implement the…
Q: For the below algorithm what will be the minimum number of test cases required to achieve 100%…
A: Correct option is b. 2
Q: Write at least one difference between items below (1)i++ versus ++i Answer: (2)int versus…
A: Here in this question we have asked to give at least one difference between these i++ versus ++i…
Q: Student Number ending in Non-Prime Number: Determine the decision if, weather:sunny, parents:yes,…
A: The decision tree is the flow chart structure in which each internal node represents the test on the…
Q: A customer want to buy 6 items. He has only 50.50 OMR with him. The price of the products are…
A: Solution: Algorithm to check weather all the 6 products can be bought :…
Q: Variable n contains a positive integer value. Which if statement checks if the rightmost digit of n…
A: // is floor division operator that is it gives you floating point quotient. / Operator is simple…
Q: Suppose that x and y are strings. Which of one the following expressions would be equivalent to…
A: ANSWER: None Of These Options.
Q: If $\frac{\sec (8} \theta}{a}+\frac{\tan {8} \theta} {b}=\frac{1}{a+b}$ then A) $a b \leq 0$ B) $a b…
A: Here, we have to write solution for the above question.
Q: The algorithm below uses a CASE statement. Express the same algorithm using a linear nested IF…
A: Using a linear nested IF statement: #get the input from useroption = int(input("enter option (1-4) :…
Q: Ineed help to create a nested formula in cell B17 with the IF and SUM functions that check if the…
A: For the solution of this inquiry let us take an example of relevant datasheet as below : Suppose…
Q: a. if (n == 0) {b = true; } else { b = false; } (Hint: What is the value of n == 0?) b. if (n == 0)…
A: Conditional operator : A conditional operator is a short form of if-else statement. It is also…
Q: mplement the ff. decision table using a nested if statement. Assume that the grade point average is…
A: Implementing Nested-If statement: The following statement shows the nested-if conditions for given…
Q: Evaluate: Note: [x]is ceiling and [ x ] is floor. [[ 1/2] + [ 1 / 2 ]+1/ 2] O 1 O 3 O 2 O None of…
A: Ceil always rounds a number up to the next largest integer. Floor returns the closest integer less…
Q: :the values of A, w, t0 are -2 4 إختر أحد الخيارات .a A=2, w=2, t0=1 .b None of the given options…
A: G2(t)=A G1(t/w-t0) The value of A will be 2 because G2(t) is two time G1(t) as shown in above…
Q: int bonus, sales 15000 if (sales < 5000) bonus - 200 else if (sales < 7500) bonus - 500 else if…
A: Value of sales = 15000 Condition 1 : if ( sales < 5000) => false because 15000 > 5000…
Q: if one kilogram of rice ci#t Php35.00,find a rule that will determine the amount to be paid fir a…
A: Answer: I have given answer in the brief explanation
Q: u answer incorrec
A:
Q: case the value of D5 is 70 than the logical test result of IF(D5>69,"C",IF(D5>59,"D","F")) will be…
A: Consider the given expression : IF(D5>69,"C",IF(D5>59,"D","F"))
Q: Evaluate the following if a is true, b is true, and c is false: !a [Choose ] a && b [ Choose ] a &&…
A: 1. !a = false 2. a && b = true 3. a && c = false 4. a || c = true
Q: Which of the following statements is correct? a. IF order > 5 prize = ‘yes’; END IF;…
A: I have given an answer in step 2.
Q: A customer want to buy five items. He has only 120.0 OMR with him. The price of the products are…
A: Algorithm: Let item be the items purchased by the customer let price be the price of each item…
Q: Write an expression that continues to bid until the user enters 'n'. c++
A: We put expression in two ways keepGoing=='y' or keepGoing!='n'
Q: You sell regular coffee at 10 rs/bag, cappuccino coffee at 13 rs/bag, and mocha coffee for 15rs/bag.…
A: Note: Here you didn't mention any programming language so we are creating the program in the C++…
Q: Write a program to ask user to enter number of codes. Assign a letter for each code and…
A: According to the information given:- We have to write a program to ask user to enter number of…
Q: A customer want to buy five items. He has only 120.0 OMR with him. The price of the products are…
A: Start Initialize amount in hand to 120 If amount>=5.50 amount=amount-5.5 If amount>=25…
Q: Identify the regular expression for the following: 1 start 91 93 0,1
A: In this question, we are going to find out the regular expression for the given finite automata.…
Q: A customer want to buy five items. He has only 120.0 OMR with him. The price of the products are…
A: Algorithm: Start Initialize amount=120.0 OMR Initialize sum=0 Store all the given prices in an…
Q: For each statement below, write True, False, or "It Depends". Note the "It Depends" answer should…
A: .
Q: Rewrite the following if...else statements using conditional operator. int x- 7; if ( x == 6 ) cout…
A: The if..else statement in the given C++ syntax; if (x==6) cout << "A match is found. \n"; else…
Q: Complete the truth table for the following compound statement. ∼(∼p∨q) OPTIONS EITHER T OR F…
A: P q ~p ~pvq ~(~pvq) T T F T F T F F F T F T T T F F…
Q: C++ program
A:
Q: Rewrite the following code segment using conditional operators (?/:) double discount_percent; if…
A: The conditional (ternary) operator is the only JavaScript operator that takes three operands: a…
Q: gram that calculate prding to the followim ner Type Employ Doctor Nurse vee Police Teacher Other
A: Please find the result below :
Q: Excel’s RAND() function generates a random number (x) such that 0 ≤ x ≤ 1. 0 < x ≤ 1. 0 ≤ x < 1.…
A: RAND function in Excel returns an evenly distributed random real number. The function syntax has no…
Q: Q2:What is the range of variable (num) that makes the variable (x) equal to 120: int num,x=100;…
A: x is already assigned to 100
Q: The result is negative when the dividend and divisor have not same sign. * O False True
A: Binary Coded Decimal, or BCD, is a telephone system or code that uses binary numbers or digits to…
Q: Which of these methods return a smallest whole number greater than or equal to variable X? i)…
A: Question. Which of these methods return a smallest whole number greater than or equal to variable X?…
Q: type is as follows: Туре Price RM 15 for 1 kilogram RM 6 for 1 kilogram RM 10 for 1 kilogram Clothes…
A: I'm writing C ++ Code for this question:
Q: The number of chocolates that John is losing per day is x. Whereas, the number of chocolates that…
A: total number of chocolates = y*(a/x) + b Explanation: initially, john has 100(a) chocolates and he…
Q: (10 points) Suppose you have just finished approximating f(x) = x5 for 0 ≤ x ≤a and ended up with…
A:
Q: Q3 : Find the error(s) in each of the following: 1) float x=1; switch (x) { case >=1: cout= 25 );…
A: The question is to write the codes by correcting the errors. As it is a multipart type question,…
Q: In Column I - We are going to give a bonus based on the profit margin. Create an IF STATEMENT where…
A: The Excel formula is given below assuming a mock data along with screenshots
Q: A. Modified TRUE of FALSE. Write T if the statement is TRUE and CHANGE the underline word if the…
A: There is only one way to determine whether a business is going to be profitable or not. FALSE
Q: This is an example of a ? Choose the most specific answer.
A: The diagram is example of ..... Answer is given below with explanation
Q: If X is a number that comes up when a fair die is rolled, then the expected value of X is 2/7. True…
A: FALSE
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- 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 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.A serendipity bookseller 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 books, 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. W rite a program that asks the user to enter the number of books that he or she has purchased this month and then displays the number of points awarded. using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms; namespace Chapter_4_Problem_6___Seth{public partial class bookClubPoints : Form{public bookClubPoints(){InitializeComponent();}}} C# please code with this contextQuestion Using Java programming language write a program to manage a hotel with 24 rooms;10 rooms are Executive, with price Gh ₵ 2500.00 per night,7 rooms are Chalets, with amounts Gh ₵ 1500.00 per night7 rooms are Ordinary, with amount Gh ₵ 500.00 per night The program should allow customers to book for rooms for a number of nights, and update the number of empty rooms available for each category when a customer has paid fully and has checked-in; also update the number of empty rooms available when customer checks-out.Customers should make bookings with their first names, telephone number A customer should be prompted to know if a room is booked (meaning a another customer has booked it but has not paid fully, or has not checked-in) A customer should be prompted to know if a room is occupied (meaning a booked room has been fully paid for, or the customer has checked-in) A customer should be prompted to know if a room is available (meaning a room has neither been booked nor…
- An Auto Insurance Program Example - Write a program to determine the cost of an automobile insurance premium, based on driver's age and the number of accidents that the driver has had. The basic insurance charge is 500 Rs. There is a surcharge of 100 Rs if the driver is under 25 and there is an additional surcharge for accidents as can be seen below: No. of accidents Accident Surcharge 1 50 2 125 3 250 4 375 5 575 6 or more No insuranceMatric Number: 2. Let x be the first three digits of your matric number, AND y be the last three digits of your matric number. If the first digit of y is 0, replace it with 2. Ехатple: If you matric number is 2013034, Thus, x = 201 and y = 234 a. Write the values of x and y based on your matric number. b. If a = x (mod 7) and b = (-1) + y (mod 7), find the integer(s) c with 10An Auto Insurance Program Example - Write a program to determine the cost of an automobile insurance premium, based on driver's age and the number of accidents that the driver has had. The basic insurance charge is 500 Rs. There is a surcharge of 100 Rs if the driver is under 25 and there is an additional surcharge for accidents as can be seen below: No. of accidents Accident Surcharge 1 50 2 125 3 250 4 375 5 575 6 or more No insurance Note: Use switch cases when you check the total number of accidents.Summary Interest on a credit card's unpaid balance is calculated using the average daily balance. Suppose that netBalance is the balance shown in the bill, payment is the payment made, d1 is the number of days in the billing cycle, and d2 is the number of days payment is made before billing cycle. Then, the average daily balance is: averageDailyBalance = (netBalance * d1 payme If the interest rate per month is, say, 0.0152, then the interest on the unpaid balance is: interest averageDailyBalance * 0.0152 Instructions Write a program that accepts as input netBalance, d1, payment, d2, and interest rate per month ( interestRate).Without using = operatorWhen you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making periodic payments over a certain period of time. Of course, the lending company will charge interest on the loan. Every periodic payment consists of the interest on the loan and the payment toward the principal amount. To be specific, suppose that you borrow $1,000 at an interest rate of 7.2% per year and the payments are monthly. Suppose that your monthly payment is $25. Now, the interest is 7.2% per year and the payments are monthly, so the interest rate per month is 7.2/12 = 0.6%. The first months interest on $1,000 is 1000 0.006 = 6. Because the payment is $25 and the interest for the first month is $6, the payment toward the principal amount is 25 6 = 19. This means after making the first payment, the loan amount is 1,000 19 = 981. For the second payment, the interest is calculated on $981. So the interest for the second month is 981 0.006 = 5.886, that is, approximately $5.89. This implies that the payment toward the principal is 25 5.89 = 19.11 and the remaining balance after the second payment is 981 19.11 = 961.89. This process is repeated until the loan is paid. Write a program that accepts as input the loan amount, the interest rate per year, and the monthly payment. (Enter the interest rate as a percentage. For example, if the interest rate is 7.2% per year, then enter 7.2.) The program then outputs the number of months it would take to repay the loan. (Note that if the monthly payment is less than the first months interest, then after each payment, the loan amount will increase. In this case, the program must warn the borrower that the monthly payment is too low, and with this monthly payment, the loan amount could not be repaid.)3. Suppose 'p' denotes the statement "you were 90 on your last birthday" and 'q' denotes the statement "you are over 21": If you are over 21, then you were 90 on your last birthday. The statement is. * Inverse Contradiction Contrapositive Converse None of the above* Question Completion Status: A Moving to another question will save this response. Question 9 Given the function F(X,Y,Z) =XZ + Z(X'+ XY), the equivalent, most simplified Boolean representation for F is O a. Z+XYZ O b.XZ O c. Z O d.Z+YZ A Moving to another question will save this response. مشمس 36°CJava function to Find whether a given number is a power of 4 or not Example : powerOfFourOrNot(2) -> false powerOfFourOrNot(16) -> trueSEE MORE QUESTIONS