Fall 2019 1. (What will be printed by the following statements when wt is equal to 160, 220 or 240? if (wt > 220) cout <<"way too heavy !n"; else if (wt> 190) cout <<"too heavy n"; else cout <<"weight has been tested" ); a) wt 160 b) wt 220 c) wt = 240 2. How many times will the following do loop execute? Rewite this code as a for loop x = 3; do {x = x+ 1; cout <
Q: Q1 Given a set of dates and a set of expenses or withdrawals accordingly, the final amount should…
A: C++ program and pseudo code to calculate utilites bill and taxes
Q: d. Given that an int variable s has been initialized, write a statement(s) that declares a new…
A: d) int s1=(9*(s-8))%4
Q: Question 3 The Fast Freight Shipping Company charges the following rates: Weight of Package (in…
A: Here we have a function calculateCharge() which will require two input parameters and out return…
Q: 2.2 what is the value of S1, S2 and S3 where S1, S2 and S3 type is float and each one is equal the…
A: Given: x=4, y=10, w=-10 ceil() = returns the nearest integer greater than the argument passed sqrt()…
Q: A) Write at least three statements that are equivalent to the statement below. count = count + 1;
A: Kindly Note: As per our guidelines we are supposed to answer only one question. Kindly repost other…
Q: Assume a function F1 is defined with the heading: int F1(int a, double &b, double t[]); Assume…
A: function heading int F1(int a, double &b, double t[]); and variables defined are : int a1:…
Q: Question 2: Write a program which calculate the function of F where F=Cx³ + Dx? + EX+E And…
A: Program: Program is the general instructions given to a computer to perform certain tasks, the tasks…
Q: Q3. A water distribution company charges its consumers depending the type of customer: R-…
A: Program approach: Declare all essential variables. Use do while loop for repetition. Input a…
Q: Create a function that takes three arguments prob, prize, pay and returns true if prob * prize >…
A: In this problem, we need to design the javascript programming language. Input - three argument…
Q: Write a program that simulates flipping a coin to make decisions. The input is how many decisions…
A:
Q: The following statement should determine if x is not greater than 20. What is wrong with it?
A: Answer: Given statement error is highlighted with red font if (!x>20)
Q: Create a function that takes three arguments prob, prize, pay and returns true if prob * prize ›…
A: In this problem, we need to design the javascript programming language. Input - three argument…
Q: Which of the following is FALSE regarding the JS let? a. Variables defined with let work within…
A: a. Variables defined with let work within and outside the { and } braces Soln: variables defined…
Q: A bag or cookies holds 50 cookies. The calorie information on the bag claims that there are 10…
A: Answering first question as per the guidelines. The problem is based on the basics of functions in…
Q: Let p be the statement "I celebrate" and q be the statement "Bangladesh wins". [Hint: The following…
A: Here in this question we have given a conditional statement .and we have asked that which is…
Q: Correct the errors in each of the following statements: 1- if ( age >= 65) cout> i>>j; **** *****
A: To correct the errors in the given statements: The given statement is: if ( age >= 65)…
Q: Create a function which returns the type of triangle, given the side lengths. Return the following…
A: As the programming language is not mentioned here, we are using PYTHON The code and output…
Q: 1. Write a program that calculates the user's body mass index (BMI) and categorizes it as…
A:
Q: program5_2.py You have a business that cleans floors in commercial space and offices. You charge…
A: Answer: if __name__ == '__main__': it the interpreter in python in which read the source file
Q: C++ Programming Exercise: When you borrow money to buy a house, a car, or for some other purpose,…
A: PROGRAM: //Header file #include<iostream> #include<iomanip> //Using namespace using…
Q: 3. Write a single C++ statement to accomplish each of the following: Compute the sum of three…
A: Write a single C++ statement to accomplish each of the following: a. compute the sum of the three…
Q: 8: PGandE.cpp) Consider a gas and electric bill that sets two levels of use as follows: Gas Electric…
A: Coded using C++.
Q: "use strict"; /* Question 04 Write a function which creates and returns a promise. Its job will…
A: Answer: I have done code and also I have attached code as well as code screenshot.
Q: Create a function that takes three arguments prob, prize, pay and returns true if prob * prize >…
A: This C++ program has a user defined function with name profitableGamble().
Q: Problem4: Assume two banks want to establish a secure communication channel so that they can share…
A: Python used to answer this question
Q: To determine the falling distance (dist) of an object to the ground due to the gravity (g), the…
A: Note: Here we are using the g value as 8.9 based on the requirements mentioned in the question. The…
Q: Given the code below: type point real a, b end type type (point) v read*, v z=v%a/v%b print*,…
A: Wrong options none of the given code choices ,because option is there type point real a, b end type…
Q: Create a function that takes three arguments prob, prize, pay and returns true if prob* prize > pay;…
A: Algorithm - Design a method with 3 arguments as a number. Now use the below logic to solve the…
Q: What is the ouput f the following code #include void fun (int *ptr) { --pt; } int main() {…
A: Given: What is the ouput f the following code #include <stdio.h> void fun (int *ptr) {--pt; }…
Q: QUESTION 8 What is the result after the following two statements are executed? MOV AL, 0xEF; ADD AL.…
A: Given statements are, MOV AL, 0XEF ADD AL, 2 EF is a hexadecimal number and it's binary…
Q: Q1. Write a program in which the output of the program should be the performance result of a student…
A: Program description: n is the user input integer variable that is used to take from the user the…
Q: Write C assignment statements for the following: a. Assign a value of 0 to a variable called between…
A: Answer a. /* Here n,k,between are variables*/if(n<-k || n>k) between = 0;else between…
Q: Create a function which returns the type of triangle, given the side lengths. Return the following…
A: IN this problem we need to design the code in the RUBY programming language. Please find the logic…
Q: Question 2: Correct the following if statement below.#include <stdio.h>int main(void){int…
A: Syntax for 'if' statement is if (condition) { statement1; statement2;…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: Step 1 The code is given in the below step
Q: Q 3) Write C# statements to accomplish each of following tasks: Assign the sum of x and y to w, and…
A: 1. Code statement: w=x++ +y; Explanation of the code statement: Incrementing x by using…
Q: Create a function that takes three arguments prob, prize, pay and returns true if prob * prize >…
A: In this problem, we need to design the javascript programming language. Input - two argument…
Q: Write a function, named qualityPoints (Note: only a function), that receives a student’s average…
A: Note : Since the programming language is not mentioned, I have done the code in python. We can check…
Q: Equality check: Number of bricks Write an if statement that assigns deliveryComplete with 1 if…
A: First input the value of bricks expected and bricks delivered. Pass these value to function…
Q: Write a function that computes a future investment value at a given interest rate for a specified…
A: Below is the required python program. Program Approach: Declare a futureInvestmentValue function…
Q: PROGRAM DESCRIPTION Make a program that accept employee number, employee name, job code (A/B/C) and…
A: First, we will input the name, job code, number, and hours worked. Based on Job code and hours…
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: Create a function that takes three arguments prob, prize, pay and returns true if prob * prize >…
A: We need to write a Javascript code for the given scenario.
Q: Question 1 is already done need help with the others though This is the C code I have so far…
A: Coded using C language.
Q: 2. When hydrogen gas reacts with iodine gas at elevated temperatures, the following equilibrium is…
A: Solution ::
Q: 2. In the following C code, what is the value of x? short Flag void main (void) ( 1; %3D int x; x =…
A: Flag is globally declared as 1 and thus initial value is 1 After entering into main, Flag is…
Q: Evaluate the following expressions, assume the following declaration: int x = 4; What is…
A: It displays 5.
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 2 images
- Rewrite each of the following statements in the form “If A, then B.”a. Candidate Lu winning the election will be a sufficient condition for property taxes to increase.b. The user clicks Pause only if the game level changes.c. The components are scarce, therefore the price increases.d. Healthy hair is a necessary condition for good shampoo.Let ? be the statement “it snows” and ? be the statement “it is below 32 degrees.” Write the following argument in argument form (i.e., using propositions and logical operators). - “It snows when the temperature is below 32 degrees. It is not snowing. Therefore, it is not below 32 degrees.”c++ (A) write the definition of the Circle class. (B) Write a test program implementing the relational operators (<, <=, ==, ! =, >, >=) to compare the radius of two circle. See the sample outcome Figure 1. in the test program, your code will perform the followings; (A) Creates two circles with the radius 5 and 6 respectively. (B) Use the operator < and display the area of the circle that has the smaller radius. (C) Use the operator == and display the area of the bigger circle if the two circles are not the same. You need to use one of the operators to determine which radius is bigger.
- 10. Let p be the statement “He gets frustrated.” and q be the statement “He will be able to complete the job.” Translate ~(p ∧ q) into the equivalent statement.Suppose salary and bonus are variables of type double. Write an if-else statement that displays the word OK provided that either salary is greater than or equal to MIN_SALARY or bonus is greater than or equal to MIN_ BONUS. Otherwise, it should display Toolow. MIN_SALARY and MIN_BONUS are named constants.Determine whether the following are valid switch statements. if not, explain why. Assume that n and digit are int variables. A. switch (n <= 2) { case 0: cout << "Draw." << endl; break; case 1: cout << "Win." << endl; break; case 2: cout << "Lose." << endl; break; } B. switch (digit / 4) { case 0, case 1: cout << "low." << endl; break; case 1, case 2: cout << "middle." << endl; break; case 3: cout << "high." << endl; } C. switch (n % 6) { case 1: case 2: case 3: case 4: case 5: cout << n; break; case 0: cout << endl; break; } D. switch (n % 10) case 2: { case 4: case 6: case 8: cout << "Even"; break; case 1: case 3: case 5: case 7: cout << "Odd"; break; }
- Consider the following statements: Which of the following statements are valid? If they are invalid, explain why. (4) a. volume = box (length, width, height); b. volume = box (length, 3.8, height); c. cout << box(num1, num3, num2) << endl; d. cout << box (length, width, 7.0) << endl; e. volume = box (length, num1, height); f. cout << box(6.2, , height) << endl; g. volume = box (length + width, height) h. volume = box (num1, num2 + num3) ;2.2.2: If-else statements. 422784.2543518.qx3zqy7 Jump to level 1 Write multiple if statements: If carYear is before 1967, print "Probably has few safety features." (without quotes). If after 1969, print "Probably has seat belts.". If after 1990, print "Probably has anti-lock brakes.". If after 2000, print "Probably has airbags.". End each phrase with period and newline. Ex: carYear = 1995 prints: Probably has seat belts. Probably has anti-lock brakes.Indicate which operator will be executed first in the following statements. a = 2 * (i + j) % 3; b = 2 * i + j % 3; c = arr[i + j] / i + j; c = arr[i + j] / (i + j);
- If, A = {3, 5, 7, 9} B = {2, 4, 6, 8, 10} C = {12, 14, 18, 20, 24} D = {21, 26, 31, 36} A. State whether TRUE or False: 1. 13 ∈ C 2. 6 ∉ A 3. 31 ∈ D 4. 20 ∉ B B. Fill in the blanks to make each statement true: 5.) 3 ∈ ___ 6.) 4 ___ B 7.) 26 ___ C 8.) 8 ∈ ___Write the statement in words if: p: Firemen work hard. q: Firemen wear red suspenders 3) ~p → qd. Given that an int variable s has been initialized, write a statement(s) that declares a new variable andassign it the remainder of 9 times 8 less than s divided by 4. e. Write a statement(s) that initializes the variables named a, b, c and d to false, ''one'', 'y' and 87.9respectively