- Show the printout of the following code:
Q: The value of BX after executing the following piece of code is : *
A: According to the question, we need to find the value of BX after executing the code: XOR AX, AX ADD…
Q: please try to code them and send the output
A: Since the programming language is not mentioned I have coded this using Python 3.
Q: 1. Show the printout of the following code: bool b = true; int i = b; cout << b << endl; cout << i…
A: Code bool b = true; basically in this code we are assigning b with the value 1. Because bool type…
Q: What is wrong in the following code? double x = 3.0;int* pX = &x;
A: GIVEN: What is wrong in the following code? double x = 3.0;int* pX = &x;
Q: Can the following code run? If so, what is the printout?x = 10if x < 0:y = -1else:y = 1print("y…
A: Yes this code can be executed it is a Python Code Code x = 10if x < 0: y = -1else: y =…
Q: What is the output of the following code? def test func (*a) : print (a [0]) test func (1,2,3,4)…
A: PYTHON is one of the most widely used programming language currently, many new engineers prefer…
Q: What is the output of the following code? A = [1,1,2;3,6,9] b = [3, 4] C=A.* b
A: (a) Code will return the error : Matrix dimensions must agree.
Q: 4. Write pseudo code that will perform the following. a) Read in 5 separate numbers and calculate…
A: Required:
Q: Fill-In Blanks of the following question: Postfix 2 3 4 * 5+ - is equal to...................
A: Please refer below for your reference: The given postfix expression is : 2 ,3,4,*,5,+,-
Q: Given initial values of x and a code: and count count+=y; if (count 3 X--; else X++; Give the value…
A: Given x=2,y=1,count=2 count =count+y=2+1
Q: - What will be the value of M as a result of the following operations? int M; M=33/5; cout<<M; 06,5…
A: We will run this code in a proper C++ program. Then we will get the output.
Q: Given the following declaration: int x; int* p; Which of the following expressions is allowed?
A: CODE(SCREENSHOT) : Explanation : in line 4 , an integer variable x is declared. in line 5 , a…
Q: I need to write the following code taking entera from the user.
A: The answer to thee following question:-
Q: Find out the error of the following code and correct it.
A: The given code is: class Equals{ public static void main(String[] args) { int x = 100;…
Q: Answer the output of the given code below
A: To do: Output of the given code
Q: Fix all the errors in the following code by filling in the table below and display the output after…
A: Given: Required: find the error in the code
Q: Complete the code as below mentioned. Write all
A: Here, in this question, we are asked to develop a GO code. It is stated that the amount of potatoes…
Q: Please write this code and show me the output
A: Find output of given code
Q: What is the output of the following code? print(3**3//-4) а) -2 b) 6 с) -6 d) -7
A: Find the answer with explanation and output:
Q: Show the printout of the following code: int x = 30;int* p = &x;cout << *p << end1;…
A: Code: #include <iostream> using namespace std; int main(){ int x = 30;int* p = &x;cout…
Q: 8. a. Trace Thru the following code. Simply display the output. What is the output of the following…
A: Let's understand what this code will do . We have one list 1,2,3,4,5,6 Next we have the for loop…
Q: Program this
A: The Answer is :-
Q: 8- Evaluate the following code (5 > 6 || 4> 3) && (7>8)
A: The logical operators are the operators that are used to combine two expressions.
Q: What is the output of the following code? def test func(*a): print (a[0]) test func(1,2,3,4) test…
A: Actually, python is a easiest programming language.
Q: What is the output of the following code? Explain. int x = 80000000;while (x > 0) x++;cout…
A: What is the output of the following code? Explain. int x = 80000000;while (x > 0) x++;cout…
Q: Based on the code segment below, fill in correct code line using call by reference. void func (__---…
A: code segment given is- void func(____________________){ total=x*y; }
Q: What are the values of i and j after executing the following code
A: The statements in loop gets executed only if condition specified evaluates to True
Q: What is the value of n3 after the following code is executed:
A: The correct answer is: 14 Here is the explanation: Code Result Explanation: int n1 = 2;…
Q: write the code
A: The code for the problem:
Q: What will be the output of given code.
A: In the given code a char variable ch is initialised with value 'A'. Then in output &ch is…
Q: 21.Show the printout of the following code: int a = 63; a + 1; cout << a << endl; a *= 6; cout << a…
A: The question is to give the output of the code.
Q: What does the following code segment do? for i in range(5) : x.append(C[ ]) for j in range(3) :…
A: In the first line x=[] an empty list is created. Then in the next line, 5 empty lists are added to…
Q: Vhat is the output of the following code? for r in range (1, 3): for c in range (1, 2): print (c,…
A: 1 1
Q: What are the final values of x and y in this code
A: Q: Output of the given code
Q: Please show the output of the code!
A: Given, We have to provide the output of the given code, Code: #include <stdio.h> union…
Q: What is the output when the following code fragment is
A: First Question: In the cout statement, the expression follows the rules of operator precedence and…
Q: What is the output of this code
A: In this question, a code segment is given and we are asked to give the correct output Given Code:
Q: Question 1: Give the output from the following pieces of code: Code Output
A: Question given (1): Some piece of code given, what is the output of them. Solution (1):…
Q: What is the output of the following code?lst = [1, 2, 3, 4, 5, 6] for i in range(1, 6):lst[i] =…
A: lst = [1, 2, 3, 4, 5, 6]for i in range(1, 6): lst[i] = lst[i - 1] print(lst)
Q: Can you please break the above code into 3 sections (loan.h, loan.cpp and main.cpp and give me the…
A: Please refer to the following steps for the complete solution to the problem above.
Q: Given the following code what will be the output?
A: Java is a programming language. It contains extensive libraries (package). It can be used to create…
Q: A1. Find the output of the following code in order.
A: Here, the concept of constructor chaining is used. Constructing an instance of a class invokes or…
Q: Why is there no output when you run the code? for j in range (1, 6, -1): print(j)
A: The for loop in the python programming language has the following syntax: for number in range(start,…
Q: what is the worst case of the code below
A: Task :- find out the worst case runtime of the given code.
Q: Use the Switch statements and create a calculator that can accept input from user (with type…
A: Introduction of the Program: The C++ program calculates power, square root, and log of the given…
Q: 8- The output of the following program is:- * DO 111 M= 1 , 2 DO 122 J=1,6,2 122 CONTINUE PRINT*, M…
A: Given question has asked to print the output of given FORTRAN codes:- Code1 DO 111 M = 1,2DO 122 J…
Step by step
Solved in 3 steps
- Monty Hall Problem – Coding Lab In this lab, you will write a code that simulates the Monty Hall Game Show. Thegame host gives the participant the choice of selecting one of three doors. Twodoors has a goat behind them and one door has a prize. The set of choices arerandomized each round. The participant needs to select the door with the prizebehind it. When the participant selects a door, the game host reveals a door with agoat behind it. The game host opens a door (different from the one selected by theparticipant) that has a goat behind it. The participant is then given the option tochange their choice. When you run your code, the code would display a message prompting the user toinput their door choice, labelled as 1, 2, and 3. Then the code will display a doornumber (different from the one the user picked) with a goat behind it and ask theuser if they would like to change their choice. The code then displays a message onwhether the user guessed the correct door. The game then…Laboratory Exercises – Java Lesson 5: Creating Classes and Objects 1 a . Create a class named Pizza. Data fields include String for toppings (such as “pepperoni”), an integer for diameter in inches (such as 12) and double for price (as in 13.99). Include methods to get and set values for each of these fields. b. Create a class named TestPizza that instantiates one Pizza object and demonstrates the use of the Pizza set and get methods.Project Name: ActivitiesClass name: Dollar_Conversion Write a Java program that will accept theamount of US Dollar and convert to PhilippinePeso. The current exchange rate is 1 dollar is to 49.75pesos. Convert 50 dollars to peso. Display the converted value using three (3)decimal places. Using blueJ
- Challenge Activity 1: Turtle Graphics (PYTHON): Hit the Target Modification Enhance the hit_the_target game program shown in the computer lab activity above, so that, when the projectile misses the target, it displays hints to the user indicating whether the angle and/or the force value should be increased or decreased. For example, the program should display messages such as 'Try a greater angle' and 'Use less force.'Java Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A,B,C,D,E" is correct. Each question has one correct answer. Thank you. Part 1 - 5. Given the following code, the date is set to be __. Calendar cal = Calendar.getInstance();cal.set(2059, 0, 1, 2, 2, 1); A. Feb 1, 2059B. Mar 2, 2059C. Jan 1, 2059D. Feb 2, 2059E. Jan 2, 2059 Part 2 - 6. Given the following code, what is the output if the current time is 14:55:32? Calendar cal = Calendar.getInstance();System.out.println(get(Calendar.AM_PM)); A. AMB. PMC. 0D. 1E. Calendar.AMC++ code A simple version of snakes and ladderImplement a game that initially asks how many players will play the game. The game will then ask the name of each player. The game is played as follows:1. The game is played iteratively. In every iteration, every player takes turn to roll a dice. The face value of dice is added to the total score of the player.2. The first player to reach 100 score gets 1st position. The second player to reach 100 score gets 2nd position.3. When a player reaches 100, he no longer remains part of the play. If current score + face value is greater than 100, then the player will retry in the next iteration, i.e., the score must exactly become 100.4. There are ladders at 20 and 60. If a player’s score becomes exactly 20, the score becomes 40. If a player’s score is exactly 60, the score becomes 75. Similarly, there are snakes at 50 and 90. If a player’s score is exactly 50, the score become 40. If a player’s score is exactly 90, the score becomes 79.5. When n-1…
- Censorship. Create a program that reads text, and produces a new output text in which all four-letter words are replaced with "****". For example, for input “The class was easy”, the program outputs “The was “.Java Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A,B,C,D,E" is correct. Each question has one correct answer. Thank you. Part 1 - 9. Given the following code, the output is the date and time of __.Calendar cal = Calendar.getInstance(); TimeZone tz = TimeZone.getTimeZone("Europe/Rome");TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");TimeZone tz = TimeZone.getTimeZone("Asia/Istanbul");System.out.println(cal.getTime()); A. the "Europe/Rome" time zone.B. the time zone is computer is currently set to use.C. the "America/Los_Angeles" time zone.D. the "Asia/Istanbul" time zone.E. All of the three listed time zones. Part 2 - 10. Given the following code, the output is the date and time of __. Calendar cal = Calendar.getInstance();TimeZone tz = TimeZone.getTimeZone("Europe/Rome");cal.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));TimeZone tz = TimeZone.getTimeZone("Asia/Istanbul");System.out.println(cal.getTime()); A. the "Europe/Rome"…nstructions The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly. An example of the program is shown below: Enter the amount of your check >> 12.99 Enter the amount of your friend's check >> 9.50 The tip should be at least $1.9485 The tip should be at least $1.425 Task 1: The DebugThree1 class compiles without error. Task 2: The calcTip() method calculates a 15% gratuity. Task 3: The DebugThree1 program accepts user input and displays the correct output.
- (Simple computation) The formula for computing the discriminant of a quadratic equation ax^2 + bx + c = 0 is b^2 – 4ac. Write a program that computes the discriminant for the equation 3x^2 + 4x + 5 = 0. Class Name: Exercise01_01ExtraGrey lines (start - 20 & 22-end of code) can NOT be edited. New JAVA code must be in between theses as show on line 21 in image.assign(self, assignment:Assignment) -> AssignmentResult: """ This function is to simulate the process of the student receiving an assignment, then working on the assignment, then submitting the assignment and finally receiving grade for the assignment. This function will receive an assignment then a grade should be calculated using the following formula: grade = 1 - (Student's current energy X Assignment difficulty level). The min grade a student may receive is 0% (0) After the grade is calculated the student's energy should be decreased by percentage difficulty. Example if the student has 80% (.8) energy and the assignment is a difficultly level .2 there final energy should be 64% (.64) = .8 - (.8 * .2). The min energy a student may have is 0% (0) Finally the grade calculated should be stored internally with in this class so it can be retrieved later. Then an Assignment Result object should be created with the student's ID, the assignment…