a) What is printed by the following code segment. In addition, show the intermediate result (true or false) of each ogical expression. int x = 3 , у %3 30, z = 5; if (y != 7 && x + y <= z) cout << "alpha\n"; else if (y x < 4 || z >= 4)cout <« "beta\n"; else cout « "gamma\n"; cout <« "delta\n";
Q: 12 - final question Choose the correct set of statements to set all textbox values in the Form to…
A: TextBox is an important component of Windows forms. The user can enter data into the application…
Q: Assignment 8.1b- Evaluate the following expressions. Assume that the value of x = 25, y = 10, z =…
A:
Q: PROGRAM C 1 - Explain in detail the functions of the code lines below! a) if (y) z = y <x? x / y: y…
A: (a) if(y) z = y<x ? x/y : y/x ; else z=0.0 There are 3 variables 'x',…
Q: Assume there are two variables, k and m, each already assigned a positive integer value and further…
A: python program is given below
Q: Q9:- Use (If- Then- Else) statement to write a visual basic program to read x and compute the…
A: It is defined as VB.Net is a simple, modern, object-oriented computer programming language developed…
Q: Assume the variables a = 2, b = 4, and c = 6. Circle T or F for each of the following conditions to…
A: Given: Assume the variables a = 2, b = 4, and c = 6. Circle T or F for each of the following…
Q: Given values for x, y, and z, write a single statement to calculate a value of the average of x, y,…
A: Input : Double values for the three variables: x,y,z Output : Output average of x,y,z if their…
Q: 5.) Create a flowchart to compute and display the gross pay and net pay by taking employee number,…
A: I give the flowchart , algorithm ,code in c++ along with output and code screenshot
Q: Q9: - Use (If-Then - Else) statement to write a visual basic program to read x and compute the…
A: The following is the syntax of if-then-else in Visual basic: If cond_1 Then // Statements if above…
Q: Variable n is an integer variable. Which if statement checks if the variable n contains a number…
A: Answer is option b b. if (n % 10 == 7)
Q: 2- W.P to reverse the digits order of the 4 digits number you entered? 3- W.P to read two integers…
A: Logic: use % operator to get remainder. Use / operator to remove last digit set rev=0 while(n>0)…
Q: Assume that you have price distributions as follows: (000 - 299 $), (300 – 599 $), (600 – 899 $),…
A: Program approach:- Using the necessary header file. Define the main function. Displaying STAR for…
Q: Q2:Write a single statement to find and display the sum of the successive even integers 2, 4,...,…
A: Actually, given question to display the sum of successive even integers..
Q: Q2:Write a single statement to find and display the sum of the successive even integers 2, 4,... ,…
A: Q2. a single statement to find and display the sum of the successive even integers 2,4....200
Q: int x = 135, y 38, z = 5; z = ++x - y--/ --z; evaluate the following comparison expression (within…
A: I have solved all the 3 parts and have stated whether the expression will be true or false.
Q: Assume that x is a char variable that has been declared and already given a value. Write an…
A: The relational operators in C language are the operators that are used for comparing a value with…
Q: (e) (5% - 3 minutes) Without using the variable b, write code that will set Mary's height to be 6.2.…
A: for this solution we have to just place b variable to the a.p value . whole code is written below.
Q: begin max: =|Al, i: =0, j:=0; while B do begin if A[i, j]>max then max:=A[i, j]; if c then j:=j+%3;…
A: The Answer is
Q: Q3 ) Find 16 syntax and logic errors from the given code. Write correct forms next to wrong I lines…
A: #include<stdio.h> int main() { int a,b,c printf("Enter three sides of traingle:");…
Q: It is supposed to count the number of digits (0-9) in a string, text. count =0 for char in text :…
A: In python, the string of characters is not required to declare the data types, it can be achieved…
Q: • Read from the user the number of cities (minimum 6 cities.) • For each city: city name and the…
A: given data
Q: Q3. Write an algorithm and draw a flow chart to get student level and CGPA as input and check if…
A: function main(): Start Declare student_level, cgpa Read student_level, cgpa if student_ level ==…
Q: cReate a flowchart that will arrange the value of A, B, and C in ascending order where A gets the…
A: Answer : flowchart :
Q: Write a number activity and then circle the circle or square. Input will be on form (letter I,…
A: Please refer below for your reference: Language used is C++: I am using a function called perimeter…
Q: Q4/A/Design a program to calculate the value of (H) from the equations according to the specified…
A: Since no programming language is mentioned, I am using vb.net. Code: Public Class Form1 Private…
Q: Q9:- Use (If - Then - Else) statement to write a visual basic program to read x and compute the…
A: The following is the syntax of if-then-else in Visual basic: If cond_1 Then // Statements if above…
Q: Assume that you have price distributions as follows: (000 - 299 $), (300 - 599 $), (600 - 899 $),…
A: Programs: Programs are used to provide instructions to the computer system in order to perform…
Q: 2. if statement that sets the variable fees to 50 if the flag variable max is set to true.
A: Given:
Q: Q21 ( Write a program to enter the value of three variables in TextBoxes. Find and print (the…
A: Java is the programming languages. It is the class based, object oriented that is designed in a…
Q: Q2] ( Write a program to enter the value of three variables in TextBoxes. Find and print (the…
A: Answer: Algorithms Step1: first ask to user to for given input num1,num2,num3 Step2: we have…
Q: v Details Ask the user to enter a product description as a sentence. If the user enters "end" or "…
A:
Q: Consider the following If statement, which is syntactically correct but uses poor style and…
A: Due to poor styles and indentation, the given code will be executed as per the given flowchart: From…
Q: Two points in a plane are specified using the coordinates (x1,y1) and(x2,y2). Write a program that…
A: We need to find the slope of a line through the two point which is non vertical and that point…
Q: Q9: - Use (If - Then - Else) statement to write a visual basic program to read x and compute the…
A: If cond_1 Then // Statements if above condition is true. ElseIf cond_2 Then // Statements to get…
Q: 3. Evaluate each of the following Javascript expressions and show the value. a) -9*3 b) "value is "…
A:
Q: f x = 15 and y = 5, what will be displayed after the following statements have been executed? if x…
A: Dear Student, x mod y = 15 mod 5 = 0. y/x = 15/5=3. As 15/5 >0 then x mod y < y \ x is false…
Q: Assume that you have price distributions as follows: (000 - 299 $), (300 – 599 $), (600 – 899 $),…
A: ALGORITHM:- 1. Take input for each occurences. 2. Check if the input is greater than 50. 3. Print…
Q: Q: By using select case statement write a program to find the value of (z) form the following…
A: Using switchcase stаtement сheсk the number with 0 weаther it is greаter thаn 0 оr…
Q: A carpark management charges RM2.00 fee for a car to park, for the first 3 hours. Subsequently,…
A: EXPLANATION: - A structure of car is defined as: - struct car{ int num; int hoursParked;…
Q: Greetings, i need to modify my code below: 1. Round off the bill to the nearest cent. The…
A: Q: Make necessary changes in the program
Q: Q9: - Use (If-Then-Else) statement to write a visual basic program to read x and compute the…
A: (1)First we need to read the value of 'X' from the form (2)Next we need to determine the value of X…
Q: If x = 8, what will be displayed after execution of the following statement?
A: In this question, we are asked to give the correct output of the given code when x is 8: if x >=…
Q: In the following program, rewrite the line that contains syntax error (errors) in the correct way in…
A: Task :- identify the syntax errors in the code.
Q: --s) write a program that asks the user to enter the temperature grades for the last ten days with…
A: import java.util.Scanner;public class Main{ public static void main(String[] args) { Scanner…
Q: Create a code that displays an error message when division by zero occurs using an if/ then/else…
A: The answer is given below.
Q: Write C++ to determine a student's mark. The program will read a student' average (M) and determine…
A: Here is your C++ program with an output.
Q: This code read a set of temperatures T(50), determine an average, and then calculate the deviation…
A: Answer is Option-3 i.e., 1-s=s+T(I) 2-Blank 3-A=s/50 4-For I = 1 To 50 5-Blank 6-D(I)=T(I)-A.
Q: 17. Review the code below: y = 3 if x>y: print "x is greater than y" 4 6- else x<y: 17 print "y is…
A: Here I have created 2 variables x and y and initialized them to different values. Next, I have used…
Q: Find the attached file.
A: #include <iostream>using namespace std; int main() { int x=-10; if(x>0 && x%2!=0) {…
Q: نقطة واحدة * In the following program, the variable x is #include using namespace std; int main () {…
A: Answer in step 2
C++
Step by step
Solved in 2 steps with 2 images
- Examine the following code segment. What will be printed? If there are any errors indicate the nature of the error. int a[9] = { 1, 12, 3, 14, 25, 16, 7, 8, 9 }; int *ptr ; ptr = & a[ 2 ] ; for( i = 1; i <= 5; i = i + 2) cout << a[i] << *( ptr + i ); cout << ” ” << a[0] << ” ” << *ptr << ” ” << *ptr - 1 << ” ” << *(ptr - 2));Question 5 What is the output of the following code segment? int num cin>>x; = 20, 5, X; if (x >= 2*num) y+=1; else if (x >= num) y+=2; if (x2. Write a code snippet that can arrange the alphabets of a name entered by user in alternate cases. Note: Ignore white spaces. Input String : Timothy Olyphant Output String : TiMoThY oLyPhAnT Input String : Olga Kurylenko Output String : OlGa KuRyLeNkO Use only programming language C.
- Evaluate the following expressions. (2)a. 4 * 7 == 74 / 3b. 4 + 7 / 2 <= 9 - 15 % 6f. 3.9 / 4 - 6 >= 8 - 6.2 * 1.5 3.Suppose that x, y, and z are int variables and x = 13, y = 45, and z = 20. Determine whether the following expressions evaluate to true or false. (2, 5)a. !(x - y <= 10)b. x + y > 10 || z < 15c. (x != y) && (x <= z) 4.Suppose that str1, str2, and str3 are string variables, and str1 = "Low", str2 = "High", and str3 = "Medium". Evaluate the following expressions. (2, 7)b. str1 != "low" d. str3 > "Medium" 5.Suppose that x, y, z, and w are int variables and x = 25, y = 3, z = 12, and w = 4. What is the output of the following statements? (2, 5)b. cout << "y != z - 9: " << (y != z - 9) << endl;c. cout<<"x-y==z+10:"<<(x-y==z+10)<<endl;d. cout << "!(z < w): " << !(z < w) << endl; 6.Which of the following are not relational operators? (2) b. == e. || 7.What is the output of the following…Find out the final values of a,b and c where following expressions are executed sequentially:[4]int a = 2, b =3, c;a = (b++) + (++b) + a;c = a>b ? a:b;b = (a++) + (b--) + a;c = c++*b--;The Drive-Rite Insurance Company provides automobile insurance policies for drivers. Design a flowchart or pseudocode for the following: a. A program that accepts insurance policy data, including a policy number, customer last name, customer first name, age, premium due date (month, day, and year), and number of driver accidents in the last three years. If an entered policy number is not between 1000 and 9999 inclusive, set the policy number to 0. If the month is not between 1 and 12 inclusive, or the day is not correct for the month (for example, not between 1 and 31 for January or 1 and 29 for February), set the month, day, and year to 0. Display the policy data after any revisions have been made. c. A program that continuously accepts policy holders' data until a sentinel value has been entered, and displays the data for any policy holder who is at least 18 years old. d. A program that continuously accepts policy holders' data and displays the data for any policy holder no more…
- The Drive-Rite Insurance Company provides automobile insurance policies for drivers. Design a flowchart or pseudocode for the following: a. A program that accepts insurance policy data, including a policy number, customer last name, customer first name, age, premium due date (month, day, and year), and number of driver accidents in the last three years. If an entered policy number is not between 1000 and 9999 inclusive, set the policy number to 0. If the month is not between 1 and 12 inclusive, or the day is not correct for the month (for example, not between 1 and 31 for January or 1 and 29 for February), set the month, day, and year to 0. Display the policy data after any revisions have been made. b. A program that continuously accepts policy holders' data until a sentinel value has been entered, and displays the data for any policy holder over 40 years old.What does the following code segment display? for(f=0; f<3; ++f); write ("{0} ", f); a. 0 b. nothing c. 3 d. 0 1 2Assume that you have price distributions as follows: (000 - 299 $), (300 - 599 $), (600 - 899 $), (900 $). Write a program asking the user to enter the number of occurrences of the above distribution, and represent that as STARS “*” for each occurrence in front of each distribution. Note: 1- Use printf to format each distribution automatically as you learned before. 2- If the nu ber occurrences distribution is more than 50, the program should write the word “BINGO! “.
- Indicate the value of the identifiers (c, i, f or d ) once the following line of code has completed. Indicate the result in the same format that the identifier was declared.a. c = _______ char c = 'F' - 2;b. c = ________ char c = 'J' - 'C' + 'd' ;c. i = ________ int i = 'F' - 'B';d. f = ________ float f = 19 / 4.0;e. f = ________ float f = (19 / 4) + 0.5;PLEASE USE C++ AND CORRECT THE CODE ERROR USING YELLOW HIGHLIGHTED ERRORS IN ATTACHED PHOTO Program Specifications: Write a program to calculate U.S. income tax owed given wages, taxable interest, unemployment compensation, status (single or married), and taxes withheld. Taxpayers are only allowed to use this short form if adjusted gross income (AGI) is less than $120000. Dollar amounts are displayed as integers with no comma separators. For example, cout << "Deduction: $" << deductionNote: this program is designed for incremental development. Complete each step and submit it for grading before starting the next step. Only a portion of tests pass after each step but confirm progress.Step 1. Input wages, taxable interest, unemployment compensation, status (1=single and 2=married), and taxes withheld as integers. Calculate and output AGI (wages + interest + unemployment). Output error message if AGI is above $120000 and the program stops with no additional output. Submit for…what is the output of the following code segment? int x = 350; int y = 0; do { y +=x 0; X = x/10; } while (x!=0); cout<