1)Write program to make simple calculator? The program input two number and one character? a) print the sum of two number if the character is + b) print the sub of two number if the character is - c) print the div of two number if the character is / d) print the sum of two number if the character is *
Q: Show the value of x after each of the statements is performed: x = fabs(0.0);
A: The value of x will be: 0.0
Q: Exercise 2. Write a program that inputs three integer numbers from the keyboard and prints the sum,…
A: Step-1: Start Step-2: Declare and Input three float variables a,b,c Step-3: Calculate their sum…
Q: B// List the error (if it found) for the following program ,then correct them, rewrite the program…
A: Need to find out error in the given code Program is written to calculate value of y, where a and b…
Q: - If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of…
A: Actually, program is an executable software that runs on a computer.
Q: Find the errors in the program and rewrite the correct statements T1=int (input ("Enter T1 value=")…
A: errors :-- # in this line last closing bracket is missing T1 = int(input("Enter T1 value = ")# in…
Q: 5. Write a program in which the user enters the three angles of a quadrilateral and the program…
A: Write a program in the JAVA language in which the user enters the three angles of a quadrilateral…
Q: Find the errors in the program and rewrite the correct statements B1=int(input("Enter B1 value))…
A: Given code B1=int(input("Enter B1 value")) B2=int(input("Enter B2 value"))C=B2\B1…
Q: Find the values of aafter the following C++ statements: int a = x;…
A: Given: Find the values of a after the following C++ statements: int a = x;…
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: Qi- Write a program to print (very high) if the windspeed is more than 220, or print (high) if…
A: IF/else statement expands the if statement if / else statement if (true / false expression) is…
Q: Write a program to print the static F as shown below
A: Since programming language not mentioned using C++.
Q: Write program c++ to input a variable can accept any of the following value: A, & , B, 1, *, 3 as…
A: Sample Response: //C++ program to accept a value and prints its data type and…
Q: 04. Write a C program to check whether any year entered by the user is a leap year or not. Leap Year…
A: 1) Below is C program to check whether entered year is Leap year or not In main function of program…
Q: Read the two statements. Write A if Statement I is true and Statement II is false B if Statement I…
A: The answer is given below.
Q: Write a C program that allows the user to enter values for the width and length of a wall in feet…
A: The required C program should generate a paint calculator in the output. It needs user input for the…
Q: Let a, b, c be integer variables having values 2, 4, 5 respectively and x, y, z be float variables…
A: Given, a = 2, b = 4, c = 5, x = 1.1, y = 2.5, z = 3.6 a+b+c = 11 a%b = 2 a/b = 0 //a/b = 0.5 but…
Q: Python (Do following way) # We same a name is short if it is 3 characters or fewer. Ask the user…
A: Please find the answer below :
Q: A- Write a program to check the entered number by user whether it is postive or negative or neutral.
A: A- Give a program which takes a number and the program will print whether the number is positive,…
Q: Write a code that prints the Fibonacci series backwards. Prompt for and input two integers in the…
A: #include <stdio.h> int main() { printf("Enter two numbers in fibonacci series:"); int…
Q: Q2- You have two figures a rectangle and a circle, the circle inside the rectangle. Compute and…
A: Given data is shown below:
Q: Write the statements to print the even numbers from A to B when they are input by the user. (Assume…
A: Given: Write the statements to print the even numbers from A to B when they are input by the user.…
Q: 1. Write the program and find the error(s) for each the following statements: a. Assume: int a[5]:…
A: For both parts , I have provided C CODE and CODE SCREENSHOT WITH OUTPUT------
Q: What is the output of the code shown?['f', 't'][bool('spam')]
A: bool(' ') - If the argument passed to the bool function does not amount to zero then the Boolean…
Q: Write the input statement to get float input from the user with a prompt message as "Enter Float…
A: Given Write the input statement to get float input from the user with a prompt message as "Enter…
Q: 1- Write a v.b program that check any input number through a text box if the number is odd then…
A: Form 1: <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _Partial Class…
Q: Write statements(use Python) to read three values from the keyboard and assign each value to a…
A: Please find the answer below :
Q: 4. Write a program to find out the area of triangle when three sides a, b and c of the triangle are…
A: Program approach: Input side a, b, and c from keyboard. Calculate s. Compute area using hero's…
Q: Please code in python a.) Suppose that x and y are variable names that already refer to Boolean…
A: - We have to write expressions in python for the evaluation of conditions.
Q: Write python code that prompts the user to enter a number in the range 1 to 10 (inclusive) and…
A: The Answer is in step-2.
Q: Identify and correct the errors in each of the following statements:a) printf( "The value is %d\n",…
A: a) In printf statement %d expect integer value not its address printf( "The value is %d\n",…
Q: Q1: Write a program to ask the user to input a number then Check Whether the input Number is Even or…
A: #include <stdio.h>int main() { int n; printf("Enter an number to check: ");…
Q: 2. Write a general short program that prints the output below. You can use a maximum of 3 cout…
A: code: #include <iostream> using namespace std; int main() { for(int x = 0; x < 5; x++) {…
Q: a) Suppose a = 5. After the statement ++a; executes, the value of a is?
A: a) if a=5 then after execution of ++a value of a will be 6. ++a is called pre- incrementation, and…
Q: Find the errors in the program and rewrite the correct statements S=int(input ("Enter the value of…
A: Errors: The closing bracket is missing in line 2. Variable R and W are not defined in line 3. The…
Q: 3. Question 1 Write a program which takes two float number from the user and check, if first number…
A: Since you are not specify any language for implementation, I choose C language. Program #include…
Q: Write the JS Code for the following Programs b. Test whether the Input Number is ODD or EVEN c. Test…
A: Note: As per the guidelines can answer the first three sections. Please re-submit the question for…
Q: (d) int vara; char *ptrvar; ptrvar = vara; (e) Assume int b[ 20 ] = { 0 }, k; for ( k = 0; k <= 20;…
A: (d).
Q: (c) You are required to create a program that reads a letter of the alphabet from the user. If the…
A: Algorithm: Start Read a character ch Convert the character to Lower case If character is a/e/i/o/u,…
Q: Write the following three statements (no more than three; no fewer than three). A. Write a statement…
A: (i) double total; (ii) scanf("%lf",&total); (iii) total = total * 2;
Q: Complete the program to read the needed values from input, that the existing output statement(s) can…
A: here is Programming Language is not mentioned so I will provide answers in c++ language. Code:…
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: 2)write program that input three number and find the minimum number?
A: Actually, program is a executable software that runs on a computer.
Q: Q1: Write a c++ program to enter number and test it, if the value of the number less than 20 print "…
A: Code: #include <iostream>using namespace std;int main(){ int num;//declaring integer…
Q: (c) You are required to create a program that reads a letter of the alphabet from the user. If the…
A: We want to check if the letter input is vowel or not, for y we have added a check, and printed…
Q: Find syntax error in the following program then write line number and correct statement in the space…
A: Required:
Q: Write a program to give the example for ‘this’ operator. And also use the ‘this’ keyword as return…
A: #include <iostream> using namespace std; class Demo { private: int num; char ch; public:…
Q: Could you help me with this question. This course is Programming 1. This is the question, "A…
A: Question is asking about to calculate the total, subtotal and the sale Tax of the 5 items purchase…
Q: Write a code snippet that can arrange the alphabets of a name entered by user in alternate cases.…
A: The required C program code is: #include <stdio.h>void changeCase(char []); // function…
Step by step
Solved in 2 steps with 1 images
- 1. Use if - else - elif Write a program to get an integer input from the user. If the input is 25, get the length and breadth from the user and calculate the area of rectangle. [ Area of rectangle = length * breadth ] If the input is 40, get the side from the user and calculate the area of square. [ Area of square = side * side] If the input is 65, get the radius from the user and calculate the area of circle. [ Area of circle = 3.14"r*r] Otherwise Display Enter number 25 or 40 or 65. 2. Use while loop to print the even numbers from 100 to 50. Print the product of all the even numbers.Develop a program that1- Would read an input from the keyboard. The input should be a whole positive number.2- Then display each digit, starting with the rightmost digit.3- At last, decide if the number if divisible by 9 or not.a. Calculate and display the sum of the digits.b. Display whether the input number is divisible by 9 or not.4- Ask the user if they would want to evaluate another number. Repeat the program if the answer is yes. Abort if they’re done.Question: A country charges income tax as follows based on one's gross salary. No tax is charged on the first 20% of salary. The remaining 80% is called taxable income. Tax is paid as follows: 10% on the first $15,000 of taxable income; 20% on the next $20,000 of taxable income; 25% on all taxable income in excess of $35,000; Write a program to read a value for a person's salary and print the amount of tax to be paid in dollars. . ● . Additionalind.
- 1. Write a program that prompts the user to enter an integer between 0 and 6 and prints thie day name of the week (Sunday is 0, Monday is 1,..., and Saturday is 6). 2. Write a program that prompts the user to enter an integer and tests if it is divisible by 5 and 3, or if its divisible by 5 or 3 or if its divisible by 5 or 3 but not both.4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. // Logic errors. #include #include using namespace std; int main() { double costs double area; double bagsize; cout > bagsize; cout > cost; cout > area; cout << endl; cout << "The cost of the fertilizer per pound is: $" << bagsize / cost << endl; cout << "The cost of fertilizing per square foot is: $" << area / cost << endl; return 0; }(Modify) a. Modify the program you wrote for Exercise 7 to provide the mass of a person as an output, given his or her weight as an input to the program. Use your program to determine the mass of a person who weighs 140 lbf on Earth. b. Modify the program written for Exercise 7a to also output the person’s weight on Mars and the moon. The pull of gravity on Mars is 12.54ft/sec2=3.728m/s2,andonthemoonis5.33ft/sec2=1.625m/s2.
- (Numerical) a. Write a C++ program that accepts an integer argument and determines whether the passed integer is even or odd. (Hint: Use the % operator.) b. Enter, compile, and run the program written for Exercise 8a.1. Write a program that reads two integer numbers and determines and prints if the first is a multiple of the second. if else eiC++äälWrite program to print "OK" if the number is even and greater than 100 or the number is even and less than 1000 else print "NOT * ?"OK
- 3. The formula for determining compound interest is: A represents the amount to earn; P is the principle that is initially invested; r is the interest rate earned; n is the number of times the interest is compounded; and t is the number of time periods for the investment. Write a program that prompts the user to enter P, r, n and t. The program should output the amount earned on the investment. 4. Look up the Pythagorean theorem if you are not already familiar with it. Use the following formula to solve for c in the formula: c = √a2 + b2. Use the proper functions from the cmath header file. Be sure to output the result.la. Write a program that takes integers as arguments and adds them.b. Write a program that takes integers as arguments and multiplies them.c. Write a program that takes integers as arguments & adds & multipliesthem using the above two programs.H. WI Write a program to find average of three numbers x, y, z where x =10, y-20, and z= 30. H. W2 Write a Q. BASIC program to find the value of from the following equation: x2+2a3+sin x Y for any value of x, a, k, r. ex-kr-3