Description hput two numbers. Determine and print the larger number, smaller number. Als umbers in ascending and descending order. Test data: Enter 1st number: 4 Enter 2nd number. 2 r'inputs "/ Smaller number : 2 "output "/ Larger number :4 "output "/ Ascending order : 2,4 "output "/ Descending order. 4,2
Q: ta asciiz asciiz : .asciiz Ext Lobl main "Enter the first number: " "Enter the second number: "The…
A: Given the assembly language multiplication program with some blanks and options. Here are the…
Q: Use YOUR NAME, SURNAME, and DATE as a variable in your answer lab7 1. Write the program to present…
A: The problem is based on the basics of pointers in C programming language.
Q: program Credit Card Validator - Takes in a credit card number from a common credit card vendor…
A: program in C++
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: Find the errors in the following code:// This code contains ERRORS!int choice, num1, num2;Scanner…
A: Given: Find the errors in the following code:// This code contains ERRORS!int choice, num1,…
Q: Output The first line will contain a message prompt to input the random number being sent. The…
A: Java: Java is a high level object oriented programming language. Java is platform independent.…
Q: ask the user for an integer then ask the user if he/she wants to count up or down. Display a table…
A: Here I have taken input from the user for the ending number. Next, I have used an infinite loop.…
Q: nd the sum of digits of a given number } ;int n, reminder, sum=0 :":cout > n } { ;cout 0) n = n/ 10…
A: The block answers are as follows: In 1st block -> while(n>0) In 2nd block-> reminder=n%10…
Q: def myF(): x = 2 %3D y = 10 %3D x+= y*x+1 return X print (myF ()) Select one, a. 20 b. 23 c None
A: The given code is: def myF(): x=2 y=10 x+=y*x+1 return x print(myF())…
Q: Please input 5th unique number: Please input 6th unique number: 30 Conditions are not met. Please…
A: Code: winning=[10,20,40,45,46,49] while(True): print("Welcome to Lotto Draw!") print("1…
Q: How would the flowchart for this code look like? # -*- coding: utf-8 -*- """ Created on Sun Dec 13…
A: The flow char for the given program is
Q: The Upper bound limit is 90, lower bound limit is -100. If a value is inputted (not through user but…
A: Give a testValue Below is the algorithm for above program 0. Start 1. if testValue is greater than…
Q: nestion 3 im number1, number2, number3, result As Integer number1 = 1 result = 1 number 2 = 3…
A: Here in this question we have given a code segment and we have asked what will be final value of all…
Q: how to remove the space in this print statement print(third_num, ",", second_num, ",", first_num)…
A: In Python, to perform format operations format() method is used. It concatenate elements within a…
Q: ram that asks the user to enter his nanme and age and then it displays that name and age as well as…
A:
Q: Floor Division of two integer numbers will give answer as integer number. Select one: O True O False
A: Floor division is also known as integer division. In python floor division operator is (//). Floor…
Q: 1) Prompts the user in the variables xand y.. 2) Calculates the value of fas follows: Vx2 + y2 f…
A:
Q: rite MATLAB code. You have to take n-10 and X=100.. Atach screenshot as well
A: According to the question we have to write MATLAB code for the following question: In this code, the…
Q: 3. Given the values of three variables a = 2, b = 4, c = 7, write a program to (1) Calculate the sum…
A: I will provide the answer of this question in C++ programming language.
Q: Find the maximum value and minimum value in milesTracker. Assign the maximum value to maxMiles, and…
A: Given that We have to find the maxMiles and minMiles values for the given program. #include…
Q: 1 Dim y As Integer = 5 2 Dim sum As Integer = 0 3 For i As Integer = 7 To 1 sum += y ^i 5 Next Line#…
A: Code: Dim y As Integer = 5 Dim sum As Integer = 0 For i As Integer = 7 To 1 sum += y ^ i…
Q: Ask the user for two numbers (these can be entered in any order). Then print the numbers, and tell…
A: We are using #include<iomanip> so that we can use specific decimal places as we want. We are…
Q: Write a code to calculate your age from your date of birth.
A: As the programming language is not mentioned the following code is in c code: #include…
Q: 1. (Decimal to hex) Write a program that prompts the user to enter an integer between 0 and 15 and…
A: import java.util.Scanner;class Main{ public static void main(String args[]) { Scanner input…
Q: Problem: Read your name and one numeric value [Omani Rial], print the following menu as shown in…
A: Algorithm- Take input of name, value in Omani rials. Then take input of choice and use switch case…
Q: 1.Create simple number guessing game as follows. First, prompt the user to enter a min and max…
A: Given: please use java to answer the following question
Q: 4. Request an integer value for n from the console. Request a multiple of n and a factor of n from…
A: Code: #include<iostream>#include<math.h>using namespace std;main(){ //declaring…
Q: QUESTION 3 def func(x): return xX4 result func(14)-func(8)+func(2) print(result) What would be the…
A: The given code: def func(x): return x%4 result = func(14)-func(8)+func(2)print (result)
Q: yword? Single Choice 16.Which one is not a keyword? 19186114 191861144 A double B if 19T C return D…
A: answer is
Q: Problem: Read your name and one numeric value [Omani Rial], print the following in below output,…
A: PROGRAM CODE: #include <stdio.h> // include header file for standard input output…
Q: 2. Write math random statement to generate each of the following: 1. random number between 0 and 1.…
A: We can generate math random integers using: (int)(Math.random()*(max-min)+min) Following are the…
Q: # Program to print 0 if integer input is even; 1 if input is odd prompt1: prompt 2: prompt 3: label:…
A: Code is given below. .data Msg1: .asciiz "Enter the dividend:" Msg2: .asciiz "Enter the…
Q: Please enter starting number: -2 Please enter ending number: 2 Negative values are not accepted.…
A: import java.io.*;import java.util.*; public class Main { public static void main(String[] args) {…
Q: You are provided with 3 numbers : input1, input2 and input3. Each of these are four digit numbers…
A: Python program for above : #get 3 numbers input1 = input() input2 = input() input3 = input()…
Q: document.write( (Math.floor (Math.random () *2)-2) *10); choose One {-10.-20} -20.-40 -5.-10.-20.0…
A: Math.floor() and Math.random() are both fucntions available in JS or JavaScript. Math.random()…
Q: Create a software that calculates the sum of all the digits in a given number
A: The problem is based on the basics of loops in programming language.
Q: A-C, identify the errors and rewrite the statement. Save your code as PE4_2.py. myList =…
A: myList = ['apple','banana','cherry']print(myList[3]) The above array can't be printed like this…
Q: 2. Write math random statement to generate each of the 1. random number between 0 and 1. 2. random…
A: random() method is a static method of the Math class. It generates only double type random number in…
Q: ill downvote. Asking this question second time. Please give right code Please find errors. Write…
A: Comment part is the incorrect syntax; line no 13 : double d (float a,float b,float c);//double d…
Q: echo Enter your Name: read studentnane echo Enter your First Grade: read grade1 echo Enter your…
A: echo is used to print the content on console read is used to read the contents from console Now this…
Q: Correct the error in the following line of code. Edit the code 1 num = 5 2 if num 5: %3D 3 print…
A: Error in if condition if num = 5: is error num == 5 is correct = is used to assign value to a…
Q: 1. Repeatedly prompt the user to enter positives numbers. 2. Keep track of the largest even number…
A: I have given python code with output below.
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: Supply the codes so that numbers will display starting with s and ending with e. Assume that the…
A: code snippet:
Q: Please correct the codes of number two, so that it will appear correct in the output.
A: We need to modify the code for question number 2, to get correct output.
Q: lease Enter the first number: lease Enter the second number: lease Enter the number of the math…
A: Here we can use switch case since we are 4 options and one of the option needs to be performed The…
Q: What would be the value of variable number2. Assume that each expression in a, b, and e has been…
A: answer along with explanation and screenshot is given below
Q: 2/ Write code to get information of 5 students (Exam id , average) then check the average them if it…
A: It is case of simple if else and parallel array. Declare two array . One is ID and second one is…
Q: mport random import math Which of the following statements will assign a random integer from 30 to…
A: var = random.randrange(30,91) It generate the random numbers between 30 to 90 It produce starting…
Q: For each of the questions below trace through what values are stored in each variable as the code…
A: Manual tracing is used in programming to keep track of each instructions input, output and…
Write a C
Step by step
Solved in 3 steps with 3 images
- Computer Science Practice Task : Write a program in phyton language . Implement Water Jug Problem using DFS in Python, initial stage (0,0) and final stage (2,Y). A Water Jug Problem: You are given two jugs, a 4-gallon one and a 3- gallon one, a pump which has unlimited water which you can use to fill the jug, and the ground on which water may be poured. Neither jug has any measuring markings on it. How can you get exactly 2 gallons of water in the 4-gallon jug?For the end of year administration of Programming for History of Arts students you are to write a program that can do 2 things: calculate a final grade print a small graph of similarity scores and, if applicable, list the students under investigation The input is structured as follows: Piet van Gogh___5 6 7 4 5 65=20=22=10=2=0=0=1=0=1;Vincent Appel,Johannes MondriaanKarel van Rijn___7 8 6 62=30=15=8=4=3=2=0=0=0; The first line should be interpreted as follows: You have to calculate the final grade of the student. All grades have the same weight. The final grade is rounded as follows: a grade that is >= 5.5 AND < 6 should be noted as a "6-" otherwise, a grade will be rounded to the nearest half The second line should be interpreted as follows: <10 numbers separated by '='>;<zero or more names separated by ','> The first 10 numbers are the similarity scores. These scores represent the number of programs matching a certain percentage of the current program in steps…For the end of year administration of Programming for History of Arts students you are to write a program that can do 2 things: calculate a final grade print a small graph of similarity scores and, if applicable, list the students under investigation The input is structured as follows: Piet van Gogh___5 6 7 4 5 65=20=22=10=2=0=0=1=0=1;Vincent Appel,Johannes MondriaanKarel van Rijn___7 8 6 62=30=15=8=4=3=2=0=0=0; The first line should be interpreted as follows: You have to calculate the final grade of the student. All grades have the same weight. The final grade is rounded as follows: a grade that is >= 5.5 AND < 6 should be noted as a "6-" otherwise, a grade will be rounded to the nearest half The second line should be interpreted as follows: <10 numbers separated by '='>;<zero or more names separated by ','> The first 10 numbers are the similarity scores. These scores represent the number of programs matching a certain percentage of the current program in steps…
- For the end of year administration of Programming for History of Arts students you are to write a program that can do 2 things: calculate a final grade print a small graph of similarity scores and, if applicable, list the students under investigation The input is structured as follows: Piet van Gogh___5 6 7 4 5 65=20=22=10=2=0=0=1=0=1;Vincent Appel,Johannes MondriaanKarel van Rijn___7 8 6 62=30=15=8=4=3=2=0=0=0; The first line should be interpreted as follows: You have to calculate the final grade of the student. All grades have the same weight. The final grade is rounded as follows: a grade that is >= 5.5 AND < 6 should be noted as a "6-" otherwise, a grade will be rounded to the nearest half The second line should be interpreted as follows: <10 numbers separated by '='>;<zero or more names separated by ','> The first 10 numbers are the similarity scores. These scores represent the number of programs matching a certain percentage of the current program in steps…/* * rotate4 - Rotate x to the left by 4 * Examples: rotate4(0x87654321) = 0x76543218 * Legal ops: ~ & ^ | + << >> ! * Max ops: 10 * Rating: 2 */int rotate4(int u) { return 2;} Do not use any control constructs such as if, do, while, for, switch, etc.Please read the instructions carefully and keep in mind of the bolded phrase. 1. Create a Netbeans project and name it Test. 2. In the main method, ask the user for a string of letters. 3. Create a RECURSIVE (with loops, but CANNOT use duplicated strings) method that prints all the substrings of the input string in this order: If the user enters "abcd", the substrings will be: a ab abc abcd b bc bcd c cd d 4. The recursive method's signature is as follows: public static void printSub2(String s)
- Please read the instructions carefully and keep in mind of the bolded phrase. 1. Create a Netbeans project and name it Test. 2. In the main method, ask the user for a string of letters. 3. Create a RECURSIVE (WITHOUT LOOPS, but can use duplicated strings) method that prints all the substrings of the input string. The recursive method's signature is as follows: public static void printSub1(String s) 4. If the user enters "abcd", the recursive method will return the substrings in the this order: abcd abc ab a b bc b c bcd bc b c cd c d(Numerical) Write a program that tests the effectiveness of the rand() library function. Start by initializing 10 counters to 0, and then generate a large number of pseudorandom integers between 0 and 9. Each time a 0 occurs, increment the variable you have designated as the zero counter; when a 1 occurs, increment the counter variable that’s keeping count of the 1s that occur; and so on. Finally, display the number of 0s, 1s, 2s, and so on that occurred and the percentage of the time they occurred.Write this uing java Write a complete version of the Bresenham Midpoint algorithm to handle ALL slope values. slope = 0 slope > 0 slope < 0 slope = 1 slope > 1 swap the rolls of x and y slope < 1 slope = infinity ( needs special test case) Include appropriate tests for ‘special case’ conditions. Insteadof “WritePixel” write to the screen the coordinates of the pixel that would be drawn.
- Write a function in Java. Also, write a JUnit test output the following things should be output ask for the members from specific faculty output the top 5 scores members Recommend line up of top members OR members with similar interests list of members over a certain age Use arraylists arraylist name: groupNameC++ A robot is initially located at position (0; 0) in a grid [?5; 5] [?5; 5]. The robot can move randomly in any of the directions: up, down, left, right. The robot can only move one step at a time. For each move, print the direction of the move and the current position of the robot. If the robot makes a circle, which means it moves back to the original place, print "Back to the origin!" to the console and stop the program. If it reaches the boundary of the grid, print \Hit the boundary!" to the console and stop the program. A successful run of your code may look like:Down (0,-1)Down (0,-2)Up (0,-1)Left (-1,-1)Left (-2,-1)Up (-2,0)Left (-3,0)Left (-4,0)Left (-5,0)Hit the boundary! or Left (-1,0)Down (-1,-1)Right (0,-1)Up (0,0)Back to the origin! About: This program is to give you practice using the control ow, the random number generator, and output formatting. You may use <iomanip> to format your output. You may NOT use #include "stdafx.h".The type of recursion implemented in the following code is a tail recursion (True or False) ? Please explain/ justify your answer. public class ClassTest { public int test(int val) { if (val <= 0){ return val +1; } else return test(val-1) - test(val-2); } public static void main(String[] args) { ClassTest obj = new ClassTest(); int result = obj.test(4); System.out.println("Output is: " + result); } }