Give two examples of semantic errors in a program, using the language of your choice.
Q: C++ 3.What is the output of the following program (when embedded in a complete program)? int i,…
A: This question comes from Programming Language which is a paper of Computer Science. Let's discuss it…
Q: Examine the following code segment. What will be printed? If there are any errors indicate the…
A: Errors in program: Variable “i” which is used for loop traversing is not declared. This error is…
Q: 2B. Given x=3 and y=6, what is the value of z after the expression z=x*y==18 is executed?
A: Note: There are multiple questions are given in one question. According to the rule, you will get…
Q: 11. Write a Python program to find the area of a triangle having side lengths equal to 5, 6, and †…
A: Write a Python program to find the area of a triangle having side lengths equal to 5, 6, and 7…
Q: 2. Write a JAVASCRIPT program to print natural numbers from 1 to 100 in the output and print only 5…
A: Write a JAVASCRIPT program to print natural numbers from 1 to 100 in the output and print only 5…
Q: 2. Write a program to print the Result of Final exam of 25 students in a class. Accept the name and…
A: INTRODUCTION: Here we need to create a flowchart of the result of the final exam of 25 students in a…
Q: 49- Find the output of the following program. main(){ int a = 10, b, c; = a++; %3D C = a; %3D cout…
A: The correct option is option 3rd that is 11 10 11
Q: 1. Count the number of per character in a given sentence/paragraph. (“Hello World!” H-1, e-1, l-3,…
A: 1) import java.util.Scanner;import java.util.HashMap;import java.util.Set;public class A{ public…
Q: QUESTION 23 Given int *ptr, x[6]={11, 238, 4, -70, 9, -53); What the following statement does?…
A: The given code: *(x+3)=12
Q: 9. In the right triangle shown a = 17 cm and c = 50 cm. Define a and c as variables, and then: a)…
A: $ awk '{print "side:",$1,"side:",$2,"hypotenuse:",sqrt($1^2+$2^2)}'$1 and $2 are the input fields,…
Q: 11. Find the value of A[1] after execution of the following program. int[] A = {0,2,4,1,3}; for(int…
A: The answer is
Q: 1.Write a program that outputs the following text on screen: what a happy day! Oh what a happy day!…
A: Actually, program is a executable software that runs on computer.
Q: Write a program that will calculate and print out bills for the city water company. The water rates…
A: Note: Programming language is missing in the question. So we will answer this program in C++. If you…
Q: 9. Write a program that inputs two real numbers then exchanges their values. 10. Make a program that…
A: 9 Solution
Q: 16.Write a Java Applet program to display sum of two numbers. The numbers must be passed as…
A: An applet is a Java program that runs in a Web program.. Applets are intended to be implanted inside…
Q: 21. Consider the following set of statements. If x>y goto L5 ... L5: goto L7 Identify the set of…
A: According to question, ================================== Given : if x>y then goto loop number…
Q: Showoutput without execution of following statements: i) int A; A = (15-32)*5 > (15+5)*3;…
A: Logical operators : The > , >=, < and <= are called as logical operators. The logical…
Q: 23 ___ 2 == 5 Which operator would make this expression true?
A: 23 can be written as 00010111. The Right Shift Operator shifts the bits of the number towards right…
Q: Write a program whose input is a word or phrase, and that outputs whether the input is a palindrome.
A: 1. Input the string 2. Remove spaces from the input string 3. Reverse the string 4. If the reversed…
Q: Find the output of the given program snippet. void main() { int a[5] = {5, 1, 15, 20, 25}; int i, j,…
A: Output of this program is :- 3 , 2 , 15 Explaination is given in step 2
Q: int [] X = {12,15,12}; int [] Y = {1,2,3}; int i=0; for(int a:X) { if(a%2==1) { Y[i]=a; i++; } %3D
A: In the above question, we have to print the output of the given program. In this there are two…
Q: 23. Write a JavaScript function to print the correct answer on the screen. Is today Tuesday? YES…
A: According to the Question below the solution: Output:
Q: 49- Find the output of the following program. * main(){ int a = 10, b, c; b = a++; C = a; cout << a…
A: The given code is - main(){ int a = 10, b, c; b = a++; c = a; cout << a << "…
Q: Q6: Write a program to find and print the value of (f) from the following equations for Fourteen…
A: Introduction:- Below is the complete solution with explanation for the given question in detail.…
Q: int [] X = {12,15,12}; int [] Y = {1,2,3}; int i=0; for (int a:X) { if(a%2==1) { Y[i]=a; i++; %D…
A: Explanation : initially i = 0, Y = { 1, 2, 3 } Now, iterating each element of x which is { 12,…
Q: Q3 Let U = {5, 6 }, write an equivalent to the following assertions: 3x P ( x ) v - Vx Q ( x )
A: The answer is below:
Q: Q1. Write a java program to prompt the user to enter array of usernames then print them. Usernames=…
A: Steps to write the program: 1. First make the object for the scanner class. 2. Prompt the user to…
Q: 50- Find the output of the following program. main(){ int a, b 10; %3D a 95 / 10; %3D cout << a <<…
A: Ans: The output of the following program is : main(){ int a, b=10; cout<< a << endl; }
Q: 7. Write a JavaScript program to show how to convert a decimal number to Hex using inbuilt…
A: Write a JavaScript program to show how to convert a decimal number to Hex using inbuilt JavaScript…
Q: 2B. Given x=3 and y=6, what is the value of z after the expression z=x*y=%=18 is executed?
A: Note: There are multiple questions are given in one question. According to the rule, you will get…
Q: 13. Write a program that lets the user play Rock-Paper-Scissors against the computer. There should…
A: Since no programming language is mentioned, I am using python Algorithm: Start Read input from user…
Q: public class Turn{public static void main(String[] args){// Different initial values will be used…
A: Equations that are used to replace the value of variable x and y: - The initial values of the…
Q: 43) Review the given program below and answer the questions that follows. Vinclude int i, j; int…
A: answers:- 4.3 (a) the program is giving the sum of the first n natural numbers. example:- 3 is…
Q: What is the value stored in X[4] after the following code segment is executed? int X[5] (5, 13, 20,…
A: #include <stdio.h> int main() { int x[5]={5,13,20,9,7}; int i=1; do {…
Q: 1. Write a program to compute and display the perimeter (P) and the area (A) of an ellipse. The…
A: ALGORITHM:- 1. Take input for a & b from user. 2. Calculate area and perimeter using that. 3.…
Q: 50- Find the output of the following program. main(){ int a, b = 10; a = 95 / 10; cout << a << endl;…
A: Given data: 50: main() { int a, b = 10; a = 95 / 10; cout << a << endl;} 2:…
Q: 51. Consider a game in which a player flips a fair coin three times. If all three coin flips have…
A: Hello student, hope you are doing well. The answer to the given question is attached below along…
Q: 50- Find the output of the following program. main(){ int a, b 10; a = 95 / 10; cout << a <« endl; }…
A: Main() { Int a,b=10; a=95/10; Cout<<a<<endl }
Q: (b) Consider the following code fragments: If a = 10; Evaluate the new value of “b” in the…
A: Value of the variable Given in the code fragment, the value of a is 10. Hence for the first…
Q: Consider the case of a Python program that does not work as expected because it displays the name of…
A: The above program gives output which is not correct and program executes successfully
Q: 2. Let x be the first three digits of your matric number, AND y be the last three digits of your…
A: I am considering the matric number as 2210039 Now x = 221 and y - 039 we change 0 in y as 2 so, x =…
Q: 4.2 Write a JAVA program to read input two integer values x,y and print the absolute difference in…
A: Here have to determine about the print difference between cube of numbers problem statement.
Q: 5.14 For each of the following sets of integers, write a single statement that will print a number…
A: a) Program code: //import required data package import java.util.Random; //main class public…
Q: Consider the following single-quoted string literal: 'baby robot' What is the character at index 1?
A: here in this question we have given a string s='baby robot' and we have to find out what would the…
Q: 2.4 On paper, write a program that will display your name on the first line, your street address on…
A: here in this question we have asked to write a program which display your name on the first line,…
Q: 1. Examine the following code segment. What will be printed?If there are any errors indicate the…
A: The given C++ code segment is: int a[8] ={16, 12, 10, 7, 15, 18, 17, 29}; int *ptr ; ptr = & a[…
Q: QUESTION 13 Consider the following code: "Exameasy!" y = S. split('a') print (y) S %3D What is the…
A:
Q: 3. Write a JavaScript function to calculate the circumference of the circle, note that pi=3.14 and…
A: Actually, JavaScript is a programming language for the web.
1.19 Give two examples of semantic errors in a
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 1 images
- 4.17 In Python, Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Quit", "quit", or "q" for the line of text. Ex: If the input is: Hello there Hey quit then the output is: ereht olleH yeH1. Write a Python regex pattern that matches a valid email address, assuming that an email address consists of a username, followed by the "@" symbol, followed by a domain name, which in turn consists of one or more subdomains separated by dots, and ending with a top-level domain (e.g., .com, .org, .edu, etc.). 2. Using the re.findall() function in Python, write a Python code snippet that takes the text string and the regex pattern from Q4 and returns a list of all the email addresses found in the string. 3. Suppose you want to modify the regex pattern from Q4 to also match email addresses that contain hyphens ("-") in the username and/or domain name. What changes would you make to the pattern, and why? 4. Using the modified regex pattern from Q6, write a Python code snippet that takes the text string and the modified regex pattern, and returns a list of all the email addresses found in the string. Note: You can assume that the text string contains valid email addresses separated by…5.23 In Python: Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Ex: If the input is: 0 or less, the output is: no change Ex: If the input is: 45 the output is: 1 quarter 2 dimes Your program must define and call the following function. The function exact_change() should return num_dollars, num_quarters, num_dimes, num_nickels, and num_pennies.def exact_change(user_total)
- C++ 3.What is the output of the following program (when embedded in a complete program)? int i, temp[10]; for (i = 0; i < 10; i++) temp[i] = i*2; for (i = 0; i<10; i = i +2) cout << temp[i] << " ";Q.3) write Java program that will draw horizontal line using the symbol * which consist of 12 stars just like the figure below: ************1. Provide a value we could put in the blank so that the value of x will be 7 after the code snippet. int x = _____;x = x % 15; A) 22 B) 15 C) 27 D) 8
- 3.19 In Java Write a program with total change amount in pennies as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies. Ex: If the input is: 0 the output is: No change Ex: If the input is: 45 the output is: 1 Quarter 2 DimesAssume int[][] x = {{1, 2}, {3, 4}, {5, 6}}, what are x.length are x[0].length? 5 3 and 2 4 2 and 1 3 2 and 3 2 2 and 2 1 3 and 335- Consider the following single-quoted string literal: 'baby robot' What is the character at index 1? a. 'o' b. 'b' c. 't' d. 'a' e. '' (blank)
- Q.3) write Java program that will draw horizontal line using the symbol & which consist of 7 and just like the figure below: & & & & & & &Make a program that prints the table of contents of a book where each chapter has the same number of sections, and each section has the same number of subsections. Example: Please enter the number of chapters 3Please enter the number of sections 3Please enter the number of subsections 3Chapter 1-Section 1.1--Subsection 1.1.1--Subsection 1.1.2--Subsection 1.1.3-Section 1.2--Subsection 1.2.1--Subsection 1.2.2--Subsection 1.2.3-Section 1.3--Subsection 1.3.1--Subsection 1.3.2--Subsection 1.3.3Chapter 2-Section 2.1--Subsection 2.1.1--Subsection 2.1.2--Subsection 2.1.3-Section 2.2--Subsection 2.2.1--Subsection 2.2.2--Subsection 2.2.3-Section 2.3--Subsection 2.3.1--Subsection 2.3.2--Subsection 2.3.3Chapter 3-Section 3.1--Subsection 3.1.1--Subsection 3.1.2--Subsection 3.1.3-Section 3.2--Subsection 3.2.1--Subsection 3.2.2--Subsection 3.2.3-Section 3.3--Subsection 3.3.1--Subsection 3.3.2--Subsection 3.3.3Consider the block of code below and find how many times line 8 gets executed when input has values: 5, 6, 11, 12 int input;bool ok = true; while( ok ){ cin >> input; if( input > 6 || input < 9 ) ok = false; // line 8}