7. Let the statements A, B be given by A: not(p or q), B: (not p) or q. Let T= true, F = false. If p = T and q = F, then O A = T, B =T O A = F, B = T O A = F, B = F O A= T, B = F
Q: C++ use the conditional operator to implement the following : if an int i is greater than 100, a…
A: solution.#include <iostream> using namespace std; int main() { int i; // variable i cout…
Q: 7) ( )If we define variables: int a=2, b-4, c-6; the value of the following expression ((a> b? a: b)…
A: The required code has ternary operators (denoted by '?' which is short form of if-else) and thus are…
Q: In C++ write a program that prints the day number of the year, given the date in the form…
A: Program: A program is a set of instructions used to perform certain tasks. There are various…
Q: Logical expression Let a, b, c E {0, 1} be bits. That is, cach of a, b, and c is either 0 or 1. For…
A:
Q: Write the following function to check whether a string is a palindrome assuming letters are…
A: # function which return reverse of a string def isPalindrome(s): return s == s[::-1] # Driver codes…
Q: Q1:- From the given figure, write a program in C++ LANGUAGE to read the height of cylinder then…
A: Program code: // include the required header files #include<iostream> using namespace std; //…
Q: 2. Write the value (True or False) produced by each logical expession below, using the assigned…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: Let X and S denote any valid C++ expressions. Then, the below statement is equivalent to: do (X}…
A: The given requirement is to select one correct answer from the given options a,b,c,d and e . The…
Q: 1.Write all permutation for ABC. (Consider as a letter A, B,C). (PYTHON)
A: Note: Answering the first question as per the guidelines. Input : String: ABC Output : All…
Q: 5) Write a program that reads three numbers and prints "increasing" if they are in increasing order,…
A: logic:- input three numbers . use > and && operator to check if they are in ascending…
Q: In C++ write a program that prints the day number of the year, given the date in the form…
A: Below is the required code in C++ language. Program Approach: Include necessary header files and…
Q: Extend the BNF in the answer bax below to include: 1. if-then-else-end statements (in addition to…
A: Here i am fill the blanks: =============================== 1.statement=if | while | assignment|…
Q: 13. In the following expression, what is the order of execution of the operators and the result,…
A: Refer to step 2 for the answer.
Q: 3. Write an operator that computes a polynomial at some point. (That is, it substitutes a value for…
A: Solution for given question -
Q: C++ use the conditional operator to implement the following: if an int i is greater than 100, a…
A: We are going to write a C++ code using a conditional operator to implement the given statement. A…
Q: Write the program in C++ -Write a program that calculates and prints a cell phone bill. The company…
A: Answer. A C++ program that calculates and prints a cell phone bill, is as under:
Q: 21. Consider the following set of statements. If x>y goto L5 ... L5: goto L7 Identify the set of…
A: According to question, ================================== Given : if x>y then goto loop number…
Q: Given the initial statements: s1 = "spam" s2 = "ni!" Show the result of evaluating each of the…
A: String slicing helps to obtain a sub-string from the given string by slicing it from start to end.…
Q: 1. The operator ↑ is complete. In other words, all the three operators ¬, V and A are representable…
A: Defined the given operator
Q: 4. The value of integer variable t is equal to 10 and the value of the variable p is 2. Find the…
A: Answer: t=2,p=2
Q: (b) Given a and b are int variables and c is a double variable. The initial value for a, b, and c…
A: Postfix Operator: value of the variable is first used the expression and its incremented by 1. Since…
Q: Write a program to compare two fractional numbers by overloading relational operators (,=,==, !=)
A: //Please follow the coding in pictures #inсlude<iоstreаm>#inсlude<сstdlib>using…
Q: 3. Write a program in C to calculate and print the Electricity bill of a given customer. The…
A: C program to calculate and print electricity bill of customer. program code is in step 2. and…
Q: Write the correct syntax? while( a < 5 ): for (int i, i…
A: Write the correct syntax
Q: 03: From the given figure, write a program in C++ base radius r LANGUAGE to read the height of…
A: Given: Volume = height * base area Side Area = height * Base Perimeter.
Q: Write an OOP in C++ that awards students grades based on the following guidelines; A=70-100;…
A: #include <iostream> using namespace std; int main(){ float marks; cout<<"Enter the…
Q: Q(X, y) Be the statement II the domain for both variables consists 0f all integers, what are the…
A: The suitable answer is " False".
Q: Consider the statement int val[2] [4] = { 1, 2, 3, 4, 5, 6, 7, 8} ; 4 will be the value of A.…
A: We are given a 2-d array and we are going to find out how an element 4 which is present in the array…
Q: 15. The statement A: p implies (not p) implies q) is O Tonly when p =T O none of these O always T O…
A: Answer: A: p implies ((not p) implies q) p->(~p ->q): Explanation: p q ~p ~p ->q…
Q: Write a program that reads from the user a character (ʻq’ or 'c'). If the character is 'c' the progr
A: EXPLANATION First, read the character from the user. Then with help of switch check if it is 'q' or…
Q: BMI is a measure of body condition and it is related to a person's weight and height. In the metric…
A: This code is used to know the condition of person whether he’s healthy or obese. If the BMI is less…
Q: Question 4 Rewrite the following statement without using variables. Then, give an exam- ple that…
A: Solution - For the above question 4 and 5 we have to rewrite their statements without using…
Q: Q2 Write an interactive C program using if - else statement, to input water unit charge and…
A: The given problem is related to programing that needs to be solved in C language where the user will…
Q: Q1. Write a program in G+ language to obtain the equation below, for values of x from (1~ 20), by…
A: Note: The set of possible input values for cos inverse function are [1,1]. But in the question, it…
Q: A lecturer intends to separate his students into 2 groups based on their INDEX Numbers, those with…
A: Declare a static integer variable at class level, index, to hold the INDEX number of the student.…
Q: (2) Let P (x, y) : x plays in y." A(x): x is athletic." S(x) :x is smart." E(y) : y is in English…
A: Given: Let P (x, y): x plays in y. A(x): x is athletic." S(x) : x is smart." E(y): y is in…
Q: In C++ write a program that prints the day number of the year, given the date in the form…
A: Code: #include <iostream>#include <stdio.h>#include <stdlib.h>using namespace std;…
Q: Exercise 3. Simplify The following regular expressions a) aa(b* | a) | a(ab* | aa) b) a*(b* + ab*)
A: As per our guidelines we are supposed to answer only one question. Kindly repost other question as a…
Q: Write T if the sentence is true and F if the sentence is false and correct the false sentence.…
A: The operator && represent the short circuit or. The given statement is false F.
Q: Q1:- From the given figure, write a program in C++ LANGUAGE to read the height of cylinder then…
A: Introduction of Program: The C++ program provided with the height of cylinder as input value, and…
Q: Q6: Years that are evenly divisible by 400 or are evenly divisible by 4 but not by 100 are leap…
A: Leap Year Complete Program in Step 2
Q: 10. Let p be the statement “He gets frustrated.” and q be the statement “He will be able to complete…
A: Here in this question we have given a logical statement and we have asked to convert into english…
Q: Part B In C++, if the statement ( int a=5, b=2; ) is written at the beginning of the program, then…
A: As per our guideline simple questions are present in a single image, supposed to solve only three…
Q: write a c++ function that counts the words in a string but does not include numbers for example…
A: #include <bits/stdc++.h>using namespace std;bool CheckNumber(string s){ for(int…
Q: True or false? All the binary operators except = are left associative.
A: Given: True or false? All the binary operators except = are left associative.
Q: Consider statements p and q. p: Mary is practicing golf. q: Aldo is dancing. For parts (a) and (b),…
A: Consider statements p and q.
Q: The programming language is C++, write a program base on the given statement. Write a program that…
A: Note: Below is the required program in C++. Programming Approach: Defining necessary header files.…
Q: 5) Write a program that reads three numbers and prints "increasing" if they are in increasing order,…
A: """Program reads three number and prints increasing, decreasing or neitherbased in its values…
Q: In C++ write a program that prints the day number of the year, given the date in the form…
A: Below is the required code in C++ language. Program Approach: Include necessary header files and…
Given , A: not( p or q ) ; p = T ; q = F .
i.e
A = not ( T or F )
A = not ( T )
A = F
Step by step
Solved in 2 steps
- AcmeSoft company are either programmers or salespeople. The programmers always tells the truth, the salespeople always lie Two AcmeSoft employees A and B were sitting with a visitor in a conference room. A makes the following statement, “At least one of us is a salesperson." What are A and B?Complete the following sentence. operators are operators that compare two numbers and produce a true or false result. For example, a > b contains such an operator that compares the numbers in variables a and b. If the value in a is greater than the value in b, then this operator returns a true result. Otherwise, the operator returns a false result.Consider X=5, Y=10. With help of examples explain the following operators: a. Assignment and shortcut operatorb. ** operatorc. = = operator
- Question 4 The correct statements are: L {E} = {E}L = L. LØ = ØL = Ø. OL₁= (a, b) and L₂ = {a, c}. Then L₁ L2 = {aa, ac, ba, bc}.Pakistan online Daraz company has four agent (1 to 4) who sell 5 different products ( 1 to5). Once per day, each agent passes in a slip for each different type of product sold. Every agentpasses in between 0 to 5 slips each day. Each slip has the following information on it: The agent number The product number Total rupees of that product sold that day.Write a program in C++ that will read all this information for last month’s sales and brief thetotal sales by agent by product. The output should be in tabular form.QUESTION 10 Consider the following statements: T(x, y): "x eats y". A(x): "x is wise". S(x) "x is hungry". F(y): "y is fat". H(y): "y is healthy" The domain of x is the set of all people and the domain of y is the set of all food Select the symbolic of the following sentence (one or more answers). "All hungry and not wise people eat some fat food" O None of all the proposed answers O vx 3y (¬S(x) VA(x)]V[F(y) AT(x,y)] O vx 3y S(x) A ¬A (x) F(y) AT(x.y) O vx 3y -F(y) V -T(x.y) -S(x) V A(x) O vx Vy S(x) A¬A (x) F(y) AT (x.y)
- SLA malicious threat is always from human threat source.S2:As much no two human beings are alike in DNA composition, no two organizations are alike in IT environments. A. Both Statements are trueB. Only the first statement is trueC. Only the second statement is trueD. None of the statements are trueA. The following code in the function "is_prime" attempts to examine a number and return whether the number is prime (i.e. it has no factors besides 1 and itself). It has a "Boolean Flag" called 'prime', however, the boolean logic is not implemented correctly, so the function won't always return the correct answer. # This function determines whether an integer is prime.def is_prime(n):prime = Truefor i in range(2, n): if n2 % i == 0: prime = Falseelse: prime = truereturn prime In what cases does the function report an incorrect answer? How can the code be fixed for it to always report the correct answer? Write your answers as "comments" and the fixed code as a separate python fileLanguage C++ It has been observed by management that some faculty member at the university demonstrates a lackadaisical attitude toward teaching. They seldom go to class yet at the end of each month they receive full salary. Management has decided that GHs 200, 300, 400, and 500 will be deducted from a faculty’s salary if he/she offends once, twice, third time and forth time respectively in a month. This means that if a faculty member offends once in a month GHs 200 will be deducted, if a faculty member offends twice in a month, GHs 500 (i.e. 200+300) will be deducted, if a faculty member offends three times in a month GHs 900 (i.e. 200+300+400), will be deducted and if a faculty member offends four times in a month GHs 1,400 (i.e. 200+300+400+500). Assuming all faculty members are on a flat salary rate of GHs 2000. a. Write a program to request for the names of four faculty members and number times he/she has absented him/herself from class. One of them should have absented…
- 4- By using functions write a complete program that's reads a real value representing price and quantity and compute the total_price as following: -Total_price=price*quantity+pric e*quantity*0.6 for quantity >100 -Total_price=price*quantity+pric e*quantity*0.8 for quantity >80 -Total_price=price*quantity +price*quantity*0.9 for quantity <=80The programming language is C++, write a program for each items base on the given statement. 1. Due to poor result of an examination, your professor decided toincrease each student by 1 point. Input the grade and print the newgrade. If the original grade exceeds 100, then it remains as such. 4. A college student who is registered for 21 units or more is consideredas full time student. The tuition fee for full time is 7000. A part timestudent is charged 300 per unit for tuition. Given the number of unitsa student is registering, calculate and print his tuition fee on the basisof the given criteria.Trigonometry: The basic MATLAB trigonometric functions are sin, cos, tan, cot, sec, and csc. The inverses, e.g., arcsin, arctan, etc., are cal- culated with asin, atan, etc. The same is true for hyperbolic functions. The inverse function at an2 takes two arguments, y and x, and gives the four- quadrant inverse tangent. The argument of these functions must be in radians. Calculate the following quantities: sin, cost, and tan. sin²+ cos². (Typing sin^2(x) for sin²x will produce an error). y cosh²z-sinh² x, with x = 32m.