PROBLEM 5: Using if-else /Nested if-else if structure, write a complete program a.) that will determine which among the 3 numbers entered from the keyboard is largest and which is the smallest. b.) that will also determine and print the final grade equivalent of the average g entered from the keyboard. The equivalent grade will be based on the Tab Transmutation of Grades shown below: Final Grade Average Below 50 5.0 Sample Input/Output: 50 to 60 3.0 Enter 3 numbers: 5 8 3 Largest = 8 Enter the Average Grade: 75 Final Grade = 2.0 61 to 80 2.0 Smallest = 3 81 to 90 1.5 91 to 100 1.0 (NNoto filo
Q: The is a one C++ statement to Declare the Boolean identifiers ON and OFF and set the initial value…
A: 1) option 1: bool ON = true; bool OFF = false; this is not a single statement these are two…
Q: (Electrical eng.) The electrical resistance, r, of a metal wire, in ohms, is given by this formula:…
A: a. The resistance of the wire needs to be calculated. Hence, there will be only one output i.e., the…
Q: PROBLEM 2: Using user defined function and appropriate conditional and looping statements, create a…
A: The program is written in C++. Please find the source code in the below steps.
Q: if-else Statements Consider the following if-else statements. Determine the output of the given…
A: Given snippet: int a = 2, b = 9; if (b % a == 0) cout << b << "is even"; else cout…
Q: Q1/ Use the structure Time to write a C++ program that inputs a time in hours, minutes and seconds…
A: #include<iostream> using namespace std; //Time Structure struct Time { int h,m,s; };…
Q: To add a value 1 to variable x, identify any two correct statements a) 1
A: Statement X += 1 if we simply this statement we get x = x+1 so by this resulting statement we can…
Q: Problem 3: Using conditional operators, write a program to compute and print the 2 values of x in…
A: Create variables find the discriminant using the formula: discriminant = b * b - 4 * a * c; than…
Q: Type two statements. The first reads user input into person_name. The second reads user input into…
A: Here, Code instructions are given.
Q: Create a program using c++ compliler that will do the following: (Solution should be a combination…
A: #include <iostream> #include<iomanip> using namespace std; int main() { int option;…
Q: Part1: • Write a program that presents to the users a choice of your 4 favorite beverages (Water,…
A: Here in this question we will be writing program which will simply ask user to enter his choice for…
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: if-else-if statement Problem 3. Given two numbers X and Y. Write a program to determine the…
A: As per guidelines, we have to give solution only one problem at a time and I'll give solution for…
Q: Using switch statement, write program c++ that displays the following menu for the food items…
A: Algorithm Start Char c, int q Accept dish from user Accept quantity from user Calculate total price…
Q: sn_ ai i=1 Where a={a1,a2,a3,...an} п Write a C++ program to solve the equation above.
A: C++ Program for above : #include <iostream> using namespace std; int main() { //get…
Q: SUBJECT:C PROGRAMMING QUESTION: Draw the flowchart then write the C program using else if. The…
A:
Q: If AL=55 , BL=AA Find the result of the following program AND AL,BL OR AL,BL XOR AL,BL
A: Given that, AL = 55H BL = AAH Find the result of AND AL, BL OR AL, BL XOR AL, BL
Q: Design C program using conditional if and else, for statements, if choice is 1, find the factorial…
A: I have provided C CODE along with CODE SCREENSHOT and TWO OUTPUT SCREENSHOTS-----------
Q: Q2 Figure 2.0(a) shows a complete C codes to calculate the volume of a bottle with different upper…
A: C code to calculate the volume of the bottle whos upper and lower diameter are different
Q: Write a C progam in CodeBlocks to find the largest among three different numbers entered by the…
A: Flowchart
Q: The answer should be in c++ programming Councils on the Copperbelt have established parking lots…
A: The input consists of a starting and ending time. The output should be a statement to the customer…
Q: Write a program that will find factorial of a number inputted by the user. Limit the user input of…
A: Introduction: Here we are asked to create a program that will display the factorial of that number,…
Q: Using switch statement, write program c++ that displays the following menu for the food items…
A: Program Approach:- Use one header file Declare 3 variable of type integer Use switch case for the…
Q: In a triangle, the sum of the 1st and 2nd side must always be greater than the 3rd side. Create a…
A: Algorithm: for (initialExpression; testExpression; updateExpression){ // body of the…
Q: Using C++, write a program that will check the employees years in service and office. The user will…
A: Given: Using C++, write a program that will check the employees years in service and office. The…
Q: The table below shows the AZA Travel Tour ticketing price: Package b) c) d) Istanbul Beijing Tokyo…
A: Step 1: Start Step 2: take input of package code Step 3: validate package code if valid continue…
Q: If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of…
A: CODE:- #include <iostream>using namespace std;void check(int numYears){ if (numYears >…
Q: Write C++ statement(s) to accomplish each of the following tasks: (i) Declare 2 integer variables, x…
A: C++is an operating system which is an open source. It is a software which helps in managing the…
Q: Q5.Write C++ program to compute and display a person's weekly salary as determined by the following…
A: Objective: A program should be written to calculate a person's weekly salary when the number of…
Q: if-else-if statement Problem 3. Given two numbers X and Y. Write a program to determine the…
A: logic:- read x and y if x-y<0 then R=x+y else if x-y==0 then R=2*x+2*y else R=x*y display x,y…
Q: A golf ball is dropped from an airplane. The distance, d, the ball falls in t seconds is given by…
A: totDistance = 0.5*Gravity*time*time; distance = totDistance - distance;
Q: Create a C++ program that will accept three inputs - the coefficients 'a, b, and c' of a quadratic…
A: This question comes from Programming Language which is a paper of Computer Engineering. Let's…
Q: The price of a stock is sometimes, taken to the nearest fourth of a rupee, for example, the value 29…
A: Note: This code should be rewritten instead of copying to the compiler otherwise it will throw a…
Q: 3. Convert the following code into descriptive code, and verify using White Box Testing. a = 2 b =…
A: According to the information given:- we have to convert following code into descriptive code and…
Q: 2. Write a C program to accept the radius of pizza as input by the user. Calculate the price of the…
A: Step-1: StartStep-2: Declare two variables radius, priceStep-3: Take input for radiusStep-4:…
Q: Exercise 1: Write a program using if-else statement which receive the branch code as input and print…
A: Please find the answer below :
Q: The program below a needs `else` clauses for the conditions in lines 22 and 23. ( not using Boolean…
A: An if-else construct provides a way to specify a condition so that only when the condition is true,…
Q: Problem 5 Using if -else /Nested if- else if structure, write a complete program a.) that will…
A: 1) read three numbers 2) compare three numbers using if else , and determine maximum and minimum…
Q: Write C++ program to compute and display a person’s weekly salary as determined by the following…
A: #include <iostream>using namespace std;int main(int argc, char const *argv[]){ int workHours;…
Q: If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of…
A: PROGRAM CODE: #include <iostream> // include header file for input output streamusing…
Q: The table below shows the AZA Travel Tour ticketing price: Package Istanbul Beijing Tokyo Package…
A: This C++ program has three classes to store details of three different packages.
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: Given a number in the range of 100 and 999, write a program to accept input and validate this range.…
A: Note: we are only allowed to solve one question in one post. I am solving the first on here. To get…
Q: utput all combinations of character variables a, b, and c, in the order shown below. If a = 'x', b =…
A: Required: Output all combinations of character variables a, b, and c. Required code with comments…
Q: Q/1 If y = (12–x) where x is from (1-10) write a 2х-5 Fortran program to print negative values of y…
A: program main implicit none real :: y !declaring variables real :: x ! looping…
Q: This progran will output a parallelogram. How long do you want each side to be? 5 Please enter the…
A: 1. Implementation of the repeatChar(numRepeats, outputChar) method: def repeatChar(numRepeats,…
Q: if-else-if statement Problem 3. Given two numbers X and Y. Write a program to determine the…
A: Program plan: Read 2 numbers X and Y from the user. Evaluate the difference between the numbers If…
Q: ANSWER IN C++ WRITE A PROGRAM TO CALCULATRE THE AREA OF A RECTANGLE OF LENGTH =5 CM AND…
A: Programming in C++: C++ provides many features, standard libraries, rules to solve problems through…
Step by step
Solved in 3 steps with 1 images
- Modified coin-row problem:If we modified the coin-row problem, so that you cannot take the adjacent coin, and youcannot take the coin next to the adjacent coin also (see example below), what would thedynamic programming formula F(n) be?Example: A, B, C, D, E, F, G, H, I, JIf A is taken, then B & C cannot be taken, but D (or above D, like E and so on) can be taken.If B is taken, then A, C, D cannot be taken.And so on.If statements a. Always have a then section which evaluates if true b. can skip the else segment c. cannot call functions within the condition or the segments d. a & b e. a & b & c2a - Determine the weakest precondition for the following sequence of expressions. Pleaseprovide all your work including calculations, logic implications if any applies, and final answer.(10 points){ ? } a = 4 * (3 * b - a); b = 4 * a - 6; { b > 10 }2b - Determine the strongest precondition for the following if-else statement. Please provide allyour work including calculations, logic implications if any applies, and final answer. (15 points){ ? } if (x > y) then y = 2 * x - 1 else y = 3 * x + 1; {y>7}
- Here's my C++ programming coding assignment for 4-11: Instructions Write a program that implements the algorithm given in Example 1 - 3 (Chapter 1), which determines the monthly wages of a salesperson. The instructions for Example 1 - 3 have been posted below for your convenience.Example 1 - 3 Every salesperson has a base salary. The salesperson also receives a bonus at the end of each month, based on the following criteria: If the salesperson has been with the store for five years or less, the bonus is $10 for each year that he or she has worked there. If the salesperson has been with the store for more than five years, the bonus is $20 for each year that he or she has worked there. The salesperson can earn an additional bonus as follows: If the total sales made by the salesperson for the month are at least $5,000 but less than $10,000, he or she receives a 3% commission on the sale. If the total sales made by the salesperson for the month are at least $10,000, he or she receives a 6%…I need help writing a Boolean expression that is true if and only if a student is a senior who is majoring in either Information Technology or Computer Science and has a GPA of at least 3.5 but not higher than 3.85. Assume that the student’s year in school is stored in the variable year, the student’s major is stored in the variable major, and the student's GPA is stored in the variable gpa. Use parentheses to indicate clearly the order in which the operations should be evaluated.Q14/ If money is left in a particular bank for more than 5 years, the bank pays interest at a rate of 4.5% of the money; otherwise, the interest rate is 3.0% of the money. Write a program in c++ to accept the number of years in the variable numYears and money in the variable money then display the correct interest rate, depending on the value input into numYears by using functions.
- a. Without using any other library functions oroperators, show how the meaning of the following pattern matchingdefinition for logical conjunction "&&" can be expressed usingconditional (if/else) expressions: True && True = True _ && _ = False Hint: use two nested conditional expressions. b. Do the same for the following alternative definition: True && b = b False && _ = False Hint: note the difference in the number of conditional expressionsthat are required this time (fewer are be needed).First program Create a program that calculates the derivative for any polynomial entered by a user and the user receives all the derivatives until it reaches zero. The program will work for any polynomial with the variable x. Ensure that your program provides the user the result in a complete sentence.Rm1 =100 sen The domestic tariff charged by Sabah Electricity Sdn Bhd (SESB) is given in Table 1. Based on the tariff, write a C++ program that can do the following questions. Give me the most basic solutions
- In C++ 1. Declare, define, and test the following function to check for order by name:bool isSortedByName(const Student * sa, int size);2. Declare, define, and test the following function to check for order by ID:bool isSortedById(const Student * sa, int size);3. To print out a Boolean value as true or false, rather than 1 or 0, precede each with boolalpha:cout << "True is " << boolalpha << true << ", False is " << boolalpha << false <<endl;C++ Programming Exercise: A real estate office handles, say, 50 apartment units. When the rent is, say, $600 per month, all the units are occupied. However, for each, say, $40 increase in rent, one unit becomes vacant. Moreover, each occupied unit requires an average of $27 per month for maintenance. How many units should be rented to maximize the profit? Write a program that prompts the user to enter: a. The total number of of units. b. The rent to occupy all the units. c. The increase in rent that results in a vacant unit. d. Amount to maintain a rented unit. The program then outputs the number of units to be rented to maximize the profit.If the statements p and q are both true while statement r is false. which of the following has a false truth value?* a. If r then (p or q). b. Not (r and (not p or q)). c. (p or r) if and only if not q. d. If not (r and q) then p.