Consider the value of a=32 and value of b=22. a=a+b b=a+b c=a+b d=a+b+c print(c) print(d)
Q: Write a program that will determine if a number is positive or negative. If positive it should be…
A: Given: Write a program that will determine if a number is positive or negative. If positive it…
Q: Calories = ( (Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991 ) x Time / 8.368…
A: The steps of the program are: Take input for the variables age, weight, heart_rate, time using the…
Q: What does the following code display? boolean p = true, q = true; if(!p) System.out.print("A"); else…
A: The correct option Is option B that is the output of given code is B
Q: The variable x starts with the value 0. The variable y starts with the value 5. Add 2 to X. Add 2…
A: As no programming language has been used, Java has been used.
Q: ( write in c language) write A program that inputs three different integers from the keyboard , then…
A: A C program for the given criteria is as follows,File name: “main.c”#include <stdio.h>int…
Q: 1. What is the value of x and y for the following code: int y = 10; int x = ++y;
A: The value of the x and y for the following code will be : x = 11y = 11
Q: 4. In the C++ language write a program to input two integers x and y and check whether the numbers…
A: The code is given in the below step
Q: Write a program which reads two integer values. If the first is less than the second, print the…
A: Here I have declared 2 variables num1 and num2 of integer data type. Next, I have taken input from…
Q: True or false _______ 9. The ratio 3 : 5 is less than the ratio 2 : 11. _
A: According to the Question below the solution: As per our guidelines we are supposed to answer only…
Q: Write a program that reads the subtotal and the gratuity rate, then computes the gratuity and total.…
A: Here I have asked the user to enter subtotal and gratuity rates. Then I have calculated the gratuity…
Q: write a program to display fruit sales receipts. Apple: Pink Lady - $4.99/kilo, Fuji - $5.99/kilo.…
A: I give the code in Python along with output and code screenshot
Q: Given an integer value variable time: Write a few lines of code to: 1) Print morning if time is…
A: #include <iostream> using namespace std; int main() { int usertime=0;…
Q: Write an expression that obtains a random integer between 34 and 55. Write an expression that…
A: EXPLANATION - RANDOM FUNCTION In python language there is a special function that is random () .…
Q: Write c program that will take two numbers a and b from user and find and display small number from…
A: Given: To write code in C.
Q: Write a c++ program that will ask the user to input 20 integer numbers. Count the number of odd and…
A: #include <iostream> using namespace std; int main(){ // Define variables int e = 0;…
Q: Question 1: Write a C program that do the following: A Ask the user to enter his grade as (A, B, C,…
A: Below is the required code in C language. Approach to Program: Include necessary header files to…
Q: z=x%y z=x**y Z=x//y print("Second Value of Z will be",z)
A: FOR GIVEN CODE - x = 7 y= 4 z=x%y z=x**y z=x//y print("Second Value of Z will be ", z) EXPLANATION…
Q: 7. Read input an integer from the user and print whether it is "Negative"/"Positive" using the…
A: Write a PHP program to read input an integer from the user and print whether it is…
Q: # input Two variables for range lower = int(input("Please enter lower range: ")) upper =…
A: The cyclomatic complexity of this given program is 4. Cyclomatic complexity is a quantitative…
Q: Translate the statement into equation: When three is multiplied by one less than a number x, the…
A:
Q: Choose the correct data type for the value 12.21 from the given options: a) bool b) int c)…
A: Here user is asking about datatype of given value.
Q: 4-The largest sign ( > ) is an example of the. operator a) Arithmetic , b) Logical c) Greater d)…
A: Here, > sign is given.
Q: initialize a decimal point number from user .seprate number before and after decimal.Display number…
A: #include<iostream> using namespace std; int main(){ double num; cout <<"Enter Number…
Q: (Compute 7) You can approximate 7 by using the following series: 1 1 1 1 6 x (1 + TT = + + .. . 4 9.…
A: Given:
Q: Z - Three Numbers Given two numbers K and S. Determine how many different values of X, Y and Z such…
A: Basically, two numbers ‘k’ and ‘s’ are taken as input from user. Then combinations of elements of x,…
Q: print_pattern() prints 5 characters. Call print_pattern() twice to print 10 characters. Example…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: Write a program to input three number and detemine the avg.If the average is greater than 80,then…
A: Program Approach - Use the essential header files as per program requirement. Define the main…
Q: Take input a integer 1/0 from user. Generate a random number either 0 or 1. If the number enetered…
A: Q: Take input a integer 1/0 from user. Generate a random number either 0 or 1. If the number…
Q: If A = 15 & B= 4, what will be the answer in the variable X if you execute the following formula in…
A: In the given question the value of A is given as 15 and B is given as 4. Here X is given as…
Q: program P reads the temperature from an external device. The temperature formát sup TX9 here, should…
A: Hey there, I am writing the required solution of the questin mentioned above. Please do find the…
Q: 10. Given the argument: Q> (A v M) / A>(Wv C) / M> (E v C) / ~(W v E)_// Q=C This argument is: a.…
A: Please see the next step for solution
Q: Drag and drop the appropriate statement to get the output shown below code segment Output message =…
A: To print the above output: you need stars space message space stars
Q: Question 1: Write a C program that do the following: Ask the user to enter his grade as (A, B, C, D,…
A: Include an appropriate header in the C program such as stdio.h. stdio.h is a C header file that…
Q: In a triangle, the sum of the 1st and 2nd side must always be greater than the 3rd side. Create a…
A: logic:- read three sides. Check if it is valid or not by using if first>0 && second>0…
Q: You can approximate e using the following summation: Write a program that displays the e value for i…
A: Note: Programming language is missing in the question. So we will answer this program in Java…
Q: Take an unknown number of positive integers as input. Assume that the first number is always smaller…
A: Start Take the array of elements. Find the second Smallest element in an array. Print element Stop
Q: 8. Find the output. b1 = True b2 = False %3D b3 = False %3D if b1 or b2 and b3: print ("Hello!")…
A: Find the output of the given Python code in which three boolean variables are declared and then…
Q: The powers of 2 are: 1, 2, 4, 8, 16, 32, .. . Write a program to display the first power of 2, which…
A: Here i am using C++ program.
Q: If the variable divisor is not zero, divide the variable dividend by the divisor, and store the…
A:
Q: Convert the following code into descriptive code, and verify using White Box Testing. a = 2 b = 10…
A: White box testing is software program checking out method wherein inner structure, design and coding…
Q: 2. Randomly generate an integer umber in range [100, 999]. (a) Check if this number is even or odd,…
A: Given: To write a program to generate an integer number in range[100,999] and print according to…
Q: Question 1. Simplify the following expression using tabulation method ONLY: F(A,B.C) = A'B'C + A'B'C…
A: Tabulation method: Tabulation method is also known as Quine-McCluskey method. It is used to…
Q: Suppose you are a surveyor. Your job requires you to study some maps that give distances in…
A: Below is the required C++ program: - Explanation: - Importing the essential headers and namespace.…
Q: Write C++ program to read two numbers and print multiple if the one of two numbers are multiple of…
A: Hey, since there are multiple questions posted, we will answer first question. If you want any…
Q: Q.2 Write an expression that is a 1 when one or more of its variables (A, B, C, D, and E) are 0s. Q3…
A: Note - As per the guidelines we're only allowed to answer 1 question at a time. Answer 2:If 1 or…
Q: True or False: The expression 6!0! equals 0.
A: The complete answer is given below:
Q: se C Programming You'll be asking for a random integer and then loop from 1 until that integer.…
A: Required: Use C Programming You'll be asking for a random integer and then loop from 1 until that…
Q: Given the code: int x, y; cout > x >> y; Write a few lines of code that will print all numbers that…
A: I have provided C++ program for the given definition in step 2 with its expected output.
Q: Input a range from user and print all the narcissistiC number in that range. Hint: A number is…
A: #include <stdio.h> #include<math.h> int main(){ //declaing variables int…
q2
Step by step
Solved in 2 steps
- When 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.)Consider the value of a=21 and value of b=30. a=a+b b=a+b C=a+b d=a+b+c print(c) print(d) What is answer for the statement print(c) What is answer for the statement print(d)Two question in code please do asap.
- The correct statements are: For L = 0, L* = {e} For L = {e}, L* = {e} OL+ = LL* L* = LL+Describe how conditional statements assist solve the problem in your code solution. Conditional statements must have two types.Using c++ write a program : Write a program in C++ to handle the following scenario: Three friends Asif, Shahid and Bashir start the business. Input following from user. Enter amount invested by Asif (user will enter any value) Bashir’s contribution is equal to 250% of Asif’s contribution and Shahid’s contribution is equal to 75% of Bashir’s contribution. Display amount contributed by Bashir and Shahid. After 6 months business earned profit of 50% of total investment. Display the total profit and the amount each sharer will get (i.e. distribute profit as per percentage of their investment).