At which line would the following program terminate with an error? Assume the user types '3' on line 01, '0' on line 02, '5' on line 03, and '2' on line 04.
Q: Which of the following expressions results in an error? a. float(‘10’) b. int(‘10’) c. float(’10.8’)…
A: All are explicit conversations. But int(’10.8’) has an error because we can't convert float values…
Q: Ask the user for a name and for a list of test scores. Show the number of tests taken and the…
A: import java.util.ArrayList;import java.util.List;import java.util.Scanner;public class Main {…
Q: 8) Write a program that asks for the user’s name and then the program will output the last 4…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
Q: Q3: Write a VB program to enter a mark of a student and then find his grade as follows: If mark >=…
A: Get input from user and convert it to integer. Chek the input with all conditions and print output…
Q: if ( gender == 1 ) System.out.println( "Woman" ); else if ( gender == 1 ) System.out.println(…
A: Please find the answer below :
Q: Which code segment results in "true" being returned if a number is even? Replace "MISSING CONDITION"…
A: Option A - A variable num modulo 2 is used to check the num variable is even or not. The modulo…
Q: ii) Write a function that will perform following mathematical expression (note that, x, y and z are…
A: Here is the c++ program of above problem. See below steps for code and output.
Q: لغة اسمبلي 1- Write a program to read a letter in lower case then convert this letter to upper case…
A: 2.
Q: Problem: Write a program that converts degrees from Celsius to Fahrenheit, using the…
A: Since you have asked two separate questions and it was not clear which specific question you wanted…
Q: Q1: Write a program that read 10 Marks and print number of failed and succeeded marks.
A: Note: As no programming language is mentioned, therefore answering in python. Input to the Program :…
Q: Question 3) Write a program that perfoms all arithmetic operations using switch statement by taking…
A: EXPLANATION - A program is created . Create a variable of type character to take choice as an…
Q: If originally x=4, y=0, and z=2, what is the value of x, y, and z after executing the following…
A: Please find the answer below :
Q: Write a complete program that: 1. Prompts the user to enter a letter grade and reads in a letter…
A: The answer is given below:-
Q: Q1: Write VB program that enter number x, then evaluate equation, display the result in label1? 3 x…
A: The Y value if x <0 has been considered as x2+(5x)2-10 Used pow() and sqrt() mathematical…
Q: If originally x=10, what is the value of x after each of the expressions: a.++x b.x++
A: As per guidelines we are supposed to answer 1st question when multiple questions are posted. Thus…
Q: How many times will the value in y be displayed in the following program segment ?
A: Output:…
Q: 14. Write a program to repeatedly allow a user to calculate maximum heart rate estimates, using the…
A: Write a program to repeatedly allow a user to calculate maximum heart rate estimates
Q: 21. Draw a flowchart to read the names and ages of people terminated by 9999 and print the name of…
A: Input : Read the list of ages of the person until 9999 is entered. Read the list of names of…
Q: A mail order house sells five different products whose retail prices are as follows: * product 1:…
A: Logic: Use while loop to check the user inputs -1 for productNumber. Repeated accept e product…
Q: At which line would the following program terminate with an error? Assume the user types '1' on line…
A: 1. Code taking input is okay a. getting input in ff as string b. getting input in ii as…
Q: 2. Write a program to find value of z according to the following equations: Z-xty when r-1 Z-X-y…
A: 2. Purpose: The main purpose is finding the value of z that is by given equations and in…
Q: 4-how many errors in the program shown below? * PROGRAM circle_area
A: Answer: The correct answer of the given question is ("2").
Q: Q3: Write a VB program to enter a mark of a student and then find his grade as If mark >=75 print…
A: Algorithm 1.create one module name is marks 2.enter student name marks 3.calculate total marks…
Q: What is the output of the following code segment? int x = 5; if (x = 2) cout << "This is true!" <<…
A: The given code is : int x=5; if(x=2) cout<< "This is true" << endl; else…
Q: Write a program that uses switch statement to display the names of the days when numbers from 1-7…
A: CODE:-
Q: Write a program that prompts the user to input three numbers. The program should then output the…
A: #include<iostream> #include<algorithm> using namespace std; int main(){ cout…
Q: a) The program randomly generates two "integers between 0 and 9 inclusive" (int1 and int2) and…
A: Programming language is not mentioned in the question. So we will answer the program in C++…
Q: Which declaration has a logic error (circle one): w x /y/ z In the space below, write the ouput of…
A: The compilation errors are because of mismatch in datatypes whereas the logical error is because of…
Q: 04 write a program that accepts a day, month and year then calculate the day of year corresponding…
A: I will explain this question in details,
Q: The program randomly generates two "integers between 0 and 9 inclusive" (int1 and int2) and displays…
A: Programming language is missing in the question. So we will answer this program in C++ language. If…
Q: 2)write program that input three number and find the minimum number? 3)write program that input…
A: Main algorithm:- if(a<b && a<c) cout<<a<<" is minimum "; else…
Q: Q2] write a program calculates the value of( Q)from the following series x3 Q= 1+7 x+ + + ... 3! 4!…
A: #include <math.h>#include <stdio.h> double sum(int x, int n){ double i, total = 1.0;…
Q: Question 3: Write a program which reads in a starting day (Mon, Tue, Wed) and a time value in the…
A: from datetime import time,timedelta def main(): print("Enter a time in HHMM format:")…
Q: 3 نقاط This code print hello five times with the sequence of each word * .using Do While statement…
A: Module VBModule Sub Main() Dim i As Integer i=1 do…
Q: 2) Write a program (using if statement) to find weather the number entered by the user is even or…
A: PROGRAM STRUCTURE: Include the required header files. Start the definition of the main function.…
Q: Rewrite the following code segment using the conditional operators (?/:) if (x > y) Z = 13; else Z =…
A: According to the question Solution is below in step 2
Q: 19. Which of the following functions is a character-changing function? a.. toupper () b. isdigit ()…
A:
Q: What is the output of the following code snippet? Please ensure your answer is spaced according to…
A: The output of the following code- 1 2 3 5 8 13 Note: Option 1 and 3 are identical in the image.…
Q: Q4: Write Program to calculate and print values of Z, Y, W from the following equations? Z=Ax² +5…
A: Note : Answering the question in python as no programming language is mentioned. Input : Input A…
Q: If originally x = 4, y = 0, and z = 2, which is the value of x, y and z after executing the…
A: Code(in Java)-class Main{ public static void main(String[] args) {…
Q: Supply the codes so that numbers will display starting with s and ending with e. Assume that the…
A: code snippet:
Q: Write a program that prompts the user to input three (3) integers: MM, DD, and YYYY. For example, 07…
A: Use a function to check whether year is leap year or not and then an array to save the number of…
Q: Q1: Write a program to print square root of the number from zero to 6?
A: QUESTION-1 To find the square root of a number from 0 to 6, each number should be checked one by…
Q: Which of the following expressions results in an error? a. int(1011) b. int(‘1011’,23) c.…
A: The int() function will take two arguments first one is number it can be float, number in double…
Q: Which line in the following code segment possibly causes error or a program crash and why? Line 1:…
A: Answer: Given code is: Line1: int *p1,*p2;Line2: p1 = new int;Line3: p2 = new int;Line4: *p1 =…
Q: The following code returns a syntax error. if x > 5: print ("x is greater than 5."). print ("End of…
A: The question is does the given code return syntax error?
Q: Write a statement to calculate the equation or to convert the statement below using function from…
A: The question is to write C++ statements for the given problems.
Q: 9. Is the expression "sue" != "fred" True or False
A: Given statement: "sue" != "fred" We have to check whether this statement is true or false.
Q: Write a statement to calculate the equation or to convert the statement below using function from…
A: Ans 1: Square root of y import math y = 4 print(math.sqrt(y)) Output: 2.0 Ans 2: x to the power…
At which line would the following
Step by step
Solved in 2 steps with 1 images
- def getDimension(): row = int(input("Enter number of rows (between 4 and 10): ")) while row < 4 or row > 10: row = int(input("Invalid input! Enter number of rows (between 4 and 10): ")) column = int(input("Enter number of columns (between 4 and 10): ")) while column < 4 or column > 10: column = int(input("Invalid input! Enter number of columns (between 4 and 10): ")) return row, column def printBoard(board): for row in board: print("|", end="") for cell in row: if cell == "": print(" ", end="") else: print(cell, end="") print("|", end="") print() print("-" * (len(board[0]) * 2 + 1)) def dropToken(board, col, token): row = len(board) - 1 while row >= 0: if board[row][col] == "": board[row][col] = token return row row -= 1 return -1 def isValidLocation(board, col): return board[0][col] == "" def isTie(board):…A palindrome is a word or phrase that is identical when you read from forward or backward, such as the words “racecar” and “madam.” A standard palindrome is similar to a perfect palindrome, except that spaces and punctuation are ignored in a standard palindrome. For example, “Madam, I’m Adam” is a standard palindrome because the characters are identical forward or backward, provided you remove the spaces and punctuation marks. Write a PHP script that checks words or phrases stored in two separate string variables to determine if they are a perfect palindrome. In addition, see if you can modify the program to check for standard palindromes. create a web page with a text field and “Reset” and “Submit” buttons. When a user clicks on the submit button, show the standard and perfect palindromes of the string that was entered in the text field on the same page. Create a separate Index.html and php filePlease use Python Programming. Write the code for an application to convert and display a (decimal) number in binary and hexadecimal notation: (see image resource 1) Note that the binary and hexadecimal equivalents should be displayed as LCD numbers. Hint: Use the QLCDNumber class. If the user enters an invalid integer, an error message like the following should be displayed: (see image resource 2) Similarly, if there is an overflow in the number of digits displayed for the binary representation, an appropriate error message should be displayed. Use signals and slots to connect the various buttons to the appropriate functions. Submit the code of all classes that you write, as well as the main program that creates and shows the GUI window. Submit images of the application while it is running to show that it works as required.
- A palindrome is a word or phrase that is identical when you read from forward or backward, such as the words “racecar” and “madam.” A standard palindrome is similar to a perfect palindrome, except that spaces and punctuation are ignored in a standard palindrome. For example, “Madam, I’m Adam” is a standard palindrome because the characters are identical forward or backward, provided you remove the spaces and punctuation marks. Write a PHP script that checks words or phrases stored in two separate string variables to determine if they are a perfect palindrome. In addition, see if you can modify the program to check for standard palindromes. create a web page with a text field and “Reset” and “Submit” buttons. When a user clicks on the submit button, show the standard and perfect palindromes of the string that was entered in the text field on the same page.Write code so that you make another image below the image currently in the code so that they are next to each other but not touching each other. And Translate - A function that moves the graphic according to the given input . Grow - a function that increases the size of the graphic according to the given input public class BasicGraphicViewer{ public static void main (String[] args) { Rectangle r1 = new Rectangle(100,10,20,30); r1.draw(); Picture p1 = new Picture(); p1.load(“someimageurl”); // you can put any image link here. p1.draw(); } }Transcribed Image Text Python Development Lab In Merworld there exists 2 coins of different denominations types 5-peso coins and 10- peso coins, both having two faces with image of – Elon Musk and a dog. You are assigned a task to find out the number of ways to arrange these coins so that their sum is N pesos. Arrangement should be done in such a way that the first coin in the arrangement should always have Elon Musk image up. Other coins could have any image. Input Output 1 60 5 LO
- ISP- Java Write a program that will output a right triangle based on user specified input height (int) and specified input symbol (char). The first line will have one user-specified character, such as % or *. Each subsequent line will have one additional user-specified character until the number in the triangle's base reaches specified input height. Output a space after each user-specified character, including after the line's last user-specified character. Hint: Use a nested for loop. Ex: If the input is: Enter a character: * Enter triangle height: 8 the output is: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *int calc=1; for (i=1;iTranscribed Image Text salary = 8000 def printSalary(): salary = 12000 print("Salary:", salary) printSalary) print("Salary:", salary) What is the output of the following code?Q3. Write a python code to do the following operations. 1. Create a stress tensor and a strain tensor in form of NumPy arrays: -0.2 0.5 4.3 0.0 5.2 1.0 a= -0.2 0.5 0.0 2. The hydrostatic stress is 0.02 -0.01 0.03 €= -0.01 0.2 -0.05 0.03 -0.05 0.4 Ohyd = (tro) 1. and the deviatoric stress is deyddyd Define a function stress hyd_dev () which takes in a stress tensor and returns the hydrostatic stress and the deviatoric stress. Then, apply this function to calculate the hydrostatic stress and the deviatoric stress of the stress defined in Question 1. where R is the rotation matrix 3. If we rotate the material, the representation of the stress tensor will change. Suppose that the coordinate system is (e₁,e₂, es). If we rotate the material about an axis u= (₁,42,43) (a unit vector) by the angle 6, the representation of the stress tensor will become oRo, cos @ + u(1-cos) R=424(1-cos) + 3 sin u₁u₂(1-cos 9)-uy sin cos+u(1-cos) uu₂(1-cos 8) + u, sin 0 uu(1-cos 0) + u₂ sin 0 ₂(1-cos)-uj sin 0…Java Program - Functions with 2D Arrays Write a function named displayElements that takes a two-dimensional array, the size of its rows and columns, then prints every element of a two-dimensional array. Separate every row by a new line and every column by a space. In the main function, write a program that asks for integer input to be assigned on a 3 x 3 array and call the function displayElements to print the contents on the next line. Input 1. Multiple lines containing integer each line Output R1C1: 1 R1C2: 2 R1C3: 3 R2C1: 4 R2C2: 5 R2C3: 6 R3C1: 7 R3C2: 8 R3C3: 9 1 2 3 4 5 6 7 8 9Assuming that you have the functions "drawPolygon(int[] x, int[] y, int n)" for drawing polygon, "drawRectangle(int x, int y, int width, int height)" for drawing rectangle and "drawCircle(int xc, intyc, int radius)" for drawing circle; draw the given shape. Where: R(300,250), T1(325,275), T2(475,275), T3(400,400), Pı(285.250), P2(225.275), P3(200,450), P4(285, 300), Q1(515,250), Q2(575,275), Q3(600,450), Q4(515,300) C6: (300,75), R=50 C7: (500,75), R=50 C1: (400,150), R=100 С4: (350,150), R-10 C5: (450,150), R=10 C2: (400,195), R=50 C3: (400,175), R=30 C8: (400,225), R=15 P1 R P2, T2 P4 Q2 Q4 T3 Pa 200SEE MORE QUESTIONS