Write an if statement that assigns 0.2 to commission if sales is greater than or equal to 10000. In C++
Q: Explain how the if statement checks the input. Your code is if(!(commodity_code=='A'||…
A: If statement: If statement is used in programming in language to check a specific condition for a…
Q: 0 When you write an If-Then-Else statement, under what circumstances do the statementsthat appear…
A: The syntax of if then else statement is if(condition) { //statement to be executed } Then else {…
Q: What are differences between switch statement and if-else if statement control
A: Note: There are multiple questions are given in one question. According to the rule, you will get…
Q: Write a C++ statement that declares a named constant PI of double type with a value of 3.14.
A: Constant variable means those variable whose value initialised once cannot be changed anywhere…
Q: Write an if statement that assigns 0.4 to commission if sales is greater than or equal to 10000. In…
A: Write an if statement that assigns 0.4 to commission if sales is greater than or equal to 10000.…
Q: Chargeable Income (RM) Calculation (RM) Rate '% tax(rm) 0 — 5,000 On the First 5,000 0 0…
A: Introduction of the Program: The C program takes a user name and user's chargeable income from the…
Q: Write an if statement that increases pay by 3% if score is greater than 90, otherwise increases pay…
A: if(condition){ statement; ...}else{ statements; ...}
Q: Write a program in C++ using if statement that assigns 100 to x when y is equal to 0.
A: Here, we are going to write a C++ program using if statement that assigns 100 to x when y is equal…
Q: Using C++ program 1. ( Use if-else statement ) Write a program for asking for a quiz score. The…
A: C++ program to solve the given problem is below.
Q: In C++ program Kindly convert the structure of the program from "if else if" statement to "switch"…
A: I have provided C++ CODE along with OUTPUT SCREENSHOT----------------
Q: If money is left in a particular bank for more than 5 years, the bank pays interest at a rate 4.5%;…
A: PROGRAM CODE: #include <iostream> using namespace std; int main(){ int numYears,money;…
Q: what is if statement ?
A: If statement in programming langauge is used as condition statement it perform operations whenever…
Q: Using C++ programming language: 01. Write a simple if statement that multiplies the variable num1…
A: As per company rules we are only supposed to answer only one question kindly post another question…
Q: ACE balloon shop sells balloons to customers at 10 Fils cach. If the customer buys 500-1000…
A: Please find the answer below :
Q: Write a program in c++ to prompt user to enter the salary and incentive.Company decides to deduct…
A: Program Approach - Use the header files and define the main function Declare the variables as per…
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: S = 2 s == /2wz(v3 + 1)
A: Given statement:
Q: Write a C++ program. A software company sells a package that retails for $109. Quantity discounts…
A: To write a C++ program using the if/else if/else statement that asks for the number of units sold…
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: Convert the following if-else-if statement into a switch statement
A: Step 1:- Given:- if(choice==1) { System.out.println("Its a 1."); } else if(choice==2 II choice==3)…
Q: Write test programs in C# to determine the scope of a variable declared in a for statement.…
A: The C# for loop is used to iterate a part of the program several times. If the number of iteration…
Q: Questlon Two: Write a C+ program to calculate the average of five student grades, then print "A+" if…
A: Output 1: Output 2: Output 3: Output 4:
Q: In C++ (Find the number of days in a month) Write a program that prompts the user to enter the…
A: Answer: This is my answer: But the complier reported: 1. Compiler error : fatal error 2. #include 3.…
Q: Use a cout statement to print out a sentence containing your plans for the holiday break. Keep it…
A: Solution :
Q: 2. Write an if statement that assigns 0.2 to commission if sales is greater than or equal to 10000.…
A: syntax of if if(condition) { statements; }
Q: Q4\A) Use (switch statement) to write a program in C++ to show company structure. If the enter is…
A: Q4) A) Code in c++: #include <iostream> using namespace std; int main() { char oper;…
Q: In C, the condition that will give a true statement when a number x is in the range of is 0 10 O x>0…
A:
Q: ACE balloon shop sells balloons to customers at 10 Fils each. If the customer buys 500-1000…
A: As per the requirement program is completed in c++. Algorithm: Step 1: Write the main() method Step…
Q: Write an if statement that assigns 0.3 to commission if sales is greater than or equal to 10000.…
A: Please find the answer below :
Q: Explain how the if statement checks the input. Your code is if(!(commodity_code=='A'||…
A: When the condition is true the statements in the if block is executed.
Q: an if statement that assigns 1 to x if y is greater than 0.
A: An if statement that assigns 1 to x if y is greater than 0
Q: A management firm has 100 employees in total. The management firm increases the salary of the…
A: I have provided C++ CODE along with SCREENSHOT OF CODE WITH OUTPUT---------
Q: Write a C++ statement that defines the int variables months, days, and years all in the same…
A: C++ statement that defines the int variables months, days, and years all in the same statement, with…
Q: In C++ Write a cout statement to print out your favorite food.
A: Here in this question we have asked to write a c++ statement that print your favorite food.
Q: Q1: Write a C++ program to enter month number then print month name using: 1) Nested if-else…
A: required:
Q: python programming 3 Write an if/else statement that assigns True to fever if temperature is…
A: if temperature > 98.6 : print("True to Fever") else: print(("False to Fever")
Q: a. Write C11 statements that output First Year if the standing is 'F', Sophomore if the standing is…
A: if (standing == 'F') printf ("First Year"); else if (standing == 'S') printf…
Q: Discuss the difference between conditional operator and if/else statement. Explain the difference by…
A: The conditional operator(ternary operator) and if/else statements both are used to check the…
Q: A. Write C ++ statements that output First Year if the standing is 'F', Sophomore if the standing is…
A: A. C++ code #include <iostream> using namespace std; int main() { char choice; cout…
Q: 10. Salary/Income Calculator Write a C program that computes an employee's monthly salary and…
A: C is a versatile middle-level programming language that can be used for a variety of tasks. It can…
Q: 1. Write an if statement that assigns 0 to x if y is equal to 20. 2. Write an if statement…
A: 1) if statement is one of the most commonly used conditional statements in programming languages.…
Q: turbo c++ program of You have a choice of 2 different auto mechanics with different rate…
A: As you have mentioned C++ program of the question, only program is written. The program is written…
Q: C PROGRAM 1. Rewrite this code so that it will use a single if-statement only if ( x 10 ) {…
A: Given Question: 1. Rewrite this code in such a way that it only has one if-statement. 2. Rewrite…
Q: a) Rewrite the following code segment in C++ switch statement: if (grade >='A' && grade <= 'C') cout…
A: code snippet:
Q: 1. Write an if statement that assigns 0 to p if q is equal to 30. In C++ programming language.
A: Write an if statement that assigns 0 to p if q is equal to 30. In C++ programming language. Syntax…
Q: HOMEWORK-3 Q1: Write a C++ program to enter month number then print month name using: 1) Nested…
A: #include <iostream> using namespace std; int main(){ int month_number;…
Q: Can you rewrite the following C++ code using the Switch statement instead of the If statement? int…
A: Here, I have to choose an option for the above question.
Q: Write a C++ statement that defines the double variables temp, weight, and height all in the same…
A: With the comma-separated list of variables, C++ can define the double variables temp, weight, and…
2. Write an if statement that assigns 0.2 to commission if sales is greater than or equal to 10000.
In C++
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
- 3 points Save Answer 1. Write C++ statement(s) to check If the difference between volt 1 and volt 2 is larger than 10.0, print the values of volt 1, if volt 2 is larger than 20 then print volt 2 otherwise print volt 1.Write a C++ switch statement which assigns the life expectancy of a light bulb based on its wattage. Use integer variables life and wattage. Use the values in this table. (assign 0 to the life expectancy if the wattage is not in this table) Wattage Life expectancy 25 2500 60 1000 75 7501. Write an if statement that assigns 0 to p if q is equal to 30. In C++ programming language.
- Internet Service provider An Internet service provider has three different subscription packages for its customers: Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour. Package B: For $13.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour. Package C: For $19.95 per month unlimited access is provided. Write a program using c++ that calculates a customer's monthly bill. It should ask the user to enter the letter of the package the customer has purchased (A, B, or C) and the number of hours that were used. It should then display the total charges.Test Content Question 1 Write a C++ program that inputs the price of a shoe in a shop, then deducts the discount from the price of the shoe as follows: 20% discount if the price of the shoe is above or equal 40 BD. 10% discount if the price of the shoe is more than or equal 15 BD and less than 40 BD. 5% discount if the price of the shoe is more than or equal 7 BD and less than 15 BD. 0% discount if the price of the shoe is below 7 BD. Then, your program should output: The initial shoe price, the discount amount and the final shoe price after discount. All numbers should be displayed with 2 decimal places. Use the editor to format your answerA salon offers coupons to its customers time to time. Without coupons adult haircut is 15.50 and the child haircut is 10.50. Coupons that this salon offers are color coded. The following table shows the color code and discount information Color code Green (code # 1) Blue (code # 2) Discount 3.50 from adult, 2.50 from kids 2.59 from adult, 1.50 from kids Write a C++ program that asks the user to enter the coupon color and the haircut type (adult, kid) and then determine the haircut charge. It is possible that a customers may not have a coupon, in that case, no discount will be offered. You can assume that green, blue colors are represented using 1 and 2 respectively. Write the program so it will generate the output as shown in the sample runs below where user input is in bold. Sample Run 1 Enter coupon color (0 = no coupon, 1 = green, 2 = blue): 1 Enter the type of haircut (a= adult or k = kid): a The charge is 12.00 Sample Run 2 Enter coupon color (0= no coupon, 1 = green, 2 = blue): 0…
- C ++ Code Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For single people, the standard exemption is $4,000; for married people, the standard exemption is $7,000. A person can also put up to 6% of his or her gross income in a pension plan. The tax rates are as follows: If the taxable income is: Between $0 and $15,000, the tax rate is 15%. Between $15,001 and $40,000, the tax is $2,250 plus 25% of the taxable income over $15,000. Over $40,000, the tax is $8,460 plus 35% of the taxable income over $40,000. Prompt the user to enter the following information: Marital status If the marital status is “married,” ask for the number of children under the age of 14 Gross salary (If the marital status is “married” and both spouses have income, enter the combined salary.) Percentage of gross income contributed to a pension fund Your program must consist of at least the following functions: Function getData: This function asks the user to enter…Q3:-Write a program in C++ that finds The following equation (Note : Taking into consideration the priority) Z-pr % q + w/x - y* zWrite one or more C++ statements that assign the correct value to discount, using the logic described here: Assign .20 to discount if dept equals 5 and price is $100 or more. Assign .15 to discount if dept is anything else and price is $100 or more. Assign .10 to discount if dept equals 5 and price is less than $100. Assign .05 to discount if dept is anything else and price is less than $100.
- Using c++ Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an inpatient or an outpatient. If the patient was an inpatient, the following data should be entered: The number of days spent in the hospital The daily rate Charges for hospital services (lab tests, etc.) Hospital medication charges If the patient was an outpatient, the following data should be entered: Charges for hospital services (lab tests, etc.) Hospital medication charges Use a single, separate function to validate that no input is less than zero. If it is, it should be reentered before being returned. Once the required data has been input and validated, the program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the inpatient data, while the other function accepts arguments for outpatient data. Both functions should return the total charges3. Write an if statement that assigns 0.4 to commission if sales is greater than or equal to 10000. In C++ language.C++ Write a program that asks for the starting time and the number of minutes of the call, and displays the charges. The program should ask for the time to be entered as a floating-point number in the form HH.MM. For example, 07:00 hours will be entered as 07.00, and 16:28 hours will be entered as 16.28. Input Validation The program should not accept times that are greater than 23:59. Also, no number whose last two digits are greater than 59 should be accepted. Hint: Assuming num is a floating-point variable, the following expression will give you its fractional part: num – static_cast<int>(num);