Which of the following programs will NOT cause an error?
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: What is the value in AL after the following program is executed? MOV AL, B5H MOV BL, A5H NOT AL INC…
A: Lets try to do the operations one by one 1. MOV AL, B5H Contents of AL = B5 decimal = 181 binary =…
Q: How many lines of output will be displayed on the screen after the following program is executed?
A: In this question, we are asked to give the correct output of given below code: int main(){ int i…
Q: hat are the values of i and j after the following code has been executed and i and j are both set to…
A: Here is the Solution. GIVEN:- it is given that i and j are both set to 15 before the code is…
Q: Which of the following statements are true?
A: A Hausdorff space is a topological space with a separation property.
Q: Which of the following statements is correct? Circle c;Circle c();
A: Given: Which of the following statements is correct? Circle c;Circle c();
Q: Which of the following statements Select one;
A: .
Q: What is the number of execution times of the following program?
A: What is the number of execution times of the following program? label1: MVI B, O INR A loop label1…
Q: What is printed by the following code segment?
A: The correct is ("cow?now?how?brown?") Option("D") Explanation If the break statement is located…
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: Which of the following C input statements will correctly read input and store it in an character…
A: Option C
Q: The below program will run without any errors
A: Since value of y is entered as string and value of x will entered as integer because of int…
Q: How many times will the value in y be displayed in the following program segment ?
A: Output:…
Q: Which directive marks the end of a conditional block of statements?
A: To end the statement of a conditional block, the directive used is .eb.
Q: What is printed by the above code?
A: #include<iostream> using namespace std; void processing(int, double &, char &); int…
Q: Which of the following is not a jump statement in C++? a. break b. goto с. exit d. switch
A: According to the question The Switch statement is used to make certain statements in a few of the…
Q: Which of the following statements is true?
A: Required: Matlab Which of the following statements is true?
Q: c# Write program that asks to enter an x numbers and sum the even numbers and odd numbers…
A: Write program that asks to enter an x numbers and sum the even numbers and odd numbers separately…
Q: In the following expression, select the last operation you would complete. ~p ∨ (q ↔ r)
A: GIVEN: In the following expression, select the last operation you would complete. ~p ∨ (q ↔ r)
Q: Which of the following operator in python will remove the decimal part?
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: Given the code below, which of the following statements will evaluate to True?
A: class F: ... # Implementation Ommited class G(F): ... # Implementation Ommitedclass H(F): ...f =…
Q: Indicate whether the following statement is true or false. * -
A: Lets see the solution.
Q: what is the output of the following code segment: int num = 15;
A: continue skips the current instruction and the steps present inside it in the block and moves to…
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: what is the output of the following code segment: int num = 12; while(num >= 0) { if(num % 5 == 0) {…
A: To find the output for the given code. int num=12; while(num>=0) { if(num % 5 == 0)…
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: Which is the correct output of the following code?
A:
Q: Which of the following is used for a loop in Python? a. if b. elif c. else d. while
A: Answer: Option a: if is decision making statement which executes after certain condition is being…
Q: What is the output of the following code?ch = 'a'ch2 = ch.upper()print(ch, ch2)
A: Here character ch is initialised value a.
Q: Which of the following statements about the above program is true? (Choose all that apply)
A: Option (a) is correct option
Q: What will be output by the above code segment ?
A: #include <iostream> using namespace std; int main(void){ int m=1,n=2; //initialize m…
Q: What is the value stored at variable "x" after executing the following code segment
A: Please find the answer below :
Q: Indicate whether the following statements are true or false:
A:
Q: Which of the following statements is not true? Select one: O a. Using function can make a program…
A: According to the Question below the Solution:
Q: In the below given program there is an error, find the error and write the correct statement.
A: In assignment statement num2 variable is not passed, hence it will return syntax error, num not…
Q: ?Which of the following assignment statements is not correct x = ++x; x++ = y + 2; x += ++y; x = x++…
A: I have provided solution with justification for given question.
Q: given the following code segment, what is the output? And Why
A: According to the question we need to find the output for the following program
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: Which of the following lines of code returns an error?
A: Given:
Q: Which of the following statements is true about the following block of code?
A: So the problem is bit a pseudo code we can read the code and based on the logic give the answer.
Q: Which one of the following changes to the program modelled below will be the easiest to make?
A: A class diagram depicts a static structure of classes, their operations, methods, and relationships…
Q: What is the output of the following code segment: int x = 9; int y = 1; while (x != 0) { x/= y; x++;…
A: Given data:-
Q: Which of the following is not true at the end of the program?
A: Given: MCQ of python classes is given, after completing the program what will be the correct option…
Q: Which of the following is the correct output for the following code?
A: Given - k = 6, a = -1 k%=a --> k = k%a = 6%-1 = 0 if(k%6 == 1) --> if(0%6 == 1) --> false…
Q: Which of the following statements is correct to compute the following mathematical equation? *
A: Required: What is the solution of this problem?
Q: What is the function of the above programs
A: Given : AMM PROC CMP AX,97 JL DONE CMP AX,122 JG DONE SUB AX,32 DONE: RET AMM ENDP
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Please post answer in Coral One lap around a standard high-school running track is exactly 0.25 miles. Write a program that takes a number of miles as input, and outputs the number of laps. Ex: If the input is 1.5, the output is: 6.0 Ex: If the input is 2.2, the output is: 8.8 Your program should define and call a function: Function MilesToLaps(float userMiles) returns float userLapsQuestion R .Consider the program segment below : #include <stdio.h> void guess (int,int); int main() { int a = 100, b = 200; int c; printf (“a is %d, b is %d\n”, a, b); guess (a, b); printf (“a is %d, b is %d\n”, a, b); return 0; } void guess (int x, int y) { int value; value = x; x = y; y = value; printf (“x is %d, y is %d\n”, x, y); } A. Identify the function call, the function header and the function prototype. B. What is the data type of x? C. Determine the output. Full explain this question and text typing work only We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this lineMark the following statements as true or false: a. To use a predefined function in a program, you need to know only the name of the function and how to use it. (1) b. A value-returning function returns only one value. (2, 3) c. Parameters allow you to use different values each time the function is called. (2, 7, 9) d. When a return statement executes in a user-defined function, the function immediately exits. (3, 4) e. A value-returning function returns only integer values. (4) f. A variable name cannot be passed to a value parameter. (3, 6) g. If a C++ function does not use parameters, parentheses around the empty parameter list are still required. (2, 3, 6) h. In C + + , the names of the corresponding formal and actual parameters must be the same. (3, 4, 6) i. A function that changes the value of a reference parameter also changes the value of the actual parameter. (7) j. Whenever the value of a reference parameter changes, the value of the actual parameter changes. (7) k. In C++, function definitions can be nested; that is, the definition of one function can be enclosed in the body of another function. (9) l. Using global variables in a program is a better programming style than using local variables, because extra variables can be avoided. (10) m. In a program, global constants are as dangerous as global variables. (10) n. The memory for a static variable remains allocated between function calls. (11)
- **PLEASE READ THE WHOLE QUESTION!!"" Write a python, program that prints a pyramid made of letters in the middle of the screen. Use functions with parameters for this assignment. The base width of the pyramid is determined by a character the user enters. If the user enters the letter o, the following pyramid will be printed. It can be assumed that the screen width is 80 characters. The following assignments make use of functions with return values ("fruitful functions"). So if the user enters the letter o it will print the ******The input is not always o, the input o is just an example, so the user can enter also a letter like u or w or something else******** **nBesides that the code may not have the charArray = 'abcdefghijklmnopqrstuvwxyz', but it needs to have the range code like (range(97,123)) or something else **Question 4 # Given a number, this function will compute the factorial # For example 4! = 1 x 2 x 3 x 4 = 24. Note that the value of 0! is 1. def get_factorial(number): """ what it takes? number to calculate its factorial what it does? given a number, find its factorial such as 5! = 20 Do not use a python built-in function - code it what it returns? factorial of a number 5! shoukld return 120 It will return integer """ # your code goes in here Test case for question 4 try: if get_factorial(5) == 120: score['question 4'] = 'pass' else: score['question 4'] = 'fail' except: score['question 4'] = 'fail' get_factorial(5)Write a function number_of_pennies() that returns the total number of pennies given a number of dollars and (optionally) a number of pennies.input: 5 6 4 Output: 506 400 My Code: def number_of_pennies(dollars=0, pennies=0): numer_of_pennies = (dollars * 100) + pennies return number_of_pennies print(number_of_pennies(int(input()), int(input()))) # Both dollars and penniesprint(number_of_pennies(int(input()))) # Dollars only However, this is the output that I am getting: <function number_of_pennies at 0x7f6a5e1d7e50> <function number_of_pennies at 0x7f6a5e1d7e50>
- Write a program whose inputs are three integers, and whose outputs are the largest of the three values and the smallest of the three values. Ex: If the input is: 7 15 3 the output is: largest: 15 smallest: 3 Your program must define and call the following two functions. The function largest_number() should return the largest number of the three input values. The function smallest_number() should return the smallest number of the three input values. largest_number(num1, num2, num3)smallest_number(num1, num2, num3) Note: DO NOT use max() and min().Write a program whose inputs are three integers, and whose outputs are the largest of the three values and the smallest of the three values. Ex: If the input is: 7 15 3 the output is: largest: 15 smallest: 3 Your program must define and call the following two functions. The function largest_number() should return the largest number of the three input values. The function smallest_number() should return the smallest number of the three input values. largest_number(num1, num2, num3)smallest_number(num1, num2, num3) Note: DO NOT use max() and min(). python please explain so i understand def largest_number(num1, num2, num3): # Type your code here. def smallest_number(num1, num2, num3): # Type your code here. if __name__ == '__main__': # Type your code here.Write a program whose inputs are three integers, and whose outputs are the largest of the three values and the smallest of the three values. Ex: If the input is: 7 15 3 the output is: largest: 15 smallest: 3 Your program must define and call the following two functions. The function largest_number() should return the largest number of the three input values. The function smallest_number() should return the smallest number of the three input values. largest_number(num1, num2, num3)smallest_number(num1, num2, num3) Note: DO NOT use max() and min(). python please explain so i understand def largest_number(num1, num2, num3): # Type your code here. def smallest_number(num1, num2, num3): # Type your code here. if __name__ == '__main__': # Type your code here. this is what i did def largest_number(num1, num2, num3): if(num1>num2 and num1>num3): return num1 elif(num2>num1 and num2>num3): return num2 else: return num3…
- doing this activity on zylabs. 8.18 LAB: Miles to track laps One lap around a standard high-school running track is exactly 0.25 miles. Write the function miles_to_laps() that takes a number of miles as an argument and returns the number of laps. Complete the program to output the number of laps. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('{:.2f}'.format(your_value)) Ex: If the input is: 1.5 the output is: 6.00 Ex: If the input is: 2.2 the output is: 8.80 Your program must define and call the following function:def miles_to_laps(user_miles) I get the two points for executing the code correctly, then it asks for unit tests. I don't know how to get the remaining 8 pointsI do not know how to do this problem from my Computer Science ZyBooks Chapter 6 assignment. I have attatched an image of the problem, and I need to write the code in Python. I am not sure how to set up the conditions correctly within the function (the times, true/false statements for morning, and true/false statements for weekend), so help on that would be greatly appreciated! Thanks!Suppose that you are a teacher, depending on the number of students taking your course, write afunction where you can enter the names of students and their grades respectively.After executing/calling this function, you should see these results on your screen: the name and grade of the student with the highest grade the average of the all grades solve by using MATLAB program